[antlr-interest] header sections (was: Re: ANTLR for Python)

Ric Klaren ric.klaren at gmail.com
Wed Nov 17 16:18:48 PST 2004


Hi,

On Wed, 17 Nov 2004 21:27:37 -0000, Marq Kole <marq.kole at philips.com> wrote:
> > 2 lexers in one .g is not possible. Your idea will work I guess
> although
> > moving some stuff around might be prettier. Hmm might also need
> some fixing
> > in antlr.g.
> 
> Moving things around in the .g files is going to be hard if you do
> not want to break existing code. Maybe that is something to consider
> when doing ANTLR 3.

It is probably possible to move the headersections into the classDef
rule that way there could be header sections for each
lexer/parser/treeparser in a rule. I think it would be mostly
backwards compatible. The normal header section (without name) should
probably be treated in the old way and the rest on per
lexer/parser/treeparser basis.

Since noone ran into this before I guess it's just as good to mark it
in the docs. Your workaround doesn't look bad. Although I could expect
some minor problems if you also implemented the namespace options in
python (erm do those exist in python?).

It's definitely something that should be done right in antlr3.
(they're not implemented yet there I think)

Cheers,

Ric


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list