[antlr-interest] Grammar composition in v3, multiple packages, no joy

Jim Idle jimi at temporal-wave.com
Tue Feb 9 16:13:55 PST 2010



> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Christian Nentwich
> Sent: Tuesday, February 09, 2010 3:23 PM

>... the difference in grammar inheritance. This is the situation here -
> note, no
> lexers involved, only parsers:
> 
> Language L1    -    lives in a Java project, with grammar L1.g; usable
> standalone
> Language L2    -    lives in another Java project, with grammar L2.g;
> extends L1

Have you tried making your actual rules just imports such that L1.g contains no rules, but defines the headers and package and so on then imports l1rules.g and L2.g also contains no rules but imports l1rules.g, l2rules.g

Obviously l1rules.g and l2rules.g cannot be used on their own and are specifically for imports with no @header statements and options etc.


> p.s. to pay my debts I wanted to post on confluence how to get case
> insensitive parsers using ANTLR3 with JFlex, but it seems
> editing/commenting
> is locked down. Any reason why?

You would want to add that as a child page of the case insensitive lexing article that is already there:

http://www.antlr.org/wiki/pages/viewpage.action?pageId=1782

I think that you just have to ask Ter for a login - you cannot edit as anonymous as the pages are filled with SPAM 10 seconds after we open up it up :-)

Jim





More information about the antlr-interest mailing list