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

mzukowski at yci.com mzukowski at yci.com
Fri Jul 18 10:40:26 PDT 2003


It is nice to be able to distinguish tokens from rule names visually, mainly
because tree operators function differently on tokens vs rules.  As long as
a syntax highlighter could figure it out pretty easily then it's ok with me.

Monty

-----Original Message-----
From: Terence Parr [mailto:parrt at cs.usfca.edu] 
Sent: Friday, July 18, 2003 10:18 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] upper, lower case for tokens, rule names


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?

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...

Just a thought that occurred to me that we might do away with this 
"old" notion for a future version of the tool.

Terence
--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org Co-founder,
http://www.jguru.com Co-founder, http://www.knowspam.net enjoy email again!
Co-founder, http://www.peerscope.com pure link sharing




 

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/ 




More information about the antlr-interest mailing list