[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

antlr-03-22-2007.18.tar.gz

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  
Java.stg

* 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  
Lexer.emit()
   call!  All done in nextToken now.  Saves on code gen size and a  
wee bit of
   execution speed probably.  Variables became fields: type, channel,  
line,
   etc... Now emit() needs no args even.  Again, Egor helped on this.

Ter


More information about the antlr-interest mailing list