1 8 9 package org.lsmp.djep.xjep; 10 import org.nfunk.jep.*; 12 import org.nfunk.jep.function.PostfixMathCommandI; 13 14 33 public class CommandVisitor extends DoNothingVisitor 34 { 35 private XJep xjep; 36 38 public CommandVisitor() 39 { 40 } 41 42 45 46 public Node process(Node node,XJep xjep) throws ParseException 47 { 48 this.xjep=xjep; 49 Node res = (Node) node.jjtAccept(this,null); 50 return res; 51 } 52 53 public Object visit(ASTFunNode node, Object data) throws ParseException 54 { 55 Node children[] = acceptChildrenAsArray(node,data); 56 57 PostfixMathCommandI pfmc = node.getPFMC(); 58 if(pfmc instanceof CommandVisitorI ) 59 { 60 CommandVisitorI com = (CommandVisitorI) pfmc; 61 return com.process(node,children,xjep); 62 } 63 TreeUtils.copyChildrenIfNeeded(node,children); 64 return node; 65 } 66 } 67 | Popular Tags |