[antlr-interest] Comments and questions on a recent project

Terence Parr parrt at jguru.com
Mon Aug 26 11:34:22 PDT 2002


On Monday, August 26, 2002, at 06:06  AM, Tiller, Michael (M.M.) wrote:
> The first issue that comes to mind is the fact that at the start of 
> the project, I essentially had to choose my target language up front.  
> I found that quite annoying.  I saw some comments in the group about 
> Ter not wanting to put language stuff on the command line.  I'm not 
> sure I ever saw the exact argument against this, but as a practical 
> matter I found it quite annoying.  The result is that I had to put a 
> few (not many) language specific bits in my grammar (target language 
> option, handling of newlines, comments, etc).  I would have preferred 
> to keep it "pristine" for other potential users.

Parsers are mostly worthless by themselves in my experience.  When was 
the last time anybody needed a C compiler that said "yes, it's valid C 
code" instead of "here's your machine code"? <wink>.  So, you must have 
actions within the grammar even to build (nontrivial) trees.  Actions 
imply a language and hence the grammar should be the one not the 
command-line to specify the language.  If you only wanted a parser and 
you could build trees automatically in a language independent way (see 
Loring's new stuff) *then* a command line option is useful :)

Good question!  A feature for a future ANTLR.

Ter
--
Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org


 

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



More information about the antlr-interest mailing list