|variable lookahead in cup? Please help. Martin.Hampl@stud.uni-erlangen.de (2003-08-20)|
|Re: variable lookahead in cup? Please help. Martin.Hampl@stud.uni-erlangen.de (2003-08-23)|
|Re: variable lookahead in cup? Please help. email@example.com (2003-08-23)|
|Date:||23 Aug 2003 23:07:21 -0400|
|Organization:||1&1 Internet AG|
|Posted-Date:||23 Aug 2003 23:07:21 EDT|
Martin <Martin.Hampl@stud.uni-erlangen.de> wrote:
> I am trying to write a Paser for a simple language. I'd like it to parse
> the expression 'STRING = STRING & STRING' like STRING = (STRING &
> STRING)' but 'STRING = STRING & STRING = STRING' like (STRING = STRING)
> & (STRING = STRING).
To make it a bit more readable:
'a = b & c' --> 'a = (b & c)'
'a = b & c = d' --> '(a = b) & (c = d)'
( '-->' meaning 'to be interpreted as')
> How on earth do I accomplish this with CUP?
> With a variable lookahead it would be trivial (or so I think) but I
> haven't found anything like this in the documentation.
Return to the
Search the comp.compilers archives again.