[antlr-interest] faster expression parsing
John Ridgway
john at jacelridge.com
Wed Mar 19 07:35:14 PDT 2008
You could steal an idea from ML :-) :
e : {options infix 60} e '*' e
| {options infix 50} e '-' e
| {options infix 50} e '+' e
| {options infixr 66} e '::' e
...
or whatever.
Peace
- John
On Mar 19, 2008, at 10:28 AM, Terence Parr wrote:
>
> 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