[antlr-interest] 3.0 final will require t.g has t in it

Brian Cox coxbrian at msu.edu
Tue Jul 11 18:19:42 PDT 2006


On Tuesday 11 July 2006 15:54, Terence Parr wrote:
> So I think people are proposing C.g generating CParser.java if
> parser, CLexer.java if lexer grammar, CTreeParser.java if tree
> grammar.  If combined then CParser.java *and* CLexer.java.
>
> In the future if you need to reference a grammar, you'd use it's name
> like C, which must be in C.g.  The type would not be specified just
> like you don't differentiate in java between class and interface and
> enum.

If there can be only one grammar definition per file, then I would assume that 
sooner or later there's going to be a need for people to have two or three 
files per language to specify the parser as well as the lexer and/or the tree 
parser(s).  I suspect the natural tendency would be to name the primary 
grammar as just the name of the language, with additional grammars consisting 
of the language name plus the type of grammar.

For example, lets say there's a C.g, CLexer.g and CTreeParser.g?  Would the 
generated classes then be CParser, CLexerLexer and CTreeParserTreeParser?  
That doesn't make sense to me.  Or would there be special handling for the 
case where the type of grammar is embedded into the grammar name?

-- 
 * Brian Cox <coxbrian at msu.edu>


More information about the antlr-interest mailing list