[antlr-interest] compile-time error for the parser

David Holroyd dave at badgers-in-foil.co.uk
Sat Dec 30 15:05:03 PST 2006


On Sat, Dec 30, 2006 at 04:39:30PM -0600, Rajesh Menon wrote:
> Any idea why this might be so (I'm afraid it might just be some path 
> issues, but can't see where I'm making an error.)

Sorry, don't know about that, but,

> And on an aside, why would the parser fail on encountering a COMMENT (in 
> the lexer section)? I haven't been able to test it with code I've 
> written, but AntlrWorks comes back with a [NoViableAltException].

> COMMENT
> 	:	'//' ~('n'|'\r')* '\r'? '\n' {skip();}
> 	;

I think I read that ANTLRWorks doesn't actually run actions.  I believe
it uses heuristics like the pattern {$channel=HIDDEN;} though, because it
seems to know to ignore tokens marked that way.  Expect to see things
listed next to 'Ignore rules:' in the Interpreter tab if this is
working properly.

ta,
dave

-- 
http://david.holroyd.me.uk/


More information about the antlr-interest mailing list