gecko-dev/js/js2/java/Brenda.java

24 строки
669 B
Java
Исходник Обычный вид История

1999-04-27 20:22:20 +04:00
import java.io.*;
1999-04-16 06:55:36 +04:00
class Brenda {
1999-04-27 20:22:20 +04:00
public static void main(String[] args) {
try {
JSLexer lexer = new JSLexer((args != null) ? new DataInputStream(new FileInputStream(args[0])) : new DataInputStream(System.in));
JSParser parser = new JSParser(lexer);
ControlNodeGroup tree = new ControlNodeGroup();
parser.statements(0, tree);
1999-04-27 23:02:40 +04:00
System.out.println(ControlNode.printAll());
1999-05-08 02:07:22 +04:00
Environment theEnv = new Environment();
ControlNode c = tree.getHead();
while (c != null) c = c.eval(theEnv);
System.out.println("After eval :\n" + theEnv.print());
1999-04-27 20:22:20 +04:00
} catch(Exception e) {
System.err.println("exception: "+e);
}
}
1999-04-16 06:55:36 +04:00
}