[antlr-interest] Extending java.g

Imran A R (RBIN/EMT2) Imran.AR at in.bosch.com
Fri Feb 9 20:10:29 PST 2007


Hello 
 
    case which I am trying to write is TE_ apperaring in the begining of
the line.
 
    basically I am trying to achive "//" comment feature. instead of //
i want to user "TE_"
 
    Thank you in advance.

________________________________

From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Andy Tripp
Sent: Saturday, 10. February 2007 8:07 AM
To: Imran A R (RBIN/EMT2)
Cc: antlr-interest at antlr.org
Subject: Re: [antlr-interest] Extending java.g


Imran A R (RBIN/EMT2) wrote: 

	Hello all, 

	        I am extending java.g . I have one special requirement. 
	        whenever I see string "TE_" in a .java file, my parser
should not 
	        consider that line. It should just print the content of
that line 
	        and continue parsing the next line. How to do this

If "TE_" really can appear anywhere on a physical line, there's no way
to do this with ANTLR or similar tools. You'd have to write a simple
preprocessor that just reads the file a line at a time, searches the
line
for "TE_", and throws the line away if it's found.

Or, just use:
$ grep -v "TE_" myfile

Andy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070210/abe08907/attachment.html 


More information about the antlr-interest mailing list