1 9 10 11 package org.nfunk.jep; 12 13 16 public class ASTVarNode extends SimpleNode { 17 18 private Variable var; 20 21 public ASTVarNode(int id) { 22 super(id); 23 var = null; 24 } 25 26 public ASTVarNode(Parser p, int id) { 27 super(p, id); 28 } 29 30 33 public Object jjtAccept(ParserVisitor visitor, Object data) throws ParseException 34 { 35 return visitor.visit(this, data); 36 } 37 38 41 public void setVar(Variable variable) { var = variable; } 46 public Variable getVar() { return var; } 47 48 51 public String getName() 52 { 53 return var.getName(); 54 } 55 56 59 public String toString() 60 { 61 String temp = "Variable: \"" + getName() + "\""; 62 63 return temp; 64 } 65 } 66 | Popular Tags |