[antlr-interest] @members and the lexer in 3.0.1

Kirby Bohling kirby.bohling at gmail.com
Tue Oct 6 11:13:32 PDT 2009


On Tue, Oct 6, 2009 at 12:41 PM, Bocek, Timothy (RDM)
<Timothy.Bocek at bsci.com> wrote:
<snip...>
> Is there an @members equivalent for the lexer?  Or some way to make @members
> apply to the lexer as well?  Or is this just a bug in the version I'm using
> which is fixed in a later one?
>

I don't see an obvious reference online, and I know the answer that
I'm searching for...

This describes it fairly tersely, but doesn't explicitly have an
example of what you are asking about.  I believe that the @header and
@members handle this situation identically.
http://www.antlr.org/wiki/display/ANTLR3/Grammars

@lexer::members {
}

I believe is the correct syntax.

I always use separate lexers, parsers and walkers, so I don't have an
example of that handy I can cut and paste.

It's described in section 4.6 of "The Definitive ANTLR Reference" if
you have a copy of that (well worth the price of admission, I highly
recommend it if you use ANTLR for anything).

Thanks,
   Kirby


> Thanks
> Tim Bocek
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
>


More information about the antlr-interest mailing list