[antlr-interest] Trouble with ANTLR 3 grammar

Terence Parr parrt at cs.usfca.edu
Fri Jun 30 09:43:32 PDT 2006


On Jun 30, 2006, at 12:03 AM, Emond Papegaaij wrote:
>> If you print out the tokens, is WS really on channel 99?  If so, then
>> something really strange is happening with the token buffer.  Can you
>> try a diff on your generated lexer between ea10 and b1?
>
> I've compared it to the version you sent me last week. The output is
> identical, except for the synpreds. I've also added a println  
> statement in
> the lexer, next to channel = 99. The channel is set correctly.  
> Exactly 12
> messages are printed and 12 WS tokens are visible in the output. It  
> seems
> some other part of ANTLR is responsible for this to stop working.

Hmm...that is very odd...i was thinking the backtracking was  
preventing it.  Are you printing the tokens after they come out of  
the lexer nextToken()?  If those are ok, then something weird changed  
in the parser or more likely tokenstream.

Just looked at the filtering nextToken() method.  Looks fine.   
Hmm...all of my filter tests work, but I don't try to parse with the  
resulting token stream...

Ter


More information about the antlr-interest mailing list