|[LONG&BORING] ULR : Ultimate LR parser =) firstname.lastname@example.org (Nicolas Repiquet) (2003-10-27)|
|Re: [LONG&BORING] ULR : Ultimate LR parser =) email@example.com (Oliver Zeigermann) (2003-10-31)|
|From:||Oliver Zeigermann <firstname.lastname@example.org>|
|Date:||31 Oct 2003 23:05:39 -0500|
|Posted-Date:||31 Oct 2003 23:05:39 EST|
Nicolas Repiquet wrote:
> - a precedence level
> - an associative indication
This is exactly what YACC offers you to resolve ambiguities. You may
write for example
%left '+' '-'
%left '*' '/'
to make '+', '-', '*' and '/' left associative and give '*' and '/'
precedence over '+' and '-'. Seems you reinvented the wheel :)
Note, however, this does not augment the set of parsable languages, but
only helps to eliminate ambiguities in the grammar. This means, you
could rewrite the grammar to parse the same language and not use
operator precedence - although it will certainly look less obvious then.
Return to the
Search the comp.compilers archives again.