|BNF for a BASIC compiler email@example.com (Michael Ness) (2002-09-29)|
|Re: BNF for a BASIC compiler firstname.lastname@example.org (Scott Nicol) (2002-10-13)|
|Re: BNF for a BASIC compiler email@example.com (Michael Haardt) (2002-10-13)|
|Re: BNF for a BASIC compiler firstname.lastname@example.org (antoine) (2002-10-13)|
|From:||"Michael Haardt" <email@example.com>|
|Date:||13 Oct 2002 16:04:08 -0400|
|Posted-Date:||13 Oct 2002 16:04:08 EDT|
> Here is my first attempt at a defining a grammer using BNF. Is this the
> way BNF should look? Can anyone point out any mistakes I'm making? One
> thing that I am concerned about is the two token statment "END IF".
In my BASIC interpreter, I used this flex rule in the scanner:
ENDIF end[ \t]*if
It reflects the fact that some dialects use a space and others don't,
but either way, it is just one token for the parser. BASIC is obscure,
and that's not the worst yet, thinking of DATA.
I use a hand written parser, but if you are interested in the scanner,
check out the file token.l. The interpreter is available at:
Return to the
Search the comp.compilers archives again.