[antlr-interest] The combined grammar definition

G R relationalalgebra at gmail.com
Tue Dec 11 04:14:16 PST 2007


You cannot have lexer, parser and treee in the same file.
You can combine lexer and parser, but not tree grammar. I think this due to
the rule rewriting mechanism

Hope this help.

G.R.

2007/12/11, Silvester Pozarnik <silvester.pozarnik at tracetracker.com>:
>
> Thanks, but my problem is how to include a "tree grammar" in the same
> file, heaving also the possibility to separately define @header,
> @members and other sections.
>
> BR.
> Silvester
>
>
>
> > -----Original Message-----
> > From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> > bounces at antlr.org] On Behalf Of Sam Ellis
> > Sent: 11. desember 2007 12:41
> > To: antlr-interest at antlr.org
> > Subject: Re: [antlr-interest] The combined grammar definition
> >
> > antlr-interest-bounces at antlr.org wrote:
> > > In the antlr V2 one could define all three grammars (lexer, parser &
> > > tree) in the single file, each with it's own 'option' and 'header'
> > > information.
> > >
> > > How to define a combine grammar in ANTLR3 heaving possibility to
> > > separately define @header, @members,... section for each of the
> > > grammars, all in one file?
> >
> > Prefix the section name with the grammar type, for example:
> >
> > @parser::header {
> > }
> >
> > @lexer::header{
> > }
> >
> > The same applies for members etc.
> >
> >
> > --
> > Sam Ellis, Engineering Manager,
> > Product Engineering Group,                 Tel: +44 (0) 1223 400516
> > System Design Division,                    Fax: +44 (0) 1223 400887
> > ARM Ltd., 110 Fulbourn Road,               skype:armsamellis
> > Cambridge, CB1 9NJ                         mailto:sam.ellis at arm.com
> >
> > --
> > IMPORTANT NOTICE: The contents of this email and any attachments are
> > confidential and may also be privileged. If you are not the intended
> > recipient, please notify the sender immediately and do not disclose
> the
> > contents to any other person, use it for any purpose, or store or copy
> the
> > information in any medium.  Thank you.
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20071211/813bacbd/attachment-0001.html 


More information about the antlr-interest mailing list