[antlr-interest] Names of generated files and classes

Thomas Brandon tbrandonau at gmail.com
Mon Aug 6 06:56:58 PDT 2007


On 8/6/07, Johannes Luber <jaluber at gmx.de> wrote:
> Thomas Brandon wrote:
> > As combined grammars will still need to append Lexer and Parser this
> > will complicate a mapping from .g file names to generated file names
> > that tools may need. They would need to analyse the grammars to
> > determine the files they generate.
> > An alternate solution is to name your files MyGrammar.g3l,
> > MyGrammar.g3p and MyGrammar.g3t for lexer, parser and tree parser.
> >
> > Tom.
>
> Adding a different suffix isn't scalable. Suppose you got two tree
> grammars - a likely case for modern languages. How should they be named?
> MyGrammar.g3t1 and MyGrammar.g3t2? Really cryptic.
>
If there are multiple tree parsers you would name them appropriately
based on what they are doing (e.g. ANTLR would have action.g3t and
define.g3t) as in the current scheme or the scheme you advocate which
would not allow two MyGrammar.g or MyGrammarTreeParser.g's.

Tom.
>
> Best regards,
> Johannes Luber
>


More information about the antlr-interest mailing list