Package temp

Examples of temp.Temp


static StmExpList reorder(ExpList exps) {
     if (exps==null) return nopNull;
     else {
       Exp a = exps.head;
       if (a instanceof CALL) {
         Temp t = new Temp();
   Exp e = new ESEQ(new MOVE(new TEMP(t), a),
            new TEMP(t));
         return reorder(new ExpList(e, exps.tail));
       } else {
   ESEQ aa = do_exp(a);
   StmExpList bb = reorder(exps.tail);
   if (commute(bb.stm, aa.exp))
        return new StmExpList(seq(aa.stm,bb.stm),
            new ExpList(aa.exp,bb.exps));
   else {
     Temp t = new Temp();
     return new StmExpList(
        seq(aa.stm,
          seq(new MOVE(new TEMP(t),aa.exp),
         bb.stm)),
        new ExpList(new TEMP(t), bb.exps));
View Full Code Here


        return new Nx(new IRTree2.MOVE(new IRTree2.BINOP(IRTree2.BINOP.PLUS,new IRTree2.MEM(expId), new IRTree2.BINOP(IRTree2.BINOP.MUL,e1,new IRTree2.CONST(4))), e2));
  }

  public Exp visit(AndExp n)
  {
          Temp t1 = new Temp();
      Label done = new Label();
      Label ok1 = new Label();
      Label ok2 = new Label();
     
      IRTree2.Exp left =  n.e1.accept(this).unEx();
View Full Code Here

  {
          Exp expl= n.e1.accept(this);
      Exp expr= n.e2.accept(this);
      Label T = new Label();
      Label F = new Label();
      Temp t = new Temp();
      return new Ex
          (new IRTree2.ESEQ(new IRTree2.SEQ
                (new IRTree2.SEQ
                 (new IRTree2.SEQ
                  (new IRTree2.MOVE(new IRTree2.TEMP(t),new IRTree2.CONST(0)),
View Full Code Here

        return new Ex(new IRTree2.BINOP(IRTree2.BINOP.MUL, exp1, exp2));
  }

  public Exp visit(TExpArrayLookup n)
  {
          Temp t_index = new Temp();
      Temp t_size = new Temp();
      IRTree2.Exp e1 = n.e1.accept(this).unEx();
      IRTree2.Exp e2 = n.e2.accept(this).unEx();

      Label F = new Label();
      Label T = new Label();
     
      IRTree2.ExpList args1 = new ExpList(e2, null);     
     
      IRTree2.Stm s1 =
          new IRTree2.SEQ
          (new IRTree2.SEQ
           (new IRTree2.SEQ
            (new IRTree2.SEQ
             (new IRTree2.SEQ
              (new IRTree2.MOVE(new IRTree2.TEMP(t_index),new IRTree2.BINOP(IRTree2.BINOP.MUL,e2,new IRTree2.CONST(4))),
                          new IRTree2.MOVE(new IRTree2.TEMP(t_size),new IRTree2.MEM(e1))),
                          new IRTree2.CJUMP(IRTree2.CJUMP.GE,new IRTree2.TEMP(t_index),new IRTree2.TEMP(t_size),T,F)),
                          new IRTree2.LABEL(T)),
                          new IRTree2.MOVE(new IRTree2.TEMP(new Temp()),
                                          new IRTree2.CALL(new IRTree2.NAME(new Label("_error")),args1))),
                                          new IRTree2.LABEL(F));
         
      Temp t = new Temp();
      IRTree2.Stm s2 = new IRTree2.SEQ
          (s1,new IRTree2.MOVE(new IRTree2.TEMP(t),new IRTree2.MEM
                   (new IRTree2.BINOP(IRTree2.BINOP.PLUS,e1,new IRTree2.BINOP
                          (IRTree2.BINOP.PLUS,
                                          new IRTree2.BINOP(IRTree2.BINOP.MUL,e2,new IRTree2.CONST(4))
View Full Code Here

  public Exp visit(TExpNewArray n)
  {
          IRTree2.Exp e = n.e.accept(this).unEx();
      ExpList params = new ExpList(e, null);
      Temp t = new Temp();
     
      return new Ex(new ESEQ(new MOVE(new TEMP(t), currFrame.externalCall("newArray", params)),
              new TEMP(t)));
  }
View Full Code Here

TOP

Related Classes of temp.Temp

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.