[antlr-interest] Solution to " How to have strings enclosed in " and/or ""

Terence Parr parrt at cs.usfca.edu
Sat Dec 11 22:14:16 PST 2004



On Dec 11, 2004, at 10:08 PM, matthew ford wrote:
> This is what I came up with which seems to work
>
> The interesting bit is
>   | ~('\n'|'\r')
>         { if ( (LA(1) == '"') || ( (LA(1) == '&')
>               && (LA(2) == 'q')
>               && (LA(3) == 'u')
>               && (LA(4) == 'o')
>               && (LA(5) == 't')
>               && (LA(6) == ';'))
>         ) {break;} }
> where the break; is used to break out of antlr' ( )* block

Won't a greedy=false loop do the same thing?

Ter





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list