|Grammar -> Parser question email@example.com (1998-06-04)|
|Re: Grammar -> Parser question firstname.lastname@example.org (Torbjorn Drevin) (1998-06-09)|
|Re: Grammar -> Parser question email@example.com (Torben Mogensen) (1998-06-09)|
|Re: Grammar -> Parser question firstname.lastname@example.org (1998-06-09)|
|Re: Grammar -> Parser question email@example.com (Quinn Tyler Jackson) (1998-06-09)|
|Re: Grammar -> Parser question firstname.lastname@example.org (Quinn Tyler Jackson) (1998-06-18)|
|From:||"Quinn Tyler Jackson" <email@example.com>|
|Date:||9 Jun 1998 12:05:34 -0400|
>Suppose I have the following Grammar:
>condition -> expr PLUS expr |
> LPAREN condition RPAREN
>expr -> ID |
> LPAREN expr RPAREN
>However, the LPAREN symbol is causing a problem: When I see it, I don't
>know if I'm dealing with a nested condition or a nested expression.
>How does one typically deal with this situation if one has to hand-code
>the parser? It looks like I need some sort of lookahead and/or backtracking
>mechanism so I can figure out which case I am dealing with.
What's the real difference between a "condition" and an "expression?"
Isn't a "condition" simply an expression that solves to non-zero, or is
there some reason that this is not the case with the grammar in question?
[Not all languages are C. Many languages have boolean variables and
boolean values separate from arithmetic values. -John]
Return to the
Search the comp.compilers archives again.