On Sun, Jun 6, 2010 at 6:49 PM, Loring Craymer <[email protected]> wrote:
> You can, of course, do
>
> COMMENT : '\n' 'C' (~'\n')+ ;
>
> NEWLINE: '\n' ;
>
> (the ordering matters for ANTLR 3's DFA construction), but the approach 
> Brodie suggested is the common idiom since it costs less in terms of 
> performance and does not depend on the quirks of ANTLR DFA construction.  
> "Start of line" is a semantic notion, whereas '\n' 'C' specifies syntax.


Thanks.  How would you handle the case where the very first line in
the file is a comment line?  That is, there's no preceding newline
sequence.

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to