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

Anthony Youngman Anthony.Youngman at eca-international.com
Tue Jul 11 02:49:30 PDT 2006


Well, I'm not an experienced user of Antlr, but in my attempts to get it
working I have one source file (BASIC.g), which contains three
consecutive grammar definitions, namely BASICLexer, BASICParser and
BASICTreeParser.

Amongst other things, that seems to be a good way of not getting the
symbol table messed up :-) and it also makes sense to me as a simple way
to keep everything together.

So, basically :-) , I'm already using this technique, and all the stuff
about forcing the grammar file name to be an exact match to the java
class generated is likely to break my (and probably other peoples') way
of thinking.

Forcing the file name to match the root of a bunch of grammar classes,
however, is sensible and I'd go along with that no problem...

Cheers,
Wol

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Martin Probst
Sent: 10 July 2006 20:01
To: Terence Parr
Cc: Antlr Interest
Subject: Re: [antlr-interest] 3.0 final will require t.g has t in it

>>  So "grammar MyLang" would generate MyLangParser.(java|tokens)
>> and MyLangLexer.(java|tokens).
>
> Heh, that's pretty good!  Anybody object to this?

Well, why would you want to expose the Lexer as a top-level class if  
the user didn't even declare it explicitly? Have it be a nested class  
within the parser, that would keep the user surprise as low as possible.

Martin

* ************************************************************************ *

This transmission is intended for the named recipient only. It may contain private and confidential information. If this has come to you in error you must not act on anything disclosed in it, nor must you copy it, modify it, disseminate it in any way, or show it to anyone. Please e-mail the sender to inform us of the transmission error or telephone ECA International immediately and delete the e-mail from your information system.

Telephone numbers for ECA International offices are: Sydney +61 (0)2 8272 5300, Hong Kong + 852 2121 2388, London +44 (0)20 7351 5000 and New York +1 212 582 2333.

* ************************************************************************ *


More information about the antlr-interest mailing list