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

Rajesh Menon prm225 at gmail.com
Sun Dec 31 09:01:50 PST 2006


David Holroyd wrote:
> 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
> 

Nevermind the errors I mentioned. It was indeed an oversight that was 
cured with a night's sleep (I had my class named Parser, which conflicts 
with the Parser class that antlr uses internally.) Change in names was 
all it needed.

Thanks for the comment on antlrworks and it not running the actions - 
that makes sense as well.


More information about the antlr-interest mailing list