Hello, I'm working with Antlr to provide syntax highlight for Tcl (in Netbeans). I have a problem with COMMENT token. Basic version for one line comment looks like this:
COMMENT : '#' (options {greedy=false;} : .)* NEWLINE ; But comment in Tcl starts only at the beginning of a line with optional whitespace or after ";" also with optional whitespace. How can I handle this using antlr grammar and lexer? I've already allowed to use '#' in IDs: ID : ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|'#')+ ; It's difficult to find simple solution because char stream provided from Netbeans it's not full source but only parts displayed/edited. I followed some tips from this mailing list for example: http://wklej.org/id/544171/ but It doesn't solve my problem. I would be grateful if someone could give me some advices. Thanks, dmp 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 il-antlr-inter...@googlegroups.com. To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.