basic question about runtime query parsing

"falcon" <shahbazc@gmail.com>
11 Jul 2005 10:49:28 -0400

          From comp.compilers

Related articles
basic question about runtime query parsing shahbazc@gmail.com (falcon) (2005-07-11)
Re: basic question about runtime query parsing antounk@comcast.net (Antoun Kanawati) (2005-07-12)
Re: basic question about runtime query parsing skandgoe@gwdg.de (Skandinavisches Seminar) (2005-07-12)
Re: basic question about runtime query parsing wyrmwif@tsoft.org (SM Ryan) (2005-07-12)
Re: basic question about runtime query parsing gneuner2@comcast.net (George Neuner) (2005-07-12)
Re: basic question about runtime query parsing kers@hpl.hp.com (Chris Dollin) (2005-07-17)
Re: basic question about runtime query parsing lfinsto1@gwdg.de (Laurence Finston) (2005-07-22)
[7 later articles]
| List of all articles for this month |

From: "falcon" <shahbazc@gmail.com>
Newsgroups: comp.compilers
Date: 11 Jul 2005 10:49:28 -0400
Organization: http://groups.google.com
Keywords: parse, question
Posted-Date: 11 Jul 2005 10:49:28 EDT

Say I have a c library which implements various database functions and
contains relevant data structures. For effeciency, I keep 'records' of
a 'table' in a nativ c struct (so 4 'columns' in a table will show up
as 4 attributes of a struct). I can understand how this will work if
all someone wants to do is do queries. But what is usually done for
'create table' command issued by a user?


By that I mean, if someone issues 'create table(x int, y int, z int),'
I parse it and figure out I need a struct{int x, int y, int z} (this
struct will then be passed all over the code). How do I create this
struct during runtime? One way I can think of is to output the struct
definition to a file, compile it on the fly and use it. There has to
be a better way since there are a HUGE number of langauges which use
compile down to C and they must run into this issue regularly. I'm
afraid the solution is stupidly simple...but somehow I've missed it.
Any ideas?


Falcon



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.