[antlr-interest] Using global and dynamic scopes together - is it possible?
Michael Bedward
michael.bedward at gmail.com
Thu Feb 24 19:34:08 PST 2011
That's handy to know !
Just added it to the FAQ...
http://www.antlr.org/wiki/display/ANTLR3/Using+both+global+and+local+%28rule%29+attribute+scopes
Michael
On 23 February 2011 06:15, Jim Idle <jimi at temporal-wave.com> wrote:
> grammar t;
>
> scope GlobalOne {
> int c;
> }
>
>
> rulename
>
> scope
> {
> bool localFlag;
> }
> scope GlobalOne;
> @init
> {
> fred = 1;
> }
>
> : C ;
>
>
> C : 'C';
>
> Globals come after locals but before @init.
>
> Jim
>
More information about the antlr-interest
mailing list