[antlr-interest] file names and grammar names

Sam Barnett-Cormack sdb at geekworld.co.uk
Thu May 18 02:01:01 PDT 2006


Kay Roepke wrote:
> 
> On 18. May 2006, at 1:58 Uhr, Terence Parr wrote:
> 
>> Currently you can name your grammar file anything and then have any 
>> grammar name inside. E.g., t.g can have
>>
>> grammar Foo
>>
>> in it.  When we go looking for other grammar vocabularies etc... it 
>> would be nice to be able to tell (like Java does) from the filename 
>> what's inside...
>>
>> Do people think I should force the grammar name (including case) to 
>> be same as filename (with .g suffix)?
<SNIP>
> 
> What would lexer grammar file names look like? Foo.lexer.g (like  those
> coming out of combined grammars)?

I would say that it would be sensible for, say, Foo.g to be able to
contain FooParser, FooLexer, and FooTreeParser, for example.

Sam



More information about the antlr-interest mailing list