MCPcopy Create free account
hub / github.com/chibash/stone / eval

Method eval

src/chap14/ToJava.java:288–298  ·  view source on GitHub ↗
(Environment env, Object value)

Source from the content-addressed store, hash-verified

286 return code.append(')').toString();
287 }
288 public Object eval(Environment env, Object value) {
289 if (!(value instanceof JavaFunction))
290 throw new StoneException("bad function", this);
291 JavaFunction func = (JavaFunction)value;
292 Object[] args = new Object[numChildren() + 1];
293 args[0] = env;
294 int num = 1;
295 for (ASTree a: this)
296 args[num++] = ((chap6.BasicEvaluator.ASTreeEx)a).eval(env);
297 return func.invoke(args);
298 }
299 }
300 @Reviser public static class VarStmntEx3 extends TypeChecker.VarStmntEx2 {
301 public VarStmntEx3(List<ASTree> c) { super(c); }

Callers

nothing calls this directly

Calls 3

invokeMethod · 0.95
numChildrenMethod · 0.45
evalMethod · 0.45

Tested by

no test coverage detected