.y & precedence
Hans Aberg
haberg@matematik.su.se
Sun, 28 Jan 2001 21:32:33 +0100
At 18:43 +0100 1-01-28, Sven Panne wrote:
>[Hugs] uses the standard technique here:
>
> * Remember fixity/precedence declarations in a table, but ignore them
> during pattern/expression parsing
>
> * A simple operator precedence parser rearranges the expression/pattern
> part of the parse tree afterwards, using the collected table
...
>Note that "expanding out" the grammar w.r.t. fixity/precedence would
>lead to a *huge* parser, and is no help at all when there are
>infinitely many precedence levels, like in Prolog (IIRC).
Actually, the question came up on the Bison help list, somebody (novice to
Bison) wanting to write an extensible grammar.
At 12:52 -0500 1-01-28, Lennart Augustsson wrote:
>It's not that bad. Hbc uses the expanded grammar. It's very easy to write
>with yacc, and the tables are not that big.
So I guess one can recommend starting with the simple one.
Hans Aberg