Files
Mozilla/mozilla/js/js2/jsc/src/java/semantics/values/CodeValue.java
jeff.dyer%compilercompany.com 6ad4f40cf9 Fixed type bugs and header comments.
git-svn-id: svn://10.0.0.236/trunk@83238 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-04 18:47:28 +00:00

63 lines
1.7 KiB
Java

/*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Mountain View Compiler
* Company. Portions created by Mountain View Compiler Company are
* Copyright (C) 1998-2000 Mountain View Compiler Company. All
* Rights Reserved.
*
* Contributor(s):
* Jeff Dyer <jeff@compilercompany.com>
*/
package com.compilercompany.ecmascript;
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.
*/