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

Terence Parr parrt at cs.usfca.edu
Sun Dec 12 12:28:14 PST 2004



On Dec 12, 2004, at 12:28 AM, matthew ford wrote:
> The docs say
> " Disambiguating predicates are always the first element in a 
> production
> because they cannot be hoisted over actions, token, or rule 
> references. For
> example, the first production of the following rule has a 
> disambiguating
> predicate that would be hoisted into the prediction expression for the 
> first
> alternative: "
>
> But the in the following lexer the Disambiguating predicate
>  ( (LA(1) == '"')
>            || ( (LA(1) == '&')
>               && (LA(2) == 'q')
>               && (LA(3) == 'u')
>               && (LA(4) == 'o')
>               && (LA(5) == 't')
>               && (LA(6) == ';'))
>         ) }?
> is not being hoisted to protect access to the rule STRING_PART  or am I
> missing some thing

Official "hoisting" is not implemented in 2.x (a step backwards from 
1.x).  3.x will have it back.  Hoisting only goes into the immediately 
surrounding decision for now.

Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!





 
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