Click here to Skip to main content
15,885,985 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Option for an Exit Pin
Bartosz Bien20-Apr-03 4:32
Bartosz Bien20-Apr-03 4:32 
GeneralRe: Option for an Exit Pin
Anonymous20-Apr-03 5:41
Anonymous20-Apr-03 5:41 
GeneralRe: Option for an Exit Pin
Bartosz Bien20-Apr-03 6:23
Bartosz Bien20-Apr-03 6:23 
GeneralToolbar Tooltips Pin
DuFF19-Apr-03 14:41
DuFF19-Apr-03 14:41 
GeneralRe: Toolbar Tooltips Pin
Michael Dunn19-Apr-03 18:00
sitebuilderMichael Dunn19-Apr-03 18:00 
GeneralRe: Toolbar Tooltips Pin
cleathley19-Apr-03 19:09
cleathley19-Apr-03 19:09 
GeneralRe: Toolbar Tooltips Pin
Nick Parker20-Apr-03 3:43
protectorNick Parker20-Apr-03 3:43 
GeneralSQL statement parsing Pin
alex.barylski19-Apr-03 14:35
alex.barylski19-Apr-03 14:35 
I'm writting one for fun and i've only just began to realize that it's quite a tricky process. The implementation i have used is probably not the best(nor is it finished) so i would like to here how maybe more experienced programmers have tackled similar tasks.

(is my lingo correct???)
I basically parse the statement into the following token categories:
1) Command token (SELECT, CREATE, etc)
2) Fields token (mytable.name, etc)
3) Tables token
4) Expression token (mytable.name = 'test')
5) Misc token(s) (ORDER BY, LIMIT, etc)

Once the statement is parsed into the following categories some tokens are further parsed by another parsing engine, like expression tokens will later be passed to an Expression evaluator where again it will be broken down into smaller tokens like < = > + * /, etc...

Anyways, from whats been said, does it sound like i'm on the right track???

Oh yeah, heres another important part:

I start parsing by extracting the COMMAND from the original string
So: SELECT * FROM temp WHERE name = 'Test'
Becomes: * FROM temp WHERE name = 'Test'

This is accomplished using the function CParse::ExtractCommand()

Then I would call CParse::ExtractFields() and so on...

Is there another way to accomplish this???

Any ideas???

Thanks Smile | :)


"Two wrongs don't make a right, but three lefts do!" - Alex Barylski Smile | :)
GeneralRe: SQL statement parsing Pin
Toni7819-Apr-03 15:01
Toni7819-Apr-03 15:01 
GeneralRe: SQL statement parsing Pin
alex.barylski20-Apr-03 17:05
alex.barylski20-Apr-03 17:05 
Generalmfc dll <-> app communication Pin
eXplodus19-Apr-03 11:48
eXplodus19-Apr-03 11:48 
GeneralRe: mfc dll <-> app communication Pin
valikac19-Apr-03 12:15
valikac19-Apr-03 12:15 
GeneralRe: mfc dll <-> app communication Pin
Neville Franks19-Apr-03 12:29
Neville Franks19-Apr-03 12:29 
GeneralRe: mfc dll <-> app communication Pin
Bartosz Bien20-Apr-03 4:37
Bartosz Bien20-Apr-03 4:37 
GeneralRe: mfc dll <-> app communication Pin
eXplodus21-Apr-03 4:14
eXplodus21-Apr-03 4:14 
GeneralRe: mfc dll <-> app communication Pin
Bartosz Bien21-Apr-03 4:24
Bartosz Bien21-Apr-03 4:24 
GeneralRe: mfc dll <-> app communication Pin
eXplodus21-Apr-03 6:00
eXplodus21-Apr-03 6:00 
GeneralGetting Ethernet Card ID Pin
Toni7819-Apr-03 11:08
Toni7819-Apr-03 11:08 
GeneralRe: Getting Ethernet Card ID Pin
Phil Hamer19-Apr-03 16:38
Phil Hamer19-Apr-03 16:38 
GeneralRe: Getting Ethernet Card ID Pin
Toni7821-Apr-03 11:29
Toni7821-Apr-03 11:29 
GeneralReading BIOS Pin
Toni7819-Apr-03 11:03
Toni7819-Apr-03 11:03 
GeneralRe: Reading BIOS Pin
alex.barylski19-Apr-03 14:22
alex.barylski19-Apr-03 14:22 
GeneralRe: Reading BIOS Pin
Toni7819-Apr-03 14:51
Toni7819-Apr-03 14:51 
GeneralRe: Reading BIOS Pin
John M. Drescher19-Apr-03 21:03
John M. Drescher19-Apr-03 21:03 
GeneralRe: Reading BIOS Pin
Toni7821-Apr-03 11:30
Toni7821-Apr-03 11:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.