voidtype.java

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

JAVA
254
字号

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 VoidType extends TypeDecl implements Cloneable {
    public void flushCache() {        super.flushCache();        instanceOf_TypeDecl_values = null;        typeDescriptor_computed = false;        typeDescriptor_value = null;    }     @SuppressWarnings({"unchecked", "cast"})  public VoidType clone() throws CloneNotSupportedException {        VoidType node = (VoidType)super.clone();        node.instanceOf_TypeDecl_values = null;        node.typeDescriptor_computed = false;        node.typeDescriptor_value = null;        node.in$Circle(false);        node.is$Final(false);    return node;    }     @SuppressWarnings({"unchecked", "cast"})  public VoidType copy() {      try {          VoidType node = (VoidType)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 VoidType fullCopy() {        VoidType res = (VoidType)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 CodeGeneration.jrag at line 618  public void emitReturn(CodeGeneration gen)      { gen.emit(Bytecode.RETURN);}    // Declared in CodeGeneration.jrag at line 850  public void emitDup(CodeGeneration gen)      { }    // Declared in CodeGeneration.jrag at line 855  public void emitDup_x1(CodeGeneration gen)   { }    // Declared in CodeGeneration.jrag at line 860  public void emitDup_x2(CodeGeneration gen)   { }    // Declared in CodeGeneration.jrag at line 865  public void emitPop(CodeGeneration gen)      { }    // Declared in java.ast at line 3    // Declared in java.ast line 45
    public VoidType() {        super();
        setChild(new List(), 1);

    }    // Declared in java.ast at line 11
    // Declared in java.ast line 45    public VoidType(Modifiers p0, String p1, List<BodyDecl> p2) {        setChild(p0, 0);        setID(p1);        setChild(p2, 1);    }    // Declared in java.ast at line 18    // Declared in java.ast line 45    public VoidType(Modifiers p0, beaver.Symbol p1, List<BodyDecl> p2) {        setChild(p0, 0);        setID(p1);        setChild(p2, 1);    }    // Declared in java.ast at line 24  protected int numChildren() {
    return 2;
  }    // Declared in java.ast at line 27
  public boolean mayHaveRewrite() { return false; }    // Declared in java.ast at line 2    // Declared in java.ast line 38    public void setModifiers(Modifiers node) {        setChild(node, 0);    }    // Declared in java.ast at line 5    public Modifiers getModifiers() {        return (Modifiers)getChild(0);    }    // Declared in java.ast at line 9    public Modifiers getModifiersNoTransform() {        return (Modifiers)getChildNoTransform(0);    }    // Declared in java.ast at line 2    // Declared in java.ast line 38    public void setBodyDeclList(List<BodyDecl> list) {        setChild(list, 1);    }    // Declared in java.ast at line 6    private int getNumBodyDecl = 0;    // Declared in java.ast at line 7    public int getNumBodyDecl() {        return getBodyDeclList().getNumChild();    }    // Declared in java.ast at line 11     @SuppressWarnings({"unchecked", "cast"})  public BodyDecl getBodyDecl(int i) {        return (BodyDecl)getBodyDeclList().getChild(i);    }    // Declared in java.ast at line 15    public void addBodyDecl(BodyDecl node) {        List<BodyDecl> list = getBodyDeclList();        list.addChild(node);    }    // Declared in java.ast at line 20    public void setBodyDecl(BodyDecl node, int i) {        List<BodyDecl> list = getBodyDeclList();        list.setChild(node, i);    }    // Declared in java.ast at line 24    public List<BodyDecl> getBodyDecls() {        return getBodyDeclList();    }    // Declared in java.ast at line 27    public List<BodyDecl> getBodyDeclsNoTransform() {        return getBodyDeclListNoTransform();    }    // Declared in java.ast at line 31     @SuppressWarnings({"unchecked", "cast"})  public List<BodyDecl> getBodyDeclList() {        return (List<BodyDecl>)getChild(1);    }    // Declared in java.ast at line 35     @SuppressWarnings({"unchecked", "cast"})  public List<BodyDecl> getBodyDeclListNoTransform() {        return (List<BodyDecl>)getChildNoTransform(1);    }    // Declared in TypeAnalysis.jrag at line 57 @SuppressWarnings({"unchecked", "cast"})     public boolean stringConversion() {        boolean stringConversion_value = stringConversion_compute();        return stringConversion_value;    }    private boolean stringConversion_compute() {  return false;  }    // Declared in TypeAnalysis.jrag at line 204 @SuppressWarnings({"unchecked", "cast"})     public boolean isVoid() {        boolean isVoid_value = isVoid_compute();        return isVoid_value;    }    private boolean isVoid_compute() {  return true;  }    // Declared in TypeAnalysis.jrag at line 415 @SuppressWarnings({"unchecked", "cast"})     public boolean instanceOf(TypeDecl type) {        Object _parameters = type;if(instanceOf_TypeDecl_values == null) instanceOf_TypeDecl_values = new java.util.HashMap(4);        if(instanceOf_TypeDecl_values.containsKey(_parameters))            return ((Boolean)instanceOf_TypeDecl_values.get(_parameters)).booleanValue();        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        boolean instanceOf_TypeDecl_value = instanceOf_compute(type);        if(isFinal && num == boundariesCrossed)            instanceOf_TypeDecl_values.put(_parameters, Boolean.valueOf(instanceOf_TypeDecl_value));        return instanceOf_TypeDecl_value;    }    private boolean instanceOf_compute(TypeDecl type) {  return type.isSupertypeOfVoidType(this);  }    // Declared in TypeAnalysis.jrag at line 488 @SuppressWarnings({"unchecked", "cast"})     public boolean isSupertypeOfVoidType(VoidType type) {        boolean isSupertypeOfVoidType_VoidType_value = isSupertypeOfVoidType_compute(type);        return isSupertypeOfVoidType_VoidType_value;    }    private boolean isSupertypeOfVoidType_compute(VoidType type) {  return true;  }    // Declared in ConstantPoolNames.jrag at line 25 @SuppressWarnings({"unchecked", "cast"})     public String typeDescriptor() {        if(typeDescriptor_computed)            return typeDescriptor_value;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        typeDescriptor_value = typeDescriptor_compute();        if(isFinal && num == boundariesCrossed)            typeDescriptor_computed = true;        return typeDescriptor_value;    }    private String typeDescriptor_compute() {  return "V";  }    // Declared in Java2Rewrites.jrag at line 55 @SuppressWarnings({"unchecked", "cast"})     public String primitiveClassName() {        String primitiveClassName_value = primitiveClassName_compute();        return primitiveClassName_value;    }    private String primitiveClassName_compute() {  return "Void";  }public ASTNode rewriteTo() {    return super.rewriteTo();}}

⌨️ 快捷键说明

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