nullliteral.java

来自「JDK1.4编译器前端」· Java 代码 · 共 118 行

JAVA
118
字号

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 NullLiteral extends Literal implements Cloneable {
    public void flushCache() {        super.flushCache();        isConstant_visited = -1;        type_visited = -1;        type_computed = false;        type_value = null;    }     @SuppressWarnings({"unchecked", "cast"})  public NullLiteral clone() throws CloneNotSupportedException {        NullLiteral node = (NullLiteral)super.clone();        node.isConstant_visited = -1;        node.type_visited = -1;        node.type_computed = false;        node.type_value = null;        node.in$Circle(false);        node.is$Final(false);    return node;    }     @SuppressWarnings({"unchecked", "cast"})  public NullLiteral copy() {      try {          NullLiteral node = (NullLiteral)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 NullLiteral fullCopy() {        NullLiteral res = (NullLiteral)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 java.ast at line 3    // Declared in java.ast line 132
    public NullLiteral() {        super();

    }    // Declared in java.ast at line 10
    // Declared in java.ast line 132    public NullLiteral(String p0) {        setLITERAL(p0);    }    // Declared in java.ast at line 15    // Declared in java.ast line 132    public NullLiteral(beaver.Symbol p0) {        setLITERAL(p0);    }    // Declared in java.ast at line 19  protected int numChildren() {
    return 0;
  }    // Declared in java.ast at line 22
  public boolean mayHaveRewrite() { return false; }    protected int isConstant_visited = -1;    // Declared in ConstantExpression.jrag at line 468 @SuppressWarnings({"unchecked", "cast"})     public boolean isConstant() {        if(isConstant_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: isConstant in class: ");        isConstant_visited = boundariesCrossed;        boolean isConstant_value = isConstant_compute();        isConstant_visited = -1;        return isConstant_value;    }    private boolean isConstant_compute() {  return false;  }    protected int type_visited = -1;    protected boolean type_computed = false;    protected TypeDecl type_value;    // Declared in TypeAnalysis.jrag at line 308 @SuppressWarnings({"unchecked", "cast"})     public TypeDecl type() {        if(type_computed)            return type_value;        if(type_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: type in class: ");        type_visited = boundariesCrossed;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        type_value = type_compute();        if(isFinal && num == boundariesCrossed)            type_computed = true;        type_visited = -1;        return type_value;    }    private TypeDecl type_compute() {  return typeNull();  }public ASTNode rewriteTo() {    return super.rewriteTo();}}

⌨️ 快捷键说明

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