hi. search for keyword "imaginary token" or imaginary  node.
Ter
On Jan 8, 2011, at 11:05 AM, [email protected] wrote:

> Hello All,
> 
> Sorry for the confusing title...
> 
> I'm trying to build an AST via rewrite rules.
> 
> The input is a DSL which contains a number of possible constructs, 
> including a description of state transitions.
> 
> I'd like to build a list 1of all the states mentioned and include that 
> list in the AST as something like ^( SL states+ )
> 
> What is the best way to do this?
> 
> I tried to build a separate rule to extract the states from the input 
> and insert it at the right side, but Antlr complains about referencing 
> something on the right side which doesn't show up on the left side...
> 
> example:
> 
> program : bla1 bla2 bla3 -> ^( 'P' bla1 bla2 newSubTree bla3 ) ;
> 
> leads to an error...
> 
> Then i tried to set up a global scope and collect all the names in it , 
> but i didn't find a way to transfer the list into a subtree from within 
> the grammar...
> 
> Do i really have to build the sub-tree by hand and include it manually, 
> or is there a more efficient way?
> 
> Thanks,
> R.
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: 
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address


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.

Reply via email to