[antlr-interest] namespaces in v3

Kay Roepke kroepke at classdump.org
Wed Nov 29 15:34:10 PST 2006


On 30. Nov 2006, at 0:29 , Randall R Schulz wrote:

> On Wednesday 29 November 2006 14:57, Jamie Briant wrote:
>> How do I get v3 to generate code wrapped in a namespace? The
>> namespace option doesn't appear to be supported anymore?
>
> For Java parsers and lexers, it's like this:
>
> @header {
> package			tau.tstp;
>
> ...
> }
>
>
> @lexer::header {
> package			tau.tstp;
>
> ...
> }

Be advised that, for combined grammars (parsers and lexers in one),  
you need to specify both.
This is a common pit people fall into...
In combined grammars a simple @header{} goes into the parser *only*!

HTH,

-k

-- 
Kay Röpke
http://classdump.org/






More information about the antlr-interest mailing list