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

📄 preincexpr.java

📁 JDK1.4编译器前端
💻 JAVA
字号:

package AST;
import java.util.HashSet;import java.util.LinkedHashSet;import java.io.FileNotFoundException;import java.io.File;import java.util.*;import beaver.*;import java.util.ArrayList;import java.util.zip.*;import java.io.*;public class PreIncExpr extends Unary implements Cloneable {
    public void flushCache() {        super.flushCache();        printPreOp_visited = -1;    }     @SuppressWarnings({"unchecked", "cast"})  public PreIncExpr clone() throws CloneNotSupportedException {        PreIncExpr node = (PreIncExpr)super.clone();        node.printPreOp_visited = -1;        node.in$Circle(false);        node.is$Final(false);    return node;    }     @SuppressWarnings({"unchecked", "cast"})  public PreIncExpr copy() {      try {          PreIncExpr node = (PreIncExpr)clone();          if(children != null) node.children = (ASTNode[])children.clone();          return node;      } catch (CloneNotSupportedException e) {      }      System.err.println("Error: Could not clone node of type " + getClass().getName() + "!");      return null;    }     @SuppressWarnings({"unchecked", "cast"})  public PreIncExpr fullCopy() {        PreIncExpr res = (PreIncExpr)copy();        for(int i = 0; i < getNumChildNoTransform(); i++) {          ASTNode node = getChildNoTransform(i);          if(node != null) node = node.fullCopy();          res.setChild(node, i);        }        return res;    }    // Declared in DefiniteAssignment.jrag at line 72    public void definiteAssignment() {    if(getOperand().isVariable()) {      Variable v = getOperand().varDecl();      if(v != null && v.isFinal()) {        error("++ and -- can not be applied to final variable " + v);      }    }  }    // Declared in DefiniteAssignment.jrag at line 478  protected boolean checkDUeverywhere(Variable v) {    if(getOperand().isVariable() && getOperand().varDecl() == v)      if(!isDAbefore(v))        return false;    return super.checkDUeverywhere(v);  }    // Declared in TypeCheck.jrag at line 301  // 15.15.1  public void typeCheck() {    if(!getOperand().isVariable())      error("prefix increment expression only work on variables");    else if(!getOperand().type().isNumericType())      error("unary increment only operates on numeric types");  }    // Declared in java.ast at line 3    // Declared in java.ast line 140
    public PreIncExpr() {        super();

    }    // Declared in java.ast at line 10
    // Declared in java.ast line 140    public PreIncExpr(Expr p0) {        setChild(p0, 0);    }    // Declared in java.ast at line 14  protected int numChildren() {
    return 1;
  }    // Declared in java.ast at line 17
  public boolean mayHaveRewrite() { return false; }    // Declared in java.ast at line 2    // Declared in java.ast line 139    public void setOperand(Expr node) {        setChild(node, 0);    }    // Declared in java.ast at line 5    public Expr getOperand() {        return (Expr)getChild(0);    }    // Declared in java.ast at line 9    public Expr getOperandNoTransform() {        return (Expr)getChildNoTransform(0);    }    protected int printPreOp_visited = -1;    // Declared in PrettyPrint.jadd at line 393 @SuppressWarnings({"unchecked", "cast"})     public String printPreOp() {        if(printPreOp_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: printPreOp in class: ");        printPreOp_visited = boundariesCrossed;        String printPreOp_value = printPreOp_compute();        printPreOp_visited = -1;        return printPreOp_value;    }    private String printPreOp_compute() {  return "++";  }    // Declared in DefiniteAssignment.jrag at line 54    public boolean Define_boolean_isIncOrDec(ASTNode caller, ASTNode child) {        if(caller == getOperandNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_isIncOrDec(this, caller);    }    // Declared in DefiniteAssignment.jrag at line 46    public boolean Define_boolean_isDest(ASTNode caller, ASTNode child) {        if(caller == getOperandNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_isDest(this, caller);    }public ASTNode rewriteTo() {    return super.rewriteTo();}}

⌨️ 快捷键说明

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