Пример #1
0
 // Statements
 public int visit(IrStmtList sl)
 {
     int ret = STATUS_DEFAULT;
     int i = 0;
     while (i < sl.size())
     {
         int next = ((IrStmt) sl.elementAt(i)).accept(this);
         if (next == STATUS_RETURN)
         {
             ret = STATUS_RETURN;
             break;
         }
         i = (next >= 0) ? next : i+1;
     }
     return ret;
 }
Пример #2
0
 private IrStmtList flattern(IrStmtList list)
 {
     IrStmtList sl = new IrStmtList();
     for (int i = 0; i < list.size(); i++)
     {
         IrStmt s = (IrStmt)list.elementAt(i);
         if (null != (s as IrStmtList))
         {
             sl.add(flattern((IrStmtList)s));
         }
         else
         {
             sl.add(s);
         }
     }
     return sl;
 }
Пример #3
0
 public IrStmt visit(IrStmtList t)
 {
     IrStmtList stmts = new IrStmtList();
     for (int i = 0; i < t.size(); i++)
     {
         IrStmt s = ((IrStmt)t.elementAt(i)).accept(this);
         stmts.add(s);
     }
     return stmts;
 }