[antlr-interest] Trouble with ANTLR 3 grammar

Emond Papegaaij e.papegaaij at student.utwente.nl
Fri Jun 30 00:03:07 PDT 2006


On Thursday 29 June 2006 17:58, Terence Parr wrote:
> On Jun 29, 2006, at 2:01 AM, Emond Papegaaij wrote:
> > I'm still working on an ANTLR 3 grammar. However I'm having trouble
> > with
> > version b1. In my lexer I've got several tokens that match almost
> > everything.
> > These tokens are guarded with semantic predicates. Due to these
> > tokens, I
> > have to use filtered mode (else ANTLR will run out of memory trying to
> > construct the DFA). This used to work fine, however with b1 my
> > parser seems
> > to receive whitespace tokens:
> >
> > [specification, nodeDecl]: line 1:9 mismatched token: [@1,9:9='
> > ',<12>,1:9];
> > expecting type L_CURLY
> >
> > These tokens are sent to channel=99.
>
> 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.

Best regards,
Emond


More information about the antlr-interest mailing list