MCPcopy Create free account
hub / github.com/beanshell/beanshell / eval

Method eval

src/bsh/BSHUnaryExpression.java:36–55  ·  view source on GitHub ↗
( CallStack callstack, Interpreter interpreter)

Source from the content-addressed store, hash-verified

34 BSHUnaryExpression(int id) { super(id); }
35
36 public Object eval( CallStack callstack, Interpreter interpreter)
37 throws EvalError
38 {
39 SimpleNode node = (SimpleNode)jjtGetChild(0);
40
41 // If this is a unary increment of decrement (either pre or postfix)
42 // then we need an LHS to which to assign the result. Otherwise
43 // just do the unary operation for the value.
44 try {
45 if ( kind == INCR || kind == DECR ) {
46 LHS lhs = ((BSHPrimaryExpression)node).toLHS(
47 callstack, interpreter );
48 return lhsUnaryOperation( lhs, interpreter.getStrictJava() );
49 } else
50 return
51 unaryOperation( node.eval(callstack, interpreter), kind );
52 } catch ( UtilEvalError e ) {
53 throw e.toEvalError( this, callstack );
54 }
55 }
56
57 private Object lhsUnaryOperation( LHS lhs, boolean strictJava )
58 throws UtilEvalError

Callers

nothing calls this directly

Calls 7

lhsUnaryOperationMethod · 0.95
unaryOperationMethod · 0.95
evalMethod · 0.95
getStrictJavaMethod · 0.80
jjtGetChildMethod · 0.65
toLHSMethod · 0.45
toEvalErrorMethod · 0.45

Tested by

no test coverage detected