Re: simple ambigous grammar...

"Venkatesha Murthy G." <gvmt@bgl.vsnl.net.in>
27 Aug 2000 22:28:45 -0400

          From comp.compilers

Related articles
simple ambigous grammar... abate@zed.students.cs.unibo.it (2000-08-21)
Re: simple ambigous grammar... llkparsing@aol.com (2000-08-27)
Re: simple ambigous grammar... rkrayhawk@aol.com (2000-08-27)
Re: simple ambigous grammar... gvmt@bgl.vsnl.net.in (Venkatesha Murthy G.) (2000-08-27)
| List of all articles for this month |

From: "Venkatesha Murthy G." <gvmt@bgl.vsnl.net.in>
Newsgroups: comp.compilers
Date: 27 Aug 2000 22:28:45 -0400
Organization: Compilers Central
Keywords: parse

pietro (abate@zed.students.cs.unibo.it) wrote:
> Which is the right grammar to parser my expression ?


This grammar generates the same language as the one you've
given:


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?


Venkatesh
--
Venkatesha Murthy G.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.