Heh, really cool!  This is a similar approach to:

http://www.antlr.org/wiki/display/~admin/2008/03/23/Faster+expression 
+parsing+for+ANTLR

except that you do the appropriate tree construction and after parsing  
without consideration of operator precedence. Interesting. I wonder  
which is faster.

Note that you can improve the speed slightly when you are grammar by  
removing unnecessary tree stuff.

> primary_expression
>         :       INTEGER
>                 -> ^(INTEGER)
>         |       '(' expression ')'
>                 -> expression
>         ;

primary_expression
         :       INTEGER
         |       '(' expression ')' -> expression
         ;

Let me know if that makes a difference.

Ter


List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to