Joseph Cottam wrote:
> Solution #2: Flag and filter
> @members{boolean inUpdate = false;}
>
> topdown
> : ^(UPDATE .*) {inUpdate = true;}
> | {inUpdate}?=> RULE -> ^(RULE NEW STUFF);
>
> bottomup: ^(UPDATE .*) {inUPdate = false;}
>
> The use of state makes a serialization point to flag when I am in a in my
> otherwise nicely concurrent application, since there is now a global
> variable of the parser called inUpdate.
Well, you won't be able to use an ANTLR lexer/parser object concurrently in
more than one thread, since they are heavily stateful in any case. The
problem with the pattern above is that it isn't reentrant, if an UPDATE can
contain a QUERY or vice versa. I don't know whether that is the case for
your language; if it is, then look at using dynamically scoped attributes.
--
David-Sarah Hopwood ⚥ http://davidsarah.livejournal.com
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
-~----------~----~----~----~------~----~------~--~---