# NOT A PART OF SEAMONKEY IN ANY WAY
Some new, some old filres copiedfrom Rhino to form start of prototyping environment for Project Brenda git-svn-id: svn://10.0.0.236/trunk@27571 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
31
mozilla/js/js2/java/Interpreter.java
Normal file
31
mozilla/js/js2/java/Interpreter.java
Normal file
@@ -0,0 +1,31 @@
|
||||
public class Interpreter {
|
||||
|
||||
|
||||
void executeScript(Node node)
|
||||
{
|
||||
Node child = node.getFirstChild();
|
||||
while (child != null) {
|
||||
if (child.getType() != TokenStream.FUNCTION)
|
||||
executeCode(child);
|
||||
child = child.getNextSibling();
|
||||
}
|
||||
}
|
||||
|
||||
void executeCode(Node top)
|
||||
{
|
||||
PostorderNodeIterator ni = new PostorderNodeIterator(top);
|
||||
|
||||
JSStack theStack = new JSStack();
|
||||
|
||||
Node n = ni.nextNode();
|
||||
while (n != null) {
|
||||
ni = n.execute(theStack, ni);
|
||||
n = ni.nextNode();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user