[antlr-interest] possible bug?

micha micha-1 at fantasymail.de
Tue Nov 18 04:54:18 PST 2008


the followinig lexer grammar:
 lexer grammar Lexbug;

 SLASH: '/';
 POINT: '.';

 fragment DIGIT: '0'..'9';
 fragment BYTE: DIGIT | '1'..'9' DIGIT | '1' DIGIT DIGIT | '2' '0'..'4'
 DIGIT | '25' '0'..'6';

 IP: BYTE POINT BYTE POINT BYTE POINT BYTE;
 NUMBER: '0' | '1'..'9' DIGIT*;


produces 13kb of java code and all works well.

If I add the definition:
 IPNET: IP SLASH NUMBER;

then I get 22MB output (!)

Is this o.k.? I didn't thought, that this rule requires so much code :-)

cheer
 Michael






More information about the antlr-interest mailing list