help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to change default outcome of shift/reduce conflict?


From: Scott Raney
Subject: Re: How to change default outcome of shift/reduce conflict?
Date: Wed, 16 Jan 2002 13:56:13 -0700 (MST)

On Wed, 16 Jan 2002 Hans Aberg <address@hidden> wrote:

> Also, it seems that the semantics of the two different OR's will be
> different, so therefore I think that it will not suffice by merely fiddling
> around with OR precedences. -- You need to write your grammar in such a way
> that it is possible to insert the actions correctly.

Hey, and that's an easy one.  Wait until you get to "the number of
card", at which point the next token could be "button", at which point
"number" is a property, or "buttons", at which point it's a function.
We gave up on the idea of a lex/yacc parser for MetaCard very early on
for this and other reasons, and hand-coded it all (albeit with some
consolidation for common elements).  But "number" was a big problem
even for us.  long/short/abbrev are also no picnic (sometimes they
modify a function, sometimes a property).

> Otherwise, I think this is a sign of poor language design. If you later
> want to design your own scripting language, then you should avoid the
> confusion that will inevitably arise by the "or"'s having different
> semantic meaning.

Natural language has always been a major headache for computer-science
types specifically because of these kinds of token ambiguities.  But I
wouldn't go so far as to say HT is an example of poor design (well, it
does have its flaws, but this kind of multi-use token isn't one of
them).  It's just much more English-like than is convenient for
language implementers ;-)
  Regards,
    Scott

>   Hans Aberg

********************************************************
Scott Raney  address@hidden  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]