Need help with grammars!

dan.hovang@usa.net
15 Apr 1998 23:29:52 -0400

          From comp.compilers

Related articles
Need help with grammars! dan.hovang@usa.net (1998-04-15)
Re: Need help with grammars! jrw@pobox.com (John Williams) (1998-04-21)
Re: Need help with grammars! torbenm@diku.dk (Torben Mogensen) (1998-05-07)
| List of all articles for this month |
From: dan.hovang@usa.net
Newsgroups: comp.compilers
Date: 15 Apr 1998 23:29:52 -0400
Organization: Deja News - The Leader in Internet Discussion
Keywords: parse, Java, comment

Hi!


This is propably real basic stuff. I'm using java_cup and have the
productions:


lvalue ::= id | id [ exp ] | lvalue . lvalue
exp ::= id ( functargs )
exp ::= id [ arrayinit ]
exp ::= lvalue
exp ::= lvalue := exp
exp ::= exp + exp
etc.


There are semantic actions attached to each production which I omitted. I get
ambiguity warnings when running java_cup since it dont know if it should
shift id (exp ::= id (.. | exp ::= id [ ..) or reduce (lvalue ::= id).
Perhaps I'm all wrong when using the lvalue ::= construct?


/Dan
[That's what I'd say. How's it supposed to tell id [ arrayinit ] from
id [ exp ] ? -John]
--


Post a followup to this message

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