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

Ric Klaren klaren at cs.utwente.nl
Fri Jul 18 11:45:10 PDT 2003


On Fri, Jul 18, 2003 at 10:18:26AM -0700, Terence Parr wrote:
> Does anyone have an opinion on the whole "rule names start with lower 
> case letter" and tokens start with upper case concept borrowed from 
> yacc in the old days?

Could live with it could live without it. Personally I'd prolly still
upcase the tokens and lowcase the rules. Some enforcement of uniformity is
not bad either. It's nice to know when you get a grammer dumped in front of
you that it follows the same conventions as one is used to.

> It's pretty easy to do two passes over the grammar to find all rule 
> definitions and then walk the actual rules where you'd know that "x" is 
> a rule if it's defined as a rule and a token if not defined.  Of course 
> that makes it easy make lots of mistakes: undefined rule becomes a 
> token definition etc...

Don't know I'd rather declare any tokens in a tokens section anyway and do
away with the BASIC-ish declare on the spot strategy that induces often
mistakes through typos.

Anyway I can live with either.

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
     Innovation makes enemies of all those who prospered under the old
   regime, and only lukewarm support is forthcoming from those who would
               prosper under the new. --- Niccolò Machiavelli


 

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




More information about the antlr-interest mailing list