1 33 34 35 package bsh; 36 37 class BSHThrowStatement extends SimpleNode 38 { 39 BSHThrowStatement(int id) { super(id); } 40 41 public Object eval( CallStack callstack, Interpreter interpreter) 42 throws EvalError 43 { 44 Object obj = ((SimpleNode)jjtGetChild(0)).eval(callstack, interpreter); 45 46 if(!(obj instanceof Exception )) 49 throw new EvalError("Expression in 'throw' must be Exception type", 50 this, callstack ); 51 52 throw new TargetError( (Exception )obj, this, callstack ); 54 } 55 } 56 57 | Popular Tags |