[antlr-interest] Very high runtime and memory usage caused by trivial grammar => Is it my mistake?

Bart Kiers bkiers at gmail.com
Thu Oct 21 02:40:10 PDT 2010


Hi Ralf,


>        "line 1:0 required (...)+ loop did not match anything at character
> '<'"
>
> Up to this point I thought, I got it. I assume, that the above output line
> is generated by the lexer. I defined only one lexer token in my grammar,
> which is wouldn't match an empty string anymore. So why doesn't the lexer
> stop after unsuccessfully trying to match the string - and runs on instead?


No, the error comes from the parser. Try creating a lexer only and you'll
see no error is printed to the console.

If you want the lexer to produce an error/exception for invalid tokens, see:

*How can I make the lexer exit upon first lexical error?*
http://www.antlr.org/wiki/pages/viewpage.action?pageId=5341217

Regards,

Bart.


More information about the antlr-interest mailing list