Example #1
0
 public void visit(NodeListOptional n, String sep) {
   if (n.present())
     for (Enumeration e = n.elements(); e.hasMoreElements(); ) {
       ((Node) e.nextElement()).accept(this);
       if (e.hasMoreElements()) out.print(sep);
     }
 }
Example #2
0
 public final Call Call() throws ParseException {
   NodeToken n0;
   Token n1;
   SimpleExp n2;
   NodeToken n3;
   Token n4;
   NodeListOptional n5 = new NodeListOptional();
   Temp n6;
   NodeToken n7;
   Token n8;
   n1 = jj_consume_token(CALL);
   n0 = JTBToolkit.makeNodeToken(n1);
   n2 = SimpleExp();
   n4 = jj_consume_token(LPAREN);
   n3 = JTBToolkit.makeNodeToken(n4);
   label_3:
   while (true) {
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case TEMP:;
         break;
       default:
         jj_la1[5] = jj_gen;
         break label_3;
     }
     n6 = Temp();
     n5.addNode(n6);
   }
   n5.nodes.trimToSize();
   n8 = jj_consume_token(RPAREN);
   n7 = JTBToolkit.makeNodeToken(n8);
   {
     if (true) return new Call(n0, n2, n3, n5, n7);
   }
   throw new Error("Missing return statement in function");
 }
 public void visit(final NodeListOptional n, final A argu) {
   if (n.present()) {
     for (final Iterator<INode> e = n.elements(); e.hasNext(); ) {
       e.next().accept(this, argu);
     }
     return;
   } else return;
 }
Example #4
0
 public void visit(NodeListOptional n, A argu) {
   if (n.present()) {
     int _count = 0;
     for (Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
       e.nextElement().accept(this, argu);
       _count++;
     }
   }
 }
 public R visit(NodeListOptional n) {
   if (n.present()) {
     R _ret = null;
     int _count = 0;
     for (Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
       e.nextElement().accept(this);
       _count++;
     }
     return _ret;
   } else return null;
 }
 public PGValue visit(NodeListOptional n, Node argu) {
   ParamList_pg pl = new ParamList_pg();
   if (n.present()) {
     PGValue _ret = null;
     int _count = 0;
     for (Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
       PGValue p = (PGValue) e.nextElement().accept(this, argu);
       if (p != null) pl.Insert(p);
       _count++;
     }
     return pl;
   } else return null;
 }
Example #7
0
 public CompilationUnit(
     NodeOptional n0, NodeListOptional n1, NodeListOptional n2, NodeOptional n3, NodeOptional n4) {
   f0 = n0;
   if (f0 != null) f0.setParent(this);
   f1 = n1;
   if (f1 != null) f1.setParent(this);
   f2 = n2;
   if (f2 != null) f2.setParent(this);
   f3 = n3;
   if (f3 != null) f3.setParent(this);
   f4 = n4;
   if (f4 != null) f4.setParent(this);
   f5 = new NodeToken("");
   if (f5 != null) f5.setParent(this);
 }
Example #8
0
 public final StmtList StmtList() throws ParseException {
   NodeListOptional n0 = new NodeListOptional();
   NodeSequence n1;
   NodeOptional n2;
   Label n3;
   Stmt n4;
   label_2:
   while (true) {
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case NOOP:
       case MOVE:
       case ERROR:
       case PRINT:
       case JUMP:
       case CJUMP:
       case HSTORE:
       case HLOAD:
       case IDENTIFIER:;
         break;
       default:
         jj_la1[1] = jj_gen;
         break label_2;
     }
     n2 = new NodeOptional();
     n1 = new NodeSequence(2);
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case IDENTIFIER:
         n3 = Label();
         n2.addNode(n3);
         break;
       default:
         jj_la1[2] = jj_gen;
         ;
     }
     n1.addNode(n2);
     n4 = Stmt();
     n1.addNode(n4);
     n0.addNode(n1);
   }
   n0.nodes.trimToSize();
   {
     if (true) return new StmtList(n0);
   }
   throw new Error("Missing return statement in function");
 }
Example #9
0
 public final Goal Goal() throws ParseException {
   NodeToken n0;
   Token n1;
   StmtList n2;
   NodeToken n3;
   Token n4;
   NodeListOptional n5 = new NodeListOptional();
   Procedure n6;
   NodeToken n7;
   Token n8;
   n1 = jj_consume_token(MAIN);
   n0 = JTBToolkit.makeNodeToken(n1);
   n2 = StmtList();
   n4 = jj_consume_token(END);
   n3 = JTBToolkit.makeNodeToken(n4);
   label_1:
   while (true) {
     switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
       case IDENTIFIER:;
         break;
       default:
         jj_la1[0] = jj_gen;
         break label_1;
     }
     n6 = Procedure();
     n5.addNode(n6);
   }
   n5.nodes.trimToSize();
   n8 = jj_consume_token(0);
   n8.beginColumn++;
   n8.endColumn++;
   n7 = JTBToolkit.makeNodeToken(n8);
   {
     if (true) return new Goal(n0, n2, n3, n5, n7);
   }
   throw new Error("Missing return statement in function");
 }
 public AdapterStatement(AnnotationDeclaration n0, NodeToken n1, NodeListOptional n2) {
   annotationDeclaration = n0;
   if (annotationDeclaration != null) annotationDeclaration.setParent(this);
   nodeToken = new NodeToken("public");
   if (nodeToken != null) nodeToken.setParent(this);
   nodeToken1 = new NodeToken("Adapter");
   if (nodeToken1 != null) nodeToken1.setParent(this);
   nodeToken2 = n1;
   if (nodeToken2 != null) nodeToken2.setParent(this);
   nodeToken3 = new NodeToken("{");
   if (nodeToken3 != null) nodeToken3.setParent(this);
   nodeListOptional = n2;
   if (nodeListOptional != null) nodeListOptional.setParent(this);
   nodeToken4 = new NodeToken("}");
   if (nodeToken4 != null) nodeToken4.setParent(this);
 }
 public AdapterStatement(
     AnnotationDeclaration n0,
     NodeToken n1,
     NodeToken n2,
     NodeToken n3,
     NodeToken n4,
     NodeListOptional n5,
     NodeToken n6) {
   annotationDeclaration = n0;
   if (annotationDeclaration != null) annotationDeclaration.setParent(this);
   nodeToken = n1;
   if (nodeToken != null) nodeToken.setParent(this);
   nodeToken1 = n2;
   if (nodeToken1 != null) nodeToken1.setParent(this);
   nodeToken2 = n3;
   if (nodeToken2 != null) nodeToken2.setParent(this);
   nodeToken3 = n4;
   if (nodeToken3 != null) nodeToken3.setParent(this);
   nodeListOptional = n5;
   if (nodeListOptional != null) nodeListOptional.setParent(this);
   nodeToken4 = n6;
   if (nodeToken4 != null) nodeToken4.setParent(this);
 }
 public MultiplicativeExpression(UnaryExpression n0, NodeListOptional n1) {
   f0 = n0;
   if (f0 != null) f0.setParent(this);
   f1 = n1;
   if (f1 != null) f1.setParent(this);
 }
Example #13
0
 public void visit(NodeListOptional n) {
   if (n.present())
     for (Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) e.nextElement().accept(this);
 }
 public ConditionalAndExpression(InclusiveOrExpression n0, NodeListOptional n1) {
   f0 = n0;
   if (f0 != null) f0.setParent(this);
   f1 = n1;
   if (f1 != null) f1.setParent(this);
 }