Re: variable lookahead in cup? Please help.

Martin.Hampl@stud.uni-erlangen.de (Martin)
23 Aug 2003 23:07:21 -0400

          From comp.compilers

Related articles
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. haberg@matematik.su.se (2003-08-23)
| List of all articles for this month |

From: Martin.Hampl@stud.uni-erlangen.de (Martin)
Newsgroups: comp.compilers
Date: 23 Aug 2003 23:07:21 -0400
Organization: 1&1 Internet AG
References: 03-08-063
Keywords: parse
Posted-Date: 23 Aug 2003 23:07:21 EDT

Martin <Martin.Hampl@stud.uni-erlangen.de> wrote:


> Hi,
>
> 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.


Martin.



Post a followup to this message

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