[antlr-interest] some nice lexer improvements (Java version)

Terence Parr parrt at cs.usfca.edu
Thu Mar 22 18:10:52 PDT 2007

Hi, grab


It does this:

March 22, 2007

* Working with Egor Ushakov from Sun Optimization / NetBeans team I
   made all the Java lexer transition tables static w/o screwing up
   ability to reference semantic predicates etc...  Only changed  

* cached text string in CommonToken.getText(); saves on repeated calls;
   Java mode.

* made all generated methods final; saves a few percent speed  
according to
   Egor Ushakov (Java only).

* removed most assignments from each lexer rule and even the  
   call!  All done in nextToken now.  Saves on code gen size and a  
wee bit of
   execution speed probably.  Variables became fields: type, channel,  
   etc... Now emit() needs no args even.  Again, Egor helped on this.


More information about the antlr-interest mailing list