⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stmtforloop.java

📁 用Java实现的编译器。把源代码编译成SPARC汇编程序
💻 JAVA
字号:
package CatDecaf.IR; // Java Package generated by the BNF Converter.
import parser.*;
import CatDecaf.Utilities.Debugger.*;
import CatDecaf.SymTable.*;
public class StmtForLoop extends Stmt implements CatDecaf.Utilities.Visitable
{
  public Identifier identifier1_;  //ID = exp
  public IDDescriptor idd1_; 	// for constant propagation optimization
  public Exp exp1_;
  public Exp exp2_;  		     // exp
  public Identifier identifier3_; //ID = exp
  public IDDescriptor idd3_; 	// for constant propagation optimization
  public Exp exp3_;  
  public Block block_;

  public StmtForLoop(  Identifier p1, Exp p2, 
  					     Exp p3, 
  					     Identifier p4,Exp p5,
  					     Block p6 )
  	{ identifier1_ = p1; exp1_ = p2;
  	   exp2_ = p3;
  	   identifier3_ = p4; exp3_ = p5;
  	   block_ = p6;
/*
  	   if(identifier1_.noError() && identifier1_.getType()!=sym.INT)
  	   	ErrorLog.log("for loop: '"+identifier1_.identifier_+"' must be an Integer type");	 
  	   
  	   if(exp1_.noError() && exp1_.getType()!=sym.INT) 
  	   	ErrorLog.log("for loop: Integer assignment expected for '"+identifier1_.identifier_+"'");
  	   
  	   if(exp2_.noError() && exp2_.getType()!=sym.BOOLEAN) 
  	   	ErrorLog.log("for loop: Boolean type expected for FOR loop condition");
  	   
  	   if(identifier3_.noError() && identifier3_.getType()!=sym.INT) 
  	   	ErrorLog.log("for loop: '"+identifier3_.identifier_+"' must be an Integer type");   	
  	   
  	   if(exp3_.noError() && exp3_.getType()!=sym.INT) 
  	   	ErrorLog.log("for loop: Integer assignment expected for '"+identifier3_.identifier_+"'");
  */
  	}

  /*
  public void setBlock(Block p1){
		block_ = p1;
  }
  */

  public void accept(CatDecaf.Utilities.Visitor v) { v.visit(this); }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -