[antlr-interest] NPE when adding @header? (ANTLRWorks 1.4.2, Mac OSX 10.6.6)

Bill Schongar bschonga at cisco.com
Wed Feb 16 07:35:31 PST 2011


D'oh! I knew I was doing something stupid.. Making sure I put it after
options and tokens fixes it in the combined grammar.

Thanks Sam!
-Bill



On 2/16/11 10:27 AM, "Sam Harwell" <sharwell at pixelminegames.com> wrote:

> Hi Bill,
> 
> You need to place the @header block after the options{} block.
> 
> Sam
> 
> -----Original Message-----
> From: antlr-interest-bounces at antlr.org
> [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Bill Schongar
> Sent: Wednesday, February 16, 2011 8:04 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] NPE when adding @header? (ANTLRWorks 1.4.2, Mac
> OSX 10.6.6)
> 
> Hi folks,
> 
>  I¹m just getting started with Antlr, and have a basic grammar working.
> However, as soon as I add an @header declaration I get an NPE when I go to
> Debug it, almost as if I hadn¹t properly terminated the @header declaration.
> 
>  If I remove @header everything works fine, and I can run debug with my
> sample text, get my expected output, etc.
> 
>  Any thoughts on what I¹m doing wrong? System info, relevant section of the
> grammar and NPE are added at the end for reference.
> 
> Thanks,
> -Bill
> 
> 



More information about the antlr-interest mailing list