[antlr-interest] How to Match a Double-Quote Character

Johannes Luber jaluber at gmx.de
Fri Aug 8 11:59:25 PDT 2008


titech at metaorb.com schrieb:
> Suppose I
> want to match the double quote character in this input:
>  
> (parser
>   
> (string_quote “)
> )
>  
> The
> following lexer rule fails to match this (but succeeds if I change the input to
> contain a single quote instead.
>  
> ANYCHAR       
> :           '\'' | '"' |
> ~(' ' | '\t' | '\r' | '\n');
>  
> Is this a
> bug in 3.1b2, or am I doing something wrong?
>  
> Regards,
> --Mike

Try '\"'.

Johannes


More information about the antlr-interest mailing list