Hi,

This ought to work:

NESTED_ML_COMMENT
  :  '[' (~('[' | ']') | NESTED_ML_COMMENT)* ']'
  ;


Regards,

Bart.


On Mon, Jul 18, 2011 at 9:44 PM, Dejas Ninethousand <[email protected]>wrote:

> I've modified the multiline comment example from the FAQ (
> http://www.antlr.org/wiki/pages/viewpage.action?pageId=1573) to be:
>
> NESTED_ML_COMMENT
>    :   '['
>        (options {greedy=false;} : NESTED_ML_COMMENT | . )*
>        ']' {$channel=HIDDEN;}
>    ;
>
> However, it is not behaving as expected in the ANLTRWorks interpreter.
>  When
> I ask the interpreter to match on:
>
> []
>
> there is no problem, but when I ask it to match on:
>
> [j]
>
> I get a mismatched token exception.  Any thoughts as to why?
>
> Thanks.
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>

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