[antlr-interest] Comment

Michael micha-1 at fantasymail.de
Thu May 7 05:40:58 PDT 2009


Am Thursday 07 May 2009 14:10:22 schrieb Thomas Dill:
> Hi there.
>
>
>
> I still got the following Problem:
>
>
>
> In the syntax, I want to parse, a comment line starts with "-*" and ends at
> the end of the line. It's possible that an asterisk can appear in a "text",
> too.
>

i have a working one-line comment version like this ( comments start with # 
or // and go until end of the line):


NL: ('\r'? '\n')+ { skip();};
SINGLE_COMMENT: ('#' | '//') ~('\r' | '\n')* NL { skip();};

so change this to:
SINGLE_COMMENT: '-*' ~('\r' | '\n')* NL { skip();};

doesn't work?

cheers,
 Michael


More information about the antlr-interest mailing list