Hi im done with lexical part of compiler. The next stage is the syntactic analyzer. How could i program my syntactic analyzer without using a database?

For example (base from turbo C)

                                               syntactic checker:
main()                                         valid
{                                              valid
int, x,y=1, z=1;                               invalid
x = y+z;                                       valid
printf("Hello World);                          invalid
printf("the sum is %d",x);                     valid
getch();                                       valid
{                                              invalid

it will display the syntactic checker in any form...
thank you. hope you would help me...

Don't know if it helps, but perhaps you can let your lexer do some syntax checking too. Look at this snippet for a modest example: http://www.daniweb.com/code/snippet217185.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.