[antlr-interest] Line start vs non-line ...

James Ladd james_ladd at hotmail.com
Tue Jul 5 03:18:01 PDT 2011


Hi All,

I hope this is a simple request to answer.

I have a simple preprocessor I want to write but I can't get the rules right.
I think I am regex challenged.

In simple terms I want to have this:

lines
   :  (lineStartingWithPlus | lineNotStartingWithPlus)*
   ;


If these were rules A and B respectively then ...

+ this line matches A
this line matches B

Please can someone help ?

Rgs, James.
 		 	   		  


More information about the antlr-interest mailing list