[antlr-interest] Enhance ANTLR to support comments?

mzukowski at yci.com mzukowski at yci.com
Thu Jul 17 10:50:02 PDT 2003


>>From the parser's point of view, I don't see how this is much different from
using a HiddenTokenStream, except that is is less flexible.  Your proposal
only deals with lexers though.  When parsing you routinely throw away tokens
such as ';' and ','.  They don't get into the tree.  And do you want to
attach comments to the preceding statement (like ones at the end of a line)
or the following statement (like javadoc)?  Both is the answer.  Have you
read the paper linked to recently on this list?  There are various semantic
issues related to comment handling that are detailed in there.
http://research.sun.com/projects/jackpot/COM.sun.mlvdv.doc.scam_nov01.abs.ht
ml

Monty

-----Original Message-----
From: atripp54321 [mailto:atripp at comcast.net] 
Sent: Thursday, July 17, 2003 10:37 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] Enhance ANTLR to support comments?


I'd like to propose enhancing ANTLR to explicitly
support comments.

The proposal is here: http://jazillian.com/antlr/antlrComments.html

I realize that theoretically, a "compiler-compiler"
shouldn't deal with comments. But it just seems like it's
a big enough real-world issue (witness the countless
"How do I handle comments" posts) that it should be dealt with.

It seems like a couple of small changes to ANTLR could
be made to have ANTLR-generated lexers attach comments to Tokens, without
breaking any existing ANTLR-based apps.

Let me know what you think of the idea, even if you think "Blasphemy!"

Andy


 

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