Files
Mozilla/mozilla/js2/jsc/src/java/semantics/values/CodeValue.java
jeff.dyer%compilercompany.com c66ef4b453 Updating JSC with framework for semantics in cpp.
git-svn-id: svn://10.0.0.236/trunk@90437 18797224-902f-48f8-a5cc-f745e15eee43
2001-03-26 22:31:11 +00:00

41 lines
867 B
Java

package com.compilercompany.es3c.v1;
import java.util.Vector;
/**
* A code value (intermediate).
*
* This value holds the intermediate code for an non-constant value.
*/
public class CodeValue extends Value {
private static final boolean debug = false;
private Node node;
public CodeValue( Node node ) {
this.node = node;
}
public String toString() {
return "code("+node+")";
}
/**
* The result depends on during what phase this function
* is called. At compile time it will either return itself,
* or a compile-time constant value. At runtime it will
* return a runtime value.
*/
public Value getValue(Context context) throws Exception {
// ACTION: execute the code to get the value.
return node.evaluate(context,context.evaluator);
}
}
/*
* The end.
*/