[antlr-interest] faster expression parsing

Terence Parr parrt at cs.usfca.edu
Wed Mar 19 07:28:14 PDT 2008


On Mar 19, 2008, at 7:30 AM, Edwards, Waverly wrote:

>
> If I understand correctly...
> If you don't specify right associativity then its assumed to be left.
> Order or precedence indicated by the depth of primary expressions
> subrules.
>
>
> That is an outstanding idea.

thanks...pretty clean...

>> e	:	e '*' e
>> 	|	e '-' e
>> 	|	e '+' e
>> 	|	'-' e
>> 	|	e '.' ID
>> 	|	e '[' e ']'
>> 	|	e '(' e (',' e)* ')'
>> 	|	INT
>> 	|	ID
>> 	;

I'll work on this...
Ter


More information about the antlr-interest mailing list