[antlr-interest] do we need "..." and '.' ??

Terence Parr parrt at cs.usfca.edu
Tue Nov 22 22:38:59 PST 2005


howdy.  For string literals like keywords in ANTLR v3, I use "void"  
and "int" in double quotes.  For single char like semi-colon etc... I  
use single quotes like ';' and '{'.  Is there a real reason to do  
this?  None from ANTLR's point of view.  I'm even thinking that it  
really complicates my code.  Programmers used to C/Java family will  
grok it immediately but many languages don't distinguish between one  
and multi-lettered strings.  All they do is get dumped down into the  
lexer for matching anyway.

Can anybody think of a reason to have single-quote mean single char  
string?  The single-quotes could be useful for something else in the  
future.  One must be frugal with the use of symbols ;)

Ter


More information about the antlr-interest mailing list