62,610
社区成员
发帖
与我相关
我的任务
分享
private Object eval(SimpleNode node, NameSpace nameSpace, CallStack callstack, Interpreter localInterpreter)
throws ParseException, EvalError
{
Object retVal = null;
goto _L1
_L3:
if(TRACE)
println((new StringBuilder("// ")).append(node.getText()).toString());
retVal = node.eval(callstack, localInterpreter);
if(callstack.depth() > 1)
throw new InterpreterError((new StringBuilder("Callstack growing: ")).append(callstack).toString());
if(retVal instanceof ReturnControl)
retVal = ((ReturnControl)retVal).value;
if(localInterpreter.showResults && retVal != Primitive.VOID)
println((new StringBuilder("<")).append(retVal).append(">").toString());
break MISSING_BLOCK_LABEL_507;
ParseException e;
e;
if(DEBUG)
error(e.getMessage(DEBUG));
e.setErrorSourceFile(sourceFileInfo);
throw e;
e;
e.printStackTrace();
throw new EvalError((new StringBuilder("Sourced file: ")).append(sourceFileInfo).append(" internal Error: ").append(e.getMessage()).toString(), node, callstack);
e;
if(e.getNode() == null)
e.setNode(node);
e.reThrow((new StringBuilder("Sourced file: ")).append(sourceFileInfo).toString());
localInterpreter.get_jjtree().reset();
if(callstack.depth() > 1)
{
callstack.clear();
callstack.push(nameSpace);
}
continue; /* Loop/switch isn't completed */
e;
if(DEBUG)
e.printStackTrace();
if(e.getNode() == null)
e.setNode(node);
e.reThrow((new StringBuilder("Sourced file: ")).append(sourceFileInfo).toString());
localInterpreter.get_jjtree().reset();
if(callstack.depth() > 1)
{
callstack.clear();
callstack.push(nameSpace);
}
continue; /* Loop/switch isn't completed */
e;
e.printStackTrace();
throw new EvalError((new StringBuilder("Sourced file: ")).append(sourceFileInfo).append(" unknown error: ").append(e.getMessage()).toString(), node, callstack);
e;
e.printStackTrace();
throw new EvalError((new StringBuilder("Sourced file: ")).append(sourceFileInfo).append(" Token Parsing Error: ").append(e.getMessage()).toString(), node, callstack);
Exception exception;
exception;
localInterpreter.get_jjtree().reset();
if(callstack.depth() > 1)
{
callstack.clear();
callstack.push(nameSpace);
}
throw exception;
localInterpreter.get_jjtree().reset();
if(callstack.depth() > 1)
{
callstack.clear();
callstack.push(nameSpace);
}
node = node.next;
_L1:
if(node != null) goto _L3; else goto _L2
_L2:
return retVal;
}
private Object eval(SimpleNode node, NameSpace nameSpace,
CallStack callstack, Interpreter localInterpreter) {
Object retVal = null;
if (node == null) {
return retVal;
} else {
while (node != null) {
if (TRACE) {
println("// " + node.getText());
}
try {
retVal = node.eval(callstack, localInterpreter);
} catch (EvalError e) {
}
if (callstack.depth() > 1)
throw new InterpreterError((new StringBuilder(
"Callstack growing: ")).append(callstack)
.toString());
if (retVal instanceof ReturnControl)
retVal = ((ReturnControl) retVal).value;
if (localInterpreter.showResults && retVal != Primitive.VOID)
println((new StringBuilder("<")).append(retVal).append(">")
.toString());
localInterpreter.get_jjtree().reset();
if (callstack.depth() > 1) {
callstack.clear();
callstack.push(nameSpace);
}
node = node.next;
}
return retVal;
}
}