typedecl.java

来自「JDK1.4编译器前端」· Java 代码 · 共 1,493 行 · 第 1/5 页

JAVA
1,493 行
字号
    }    // 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);    }    protected java.util.Map accessibleFromPackage_String_visited;    protected java.util.Map accessibleFromPackage_String_values;    // Declared in AccessControl.jrag at line 15 @SuppressWarnings({"unchecked", "cast"})     public boolean accessibleFromPackage(String packageName) {        Object _parameters = packageName;if(accessibleFromPackage_String_visited == null) accessibleFromPackage_String_visited = new java.util.HashMap(4);if(accessibleFromPackage_String_values == null) accessibleFromPackage_String_values = new java.util.HashMap(4);        if(accessibleFromPackage_String_values.containsKey(_parameters))            return ((Boolean)accessibleFromPackage_String_values.get(_parameters)).booleanValue();        if(new Integer(boundariesCrossed).equals(accessibleFromPackage_String_visited.get(_parameters)))            throw new RuntimeException("Circular definition of attr: accessibleFromPackage in class: ");        accessibleFromPackage_String_visited.put(_parameters, new Integer(boundariesCrossed));        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        boolean accessibleFromPackage_String_value = accessibleFromPackage_compute(packageName);        if(isFinal && num == boundariesCrossed)            accessibleFromPackage_String_values.put(_parameters, Boolean.valueOf(accessibleFromPackage_String_value));        accessibleFromPackage_String_visited.remove(_parameters);        return accessibleFromPackage_String_value;    }    private boolean accessibleFromPackage_compute(String packageName) {  return !isPrivate() && (isPublic() || hostPackage().equals(packageName));  }    protected java.util.Map accessibleFromExtend_TypeDecl_visited;    protected java.util.Map accessibleFromExtend_TypeDecl_values;    // Declared in AccessControl.jrag at line 18 @SuppressWarnings({"unchecked", "cast"})     public boolean accessibleFromExtend(TypeDecl type) {        Object _parameters = type;if(accessibleFromExtend_TypeDecl_visited == null) accessibleFromExtend_TypeDecl_visited = new java.util.HashMap(4);if(accessibleFromExtend_TypeDecl_values == null) accessibleFromExtend_TypeDecl_values = new java.util.HashMap(4);        if(accessibleFromExtend_TypeDecl_values.containsKey(_parameters))            return ((Boolean)accessibleFromExtend_TypeDecl_values.get(_parameters)).booleanValue();        if(new Integer(boundariesCrossed).equals(accessibleFromExtend_TypeDecl_visited.get(_parameters)))            throw new RuntimeException("Circular definition of attr: accessibleFromExtend in class: ");        accessibleFromExtend_TypeDecl_visited.put(_parameters, new Integer(boundariesCrossed));        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        boolean accessibleFromExtend_TypeDecl_value = accessibleFromExtend_compute(type);        if(isFinal && num == boundariesCrossed)            accessibleFromExtend_TypeDecl_values.put(_parameters, Boolean.valueOf(accessibleFromExtend_TypeDecl_value));        accessibleFromExtend_TypeDecl_visited.remove(_parameters);        return accessibleFromExtend_TypeDecl_value;    }    private boolean accessibleFromExtend_compute(TypeDecl type) {    if(type == this)      return true;    if(isInnerType()) {       if(!enclosingType().accessibleFrom(type)) {        return false;      }    }    if(isPublic())       return true;    else if(isProtected()) {      // isProtected implies a nested type      if(hostPackage().equals(type.hostPackage())) {        return true;      }      if(type.isNestedType() && type.enclosingType().withinBodyThatSubclasses(enclosingType()) != null)        return true;      return false;    }    else if(isPrivate()) {      return topLevelType() == type.topLevelType();    }    else      return hostPackage().equals(type.hostPackage());  }    protected java.util.Map accessibleFrom_TypeDecl_visited;    protected java.util.Map accessibleFrom_TypeDecl_values;    // Declared in AccessControl.jrag at line 44 @SuppressWarnings({"unchecked", "cast"})     public boolean accessibleFrom(TypeDecl type) {        Object _parameters = type;if(accessibleFrom_TypeDecl_visited == null) accessibleFrom_TypeDecl_visited = new java.util.HashMap(4);if(accessibleFrom_TypeDecl_values == null) accessibleFrom_TypeDecl_values = new java.util.HashMap(4);        if(accessibleFrom_TypeDecl_values.containsKey(_parameters))            return ((Boolean)accessibleFrom_TypeDecl_values.get(_parameters)).booleanValue();        if(new Integer(boundariesCrossed).equals(accessibleFrom_TypeDecl_visited.get(_parameters)))            throw new RuntimeException("Circular definition of attr: accessibleFrom in class: ");        accessibleFrom_TypeDecl_visited.put(_parameters, new Integer(boundariesCrossed));        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        boolean accessibleFrom_TypeDecl_value = accessibleFrom_compute(type);        if(isFinal && num == boundariesCrossed)            accessibleFrom_TypeDecl_values.put(_parameters, Boolean.valueOf(accessibleFrom_TypeDecl_value));        accessibleFrom_TypeDecl_visited.remove(_parameters);        return accessibleFrom_TypeDecl_value;    }    private boolean accessibleFrom_compute(TypeDecl type) {    if(type == this)      return true;    if(isInnerType()) {       if(!enclosingType().accessibleFrom(type)) {        return false;      }    }    if(isPublic()) {        return true;    }    else if(isProtected()) {      if(hostPackage().equals(type.hostPackage())) {        return true;      }      if(isMemberType()) {        TypeDecl typeDecl = type;        while(typeDecl != null && !typeDecl.instanceOf(enclosingType()))          typeDecl = typeDecl.enclosingType();        if(typeDecl != null) {          return true;        }      }      return false;    }    else if(isPrivate()) {      return topLevelType() == type.topLevelType();    }    else {      return hostPackage().equals(type.hostPackage());    }  }    protected int dimension_visited = -1;    protected boolean dimension_computed = false;    protected int dimension_value;    // Declared in Arrays.jrag at line 11 @SuppressWarnings({"unchecked", "cast"})     public int dimension() {        if(dimension_computed)            return dimension_value;        if(dimension_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: dimension in class: ");        dimension_visited = boundariesCrossed;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        dimension_value = dimension_compute();        if(isFinal && num == boundariesCrossed)            dimension_computed = true;        dimension_visited = -1;        return dimension_value;    }    private int dimension_compute() {  return 0;  }    protected int elementType_visited = -1;    protected boolean elementType_computed = false;    protected TypeDecl elementType_value;    // Declared in Arrays.jrag at line 15 @SuppressWarnings({"unchecked", "cast"})     public TypeDecl elementType() {        if(elementType_computed)            return elementType_value;        if(elementType_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: elementType in class: ");        elementType_visited = boundariesCrossed;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        elementType_value = elementType_compute();        if(isFinal && num == boundariesCrossed)            elementType_computed = true;        elementType_visited = -1;        return elementType_value;    }    private TypeDecl elementType_compute() {  return this;  }    protected int arrayType_visited = -1;    protected boolean arrayType_computed = false;    protected TypeDecl arrayType_value;    // Declared in Arrays.jrag at line 23 @SuppressWarnings({"unchecked", "cast"})     public TypeDecl arrayType() {        if(arrayType_computed)            return arrayType_value;        if(arrayType_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: arrayType in class: ");        arrayType_visited = boundariesCrossed;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        arrayType_value = arrayType_compute();        arrayType_value.setParent(this);        arrayType_value.is$Final = true;        if(true)            arrayType_computed = true;        arrayType_visited = -1;        return arrayType_value;    }    private TypeDecl arrayType_compute() {    String name = name() + "[]";    TypeDecl typeDecl =      new ArrayDecl(        new Modifiers(new List().add(new Modifier("public"))),        name,        new Opt(typeObject().createQualifiedAccess()), // [SuperClassAccess]        new List().add(typeCloneable().createQualifiedAccess()).add(typeSerializable().createQualifiedAccess()), // Implements*        new List().add( // BodyDecl*          new FieldDeclaration(            new Modifiers(new List().add(new Modifier("public")).add(new Modifier("final"))),            new PrimitiveTypeAccess("int"),            "length",            new Opt() // [Init:Expr]          )).add(          new MethodDecl(            new Modifiers(new List().add(new Modifier("public"))),            typeObject().createQualifiedAccess(),            "clone",            new List(),            new List(),            new Opt(new Block())          )        )      );    return typeDecl;  }    protected java.util.Map cast_Constant_visited;    // Declared in ConstantExpression.jrag at line 290 @SuppressWarnings({"unchecked", "cast"})     public Constant cast(Constant c) {        Object _parameters = c;if(cast_Constant_visited == null) cast_Constant_visited = new java.util.HashMap(4);        if(new Integer(boundariesCrossed).equals(cast_Constant_visited.get(_parameters)))            throw new RuntimeException("Circular definition of attr: cast in class: ");        cast_Constant_visited.put(_parameters, new Integer(boundariesCrossed));        Constant cast_Constant_value = cast_compute(c);        cast_Constant_visited.remove(_parameters);        return cast_Constant_value;    }    private Constant cast_compute(Constant c) {    throw new UnsupportedOperationException("ConstantExpression operation cast" +      " not supported for type " + getClass().getName());   }    protected java.util.Map plus_Constant_visited;    // Declared in ConstantExpression.jrag at line 304 @SuppressWarnings({"unchecked", "cast"})     public Constant plus(Constant c) {        Object _parameters = c;if(plus_Constant_visited == null) plus_Constant_visited = new java.util.HashMap(4);        if(new Integer(boundariesCrossed).equals(plus_Constant_visited.get(_parameters)))            throw new RuntimeException("Circular definition of attr: plus in class: ");        plus_Constant_visited.put(_parameters, new Integer(boundariesCrossed));        Constant plus_Constant_value = plus_compute(c);        plus_Constant_visited.remove(_parameters);        return plus_Constant_value;    }    private Constant plus_compute(Constant c) {    throw new UnsupportedOperationException("ConstantExpression operation plus" +

⌨️ 快捷键说明

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