|simple ambigous grammar... email@example.com (2000-08-21)|
|Re: simple ambigous grammar... firstname.lastname@example.org (2000-08-27)|
|Re: simple ambigous grammar... email@example.com (2000-08-27)|
|Re: simple ambigous grammar... firstname.lastname@example.org (Venkatesha Murthy G.) (2000-08-27)|
|From:||"Venkatesha Murthy G." <email@example.com>|
|Date:||27 Aug 2000 22:28:45 -0400|
pietro (firstname.lastname@example.org) wrote:
> Which is the right grammar to parser my expression ?
This grammar generates the same language as the one you've
s -> ID al
al -> al a | a
a -> = el ;
el -> el e | e ;
(the productions for e, f and t as in the grammar you've given)
> But since I've no delimiters between expression,
> and yacc has only one lookahead, this does not work.
I don't understand why you say it doesn't work. For one
thing yacc didn't report any conflicts on the grammar. And
although there are no symbols delimiting two assignments, ID
in effect does because, as can be seen from your grammar,
FOLLOW(E) doesn't have ID. Am I missing something?
Venkatesha Murthy G.
Return to the
Search the comp.compilers archives again.