Date: Mon, 02 Aug 2004 23:51:15 -0400
Mime-Version: 1.0
Content-Type: text/plain; format=flowed

Aha! =)

The last suggestion worked great (thanks!).  But still, I still have a small 
problem.  It won't accept more than one 'statement'.  I know why, but can't 
fix it.  Take a look:

$ ./a.out
7 + 9 + 7 + 3 / (5 + 7);
        23.25
3 + 3 + 3;
Fatal Error: Parser is hopelessly lost...

Now, I know why, because my grammar look like this:
in ::= stmt ENDLINE.
stmt(A) ::= expression. { printf("%u\n", a); }
expression(A) ::= INTEGER(B). { A = B; }
expression(A) ::= expression(B) PPLUS expression(C). { A = B + C; }
expression(A) ::= expression(B) PSUB expression(C). { A = B - C; }
...etc...

Now its obvious why that will only accept one statement, but how to fix it?  
SQLite doesn't offer any help here because the parser seems to be 
reinitialized each statement, but that really isn't an option in my case.  
Is there any way?  In bison, you can simply make the start token right 
recursive (like in my last message):

in ::= in stmt ENDLINE.

But that doesn't seem to work in lemon.  I've also tried making the 2nd 
statement right recursive, but that doesn't work either because it doesn't 
seem to ever reduce all the way.

Any ideas?  Much thanks to all.

John

_________________________________________________________________
Planning a family vacation? Check out the MSN Family Travel guide! 
http://dollar.msn.com

Reply via email to