01: //
02: // Generated by JTB 1.2.1
03: //
04:
05: package oscript.syntaxtree;
06:
07: /**
08: * Grammar production:
09: * <PRE>
10: * f0 -> ( EvaluationUnit() )*
11: * </PRE>
12: */
13: public class Program implements Node {
14: public NodeListOptional f0;
15:
16: public Program staticNodes = null;
17:
18: public Program(NodeListOptional n0, boolean bogus) {
19: f0 = n0;
20: }
21:
22: public Program(NodeListOptional n0) {
23: f0 = n0;
24:
25: NodeListOptional nlo = null;
26: for (int i = 0; i < f0.nodes.size(); i++) {
27: EvaluationUnit eu = (EvaluationUnit) (f0.nodes.elementAt(i));
28: if (eu.isStatic) {
29: if (nlo == null) {
30: nlo = new NodeListOptional();
31: }
32: nlo.addNode(eu);
33: f0.nodes.remove(i--);
34: }
35: }
36: if (nlo != null) {
37: staticNodes = new Program(nlo, false);
38: }
39: }
40:
41: public void accept(oscript.visitor.Visitor v) {
42: v.visit(this );
43: }
44:
45: public Object accept(oscript.visitor.ObjectVisitor v, Object argu) {
46: return v.visit(this , argu);
47: }
48:
49: public oscript.NodeEvaluator nodeEvaluator;
50: }
|