[antlr-interest] Codegen confusion

Rick Mann rmann at latencyzero.com
Sun Jan 18 04:18:01 PST 2009


Argh. I think I figured it out. It was still a "lexer grammar", not a  
"grammar".

On Jan 18, 2009, at 04:13:27, Rick Mann wrote:

> I'm having a hard time getting a handle on how all the various
> StringTemplates get instantiated and invoked. I thought I was getting
> the hang of it, then I expanded my grammar a bit beyond the super-
> simple one given in the codegen wiki page.
>
> I added a parser rule to what was originally just a lexical rule, and
> when processing my test grammar, I suddenly got this complaint:
>
> error(10):  internal error: T.g : java.util.NoSuchElementException: no
> such attribute: bitsets in template context [headerFile lexer]
>
> The lexer() ST doesn't have a bitsets parameter, and neither do its
> counterparts in C.stg or Java.stg. Why does it suddenly want it in  
> mine?
>
> If I add a bitsets parameter, it seems to come out okay, but I'm
> reluctant to do that since no one else seemed to need it; I figure I'm
> doing something else wrong.
>
> TIA,
> -- 
> Rick

-- 
Rick



More information about the antlr-interest mailing list