[antlr-interest] (no subject)
Kay Roepke
kroepke at classdump.org
Wed Aug 2 10:29:58 PDT 2006
On 2. Aug 2006, at 19:17 Uhr, Greg Clemenson wrote:
> grammar Xyz;
>
> @header {
>
> package com.path.parser;
>
> import com.path.cmplr.ConstNode;
> import com.path.cmplr.ICmplrNode;
> ...
> }
Hi!
In a combined grammar you need to specifically specify what goes into
the lexer using the right action scope.
This holds true for the other stuff, too (for instance, "members").
grammar foo;
@header { /* this goes into the parser by default */}
@parser::header { /* specifically goes into the parser */ } // this
will actually generate a warning by antlr:
// actionscope.g:5:10: redefinition of header action
@lexer::header { /* specifically goes into the lexer */ }
HTH,
-k
More information about the antlr-interest
mailing list