[antlr-interest] Comment

Michael micha-1 at fantasymail.de
Thu May 7 06:03:30 PDT 2009


Am Thursday 07 May 2009 14:10:22 schrieb Thomas Dill:
>
>
> grammar FexParser;
>
> options {k=3; backtrack=true; memoize=true;}
>
> report    :    (comment | text | NEWLINE)+ ;
>
>
> comment   :    (COMMENT_START ~(NEWLINE))* ;
I think this does only read one "-*" and the next character (not till end of 
line), then it wants to read COMMENT_START again 

how is (no time to try it now):
 comment   :    COMMENT_START (~(NEWLINE))* NEWLINE;

>
> text      :    (~(COMMENT_START | NEWLINE))+;



More information about the antlr-interest mailing list