[antlr-interest] Unexpected token at the end of my grammar file

Benjamin Niemann pink at odahoda.de
Thu May 31 14:42:00 PDT 2007


troy runkel wrote:

> I've just recently started working with ANTLR v3 and am in the process
> of putting together a T-SQL grammar.  Whenever I run ANTLR on the
> grammar file I get the following error message.
> 
>      ANTLR Parser Generator  Version 3.0 (May 17, 2007)  1989-2007
>      error(100): TSQL.g:1630:1: syntax error: antlr: TSQL.g:1630:1:
> unexpected token: null
> 
> The error occurs on the last line of the grammar file, which is blank.
>  Any ideas what might be causing the error message?  Thanks.

Not without seeing the complete grammar. Error handling/reporting in ANTLR3
is, well, rather suboptimal and sometimes misleading.
You could also load it into ANTLRWorks and see, if the syntax highlighting
gives you some clue, where the real syntax error hides away.

-- 
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/



More information about the antlr-interest mailing list