|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. firstname.lastname@example.org (2003-08-23)|
|From:||email@example.com (Hans Aberg)|
|Date:||23 Aug 2003 23:10:48 -0400|
|Posted-Date:||23 Aug 2003 23:10:48 EDT|
Martin.Hampl@stud.uni-erlangen.de (Martin) 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).
This seems to be poor practise, as in the first case & has higher
precedence than =, and in the other case, it is the reverse. It is better
to keep precedences fixed, if possible. Even though I recently found a
In a proof verification language I use the both cases
all x A
all x: <formula>
Here, the first case is the traditional notation, but it requires on to
use a lot of parenthesizes, which looks heavy in a language. So I
introduced the second one. It then turns out that the two operators "all
x" and "all x:" have different precedences.
But you can see the language design criteria I use. Also, the two
different precedences have different notational forms.
Hans Aberg * Anti-spam: remove "remove." from email address.
* Email: Hans Aberg <firstname.lastname@example.org>
* Home Page: <http://www.math.su.se/~haberg/>
* AMS member listing: <http://www.ams.org/cml/>
Return to the
Search the comp.compilers archives again.