[antlr-interest] Re: upper, lower case for tokens, rule names

Anthony W Youngman Anthony.Youngman at ECA-International.com
Mon Jul 21 01:29:38 PDT 2003


My first reaction was "I didn't know about this rule", and then further
reading makes me suspect that's just because I've been writing a
grammar. I haven't dug into the geneerated code.

If (as I suspect) this rule applies to generated code, then the more
rules like this the better... :-) I sometimes work with generated code,
and the less effort you need to try to get to grips with what it's doing
the better. And the more naming conventions you have the better. I used
to work with Fortran, and always stuck rigidly to the default typing
rules, despite always also using the "no undeclared variables" switch on
the compiler. It reduces the brain overload when hunting down a bug :-)
So count me in as saying "keep the rule", too.

Cheers,
Wol

-----Original Message-----
From: micheal_jor [mailto:open.zone at virgin.net] 
Sent: 18 July 2003 21:12
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] Re: upper, lower case for tokens, rule names


> Ter--
> 
> I prefer the 
> current approach, not only for visual effect (which is pretty 
> important--highlighting is not an option for black-and-white text) 
but 
> for catching rules moved from one type of grammar (lexer, parser, 
tree 
> walker) to another.

I also think the present UpperCase or lowerCase case distinction 
should be preserved. 

It is simple and non-intrusive, it prevents accidental 
copying/pasting of rules from lexer to parser/treewalker (as Loring 
pointed out) and, the issue about method naming in the generated 
parsers can be resolved with a rulename-to-methodname transformation 
in ANTLR 3.

Micheal


 

Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/ 



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

-------------- next part --------------
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 9911 7799, 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