[antlr-interest] What does this error mean in english?

Jim Idle jimi at temporal-wave.com
Tue May 12 08:00:32 PDT 2009


Christopher Laco wrote:
> "mismatched tree node: DOCUMENT expecting DOCUMENT"
>
>
> I'm not having very good luck trying to do simple things apparently.
>
> My ToStringTree:
>
>
>     (DOCUMENT (PRINT 'variable'))
>
>
> My tree grammar:
>
>
>   document
>
> : ^(DOCUMENT statement*)
>
> ;
>
>   statement
>
> : ^(PRINT LITERAL)
>
> ;
>
>   
Sounds like your tokens are out of sync. Regen your lexer/parser, then 
regen your tree walker. The token definitions will then be in sync and 
you will at least know that that was or was not the issue.

Jim


More information about the antlr-interest mailing list