[antlr-interest] package name is ignored in antlr v3

Kay Roepke kroepke at classdump.org
Mon Oct 23 06:30:05 PDT 2006


Hi!

On 23. Oct 2006, at 14:35 , Zsombor wrote:

> Probably i've done something unusual, or missed something, but it
> seems that however I've specified
>
> grammar MyTestGrammar;
> @header {
>    package my.testparser;
> }
>
> It's only showing up in the MyTestGrammar class, not in the
> MyTestGrammarLexer. I'm using the  3.0b4 version.

For combined grammars the unqualified stuff goes into the parser by  
default.
You can do:

@lexer::header {
}

and

@parser::header {
}

to put stuff into the lexer resp. parser.
Currently, you have to specify it twice, using @header and  
@lexer::header for combined grammars.

HTH,
-k





More information about the antlr-interest mailing list