1 33 34 package bsh; 35 36 40 class BSHFormalParameter extends SimpleNode 41 { 42 public static final Class UNTYPED = null; 43 public String name; 44 public Class type; 46 47 BSHFormalParameter(int id) { super(id); } 48 49 public String getTypeDescriptor( 50 CallStack callstack, Interpreter interpreter, String defaultPackage ) 51 { 52 if ( jjtGetNumChildren() > 0 ) 53 return ((BSHType)jjtGetChild(0)).getTypeDescriptor( 54 callstack, interpreter, defaultPackage ); 55 else 56 return "Ljava/lang/Object;"; } 59 60 63 public Object eval( CallStack callstack, Interpreter interpreter) 64 throws EvalError 65 { 66 if ( jjtGetNumChildren() > 0 ) 67 type = ((BSHType)jjtGetChild(0)).getType( callstack, interpreter ); 68 else 69 type = UNTYPED; 70 71 return type; 72 } 73 } 74 75 | Popular Tags |