[antlr-interest] Out-of-order child node evaluation

Craig Berry Craig.Berry at portblue.com
Tue Jun 28 12:27:28 PDT 2005


Hi, all,
I've consulted all the doc and FAQs I can find, but somehow I'm having a
continued mental block on resolving this problem.  Any help would be
appreciated.
We have a tree-walker rule clause that looks like this:
	|	#(sumop:SUM 
	      opA=subexpression opAxis=axisexpression)
		{ 
		  returnValue = new
SumFunctionCalculator().calculate(valueManager, opA, opAxis);
		}
As part of a redesign I would like to evaluate the right (opAxis) child
node first, and change things about the evaluation environment before
then evaluating the left (opA) child node.
I have been flailing around unsuccessfully with tree transformations,
override codes, noop rules, and a dozen other things, but I can't
accomplish this seemingly simple task.  Can anyone point me in the right
direction, please?

-- 
Craig Berry
Principal Architect
PortBlue Corporation (http://www.portblue.com/)



More information about the antlr-interest mailing list