[antlr-interest] (no subject)

Gavin Lambert antlr at mirality.co.nz
Wed Feb 20 11:55:06 PST 2008


At 08:34 21/02/2008, Daniel Powell wrote:
 >
 >Thanks, unfortunately I've already tried that one. Whilst it 
does
 >catch the error of the jargon, it also creates the error
 >"exception: line 1:5: unexpected char: 0xA" with legitimate 
code,
 >i.e. 'a=5;'. Any thoughts?

Character 0x0A is a newline, so clearly you don't have a lexer 
rule that can match newlines, so it can't create a token for 
it.  Add one and the problem will go away.

If newlines / whitespace isn't significant in your language, then 
either skip() it or put it onto a hidden channel.



More information about the antlr-interest mailing list