1999-04-27 16:22:20 +00:00
|
|
|
import java.io.*;
|
1999-04-16 02:55:36 +00:00
|
|
|
|
|
|
|
class Brenda {
|
1999-04-27 16:22:20 +00: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);
|
1999-05-18 22:49:59 +00:00
|
|
|
ControlNodeGroup tree = new ControlNodeGroup();
|
|
|
|
parser.statements(0, tree);
|
1999-04-27 19:02:40 +00:00
|
|
|
System.out.println(ControlNode.printAll());
|
1999-05-07 22:07:22 +00: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 16:22:20 +00:00
|
|
|
} catch(Exception e) {
|
|
|
|
System.err.println("exception: "+e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-04-16 02:55:36 +00:00
|
|
|
}
|