I have an interesting problem. I have written a tree parser for Actionscript
and in it I call external code to convert a reference from Stirng to Number.
I also calculate additional attributes of this reference (Type and format)
The details of the actual reference call is not really relevant. the code
snippets look like this:

@members{
public function
evaluateInternalReference(ref:CommonTree):TreeRuleReturnScope {return null;}

}

reference returns [Object value, String formulaType, String formatString]
    : ^(IREF ir=INT )                {     $value         =
(evaluateInternalReference($ir) as TreeRuleReturnScope).values.value;
                                            $formulaType     =
(evaluateInternalReference($ir) as TreeRuleReturnScope).values.formulaType;
                                            $formatString     =
(evaluateInternalReference($ir) as
TreeRuleReturnScope).values.formatString;}

I am now converting this same Tree Grammar to Java and having a tough time
doing the same thing. Could someone help me out here with what I think
should be a simple solution? I need to somehow access value, formulaType and
formatString as I did above, but in Java?

@members{
public TreeRuleReturnScope evaluateInternalReference(CommonTree ref) {return
null;}
}

reference returns [Object value, String formulaType, String formatString]
    : ^(IREF ir=INT )                {     $value         =
(TreeRuleReturnScope)(evaluateInternalReference($ir)).values.value; ?????


Thanks
Des

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-interest@googlegroups.com
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to