On Apr 18, 2010, at 4:50 PM, Cliff Hudson wrote:
> You wrote:
>
> Well, imagine that you are modifying "global" state as you match characters
> in identifier; this is something done in actions that ANTLR can analyze.
> There is no way to "roll this back".
>
> The 'global' state you are talking about is state the DFA is modifying but
> which an action in a rule could examine? Is the amount of state visible to
> actions too much to store while alternatives are being evaulated?
It's state you set up and modify then ref:
@members {
int i = 0;
}
...
ID : ('a'..'z' {i++;})+ {System.out.println(i);} ;
ANTLR can't save i for you each char iteration.
Ter
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.