Hi Annie, One way to pass data between sub-trees is to use global scope. See section 4.5 in the ANTLR book.
Hope this helps Michael 2009/3/17 YINGAnnie <[email protected]>: > > Hi everyone, > > > What I want to do is to replace var t:Number=Math.ceil(1.5); to var > t:int=int(1.5); The tree I got is something like this: > > PROPERTY_DECL (VARIABLE_STATEMENT (VAR_DECL_LIST (VAR_ID_DECL t > (QUALIFIED_NAME Number)) = (ASSIGNMENT_EXPRESSION (CONDITION_EXPRESSION > (...........(QUALIFIED_NAME Math . ceil))) (ARGUMENT_SUFFIX > (.........(PRIMARY_EXPRESSION 1.5)))) > > ....... stands for some other nodes. > > > Replacing Math.ceil(1.5) to int(1.5) is easy to implement.But cos Number > rule and Math.ceil rule belong to different tree, how can I replace Number > to int when value of the other tree's node equals to Math.ceil? > > Thanks in advance! > > > Annie > > ________________________________ > 微软地图实时路况,为您节省的不仅仅是时间! 立即查看! > > 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 -~----------~----~----~----~------~----~------~--~---
