[antlr-interest] OOM error from lexer; ANTLR 2.7.4

Richard Clark rdclark at nextquestion.net
Tue Jul 26 14:27:06 PDT 2005


Here's a puzzler: I'm getting Out of Memory errors from the lexer  
when my input files don't end in a newline. The offending rule seems  
to be:

LINE
     :    ':'! (~('{'|'\\'|'\n'|'\r') | ESC)*
     ;

(starts with a colon, ends at a \\ comment, { to denote a metadata  
block, or newline. All other characters gleefully accepted.)

Is there something special I should be doing to catch an EOF,  
possibly splicing in one final newline?

...Richard



More information about the antlr-interest mailing list