It's been too long since I worked with that syntax but let me try ...
> My question is: what does the "##" represent in the rule below?
>
> <tt>
> remark_set :
> REMARK_SET
> { ##.setRemarkList (Express_Lexer.getRemarkList());
> }
> ;
I'm not sure about this. Could be a reference to the rule itself.
>
> simple_id :
> t1:BASED_ON^ (remark_set)?
> { #t1.setType(SIMPLE_ID);
This is obviously a reference to token t1 and sets a type. Use "{ $type = SIMPLE_ID; }" now.
> Messages.warning("Using Edition 2 keyword as identifier", #t1);
> }
> ...
> | SIMPLE_ID^ (remark_set)?
> ;
> </tt>
>
There is another form like in this rule:
common_resource_attributes:
(load_attribute | memory_attribute)+
{#common_resource_attributes = #(#[RESOURCE_ATTRIBUTES, "resource attributes"], common_resource_attributes);}
;
which would be in ANTLR 3 syntax:
common_resource_attributes:
(load_attribute | memory_attribute)+
-> ^(RESOURCE_ATTRIBUTES (load_attribute | memory_attribute)+)
;
Mike
--
www.soft-gems.net