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

📄 constructordecl.java

📁 JDK1.4编译器前端
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
        parameterDeclaration_String_visited.remove(_parameters);        return parameterDeclaration_String_value;    }    private SimpleSet parameterDeclaration_compute(String name) {    for(int i = 0; i < getNumParameter(); i++)      if(getParameter(i).name().equals(name))        return (ParameterDeclaration)getParameter(i);    return SimpleSet.emptySet;  }    protected int isSynthetic_visited = -1;    // Declared in Modifiers.jrag at line 215 @SuppressWarnings({"unchecked", "cast"})     public boolean isSynthetic() {        if(isSynthetic_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: isSynthetic in class: ");        isSynthetic_visited = boundariesCrossed;        boolean isSynthetic_value = isSynthetic_compute();        isSynthetic_visited = -1;        return isSynthetic_value;    }    private boolean isSynthetic_compute() {  return getModifiers().isSynthetic();  }    protected int isPublic_visited = -1;    // Declared in Modifiers.jrag at line 233 @SuppressWarnings({"unchecked", "cast"})     public boolean isPublic() {        if(isPublic_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: isPublic in class: ");        isPublic_visited = boundariesCrossed;        boolean isPublic_value = isPublic_compute();        isPublic_visited = -1;        return isPublic_value;    }    private boolean isPublic_compute() {  return getModifiers().isPublic();  }    protected int isPrivate_visited = -1;    // Declared in Modifiers.jrag at line 234 @SuppressWarnings({"unchecked", "cast"})     public boolean isPrivate() {        if(isPrivate_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: isPrivate in class: ");        isPrivate_visited = boundariesCrossed;        boolean isPrivate_value = isPrivate_compute();        isPrivate_visited = -1;        return isPrivate_value;    }    private boolean isPrivate_compute() {  return getModifiers().isPrivate();  }    protected int isProtected_visited = -1;    // Declared in Modifiers.jrag at line 235 @SuppressWarnings({"unchecked", "cast"})     public boolean isProtected() {        if(isProtected_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: isProtected in class: ");        isProtected_visited = boundariesCrossed;        boolean isProtected_value = isProtected_compute();        isProtected_visited = -1;        return isProtected_value;    }    private boolean isProtected_compute() {  return getModifiers().isProtected();  }    protected java.util.Map circularThisInvocation_ConstructorDecl_visited;    protected java.util.Map circularThisInvocation_ConstructorDecl_values;    // Declared in NameCheck.jrag at line 83 @SuppressWarnings({"unchecked", "cast"})     public boolean circularThisInvocation(ConstructorDecl decl) {        Object _parameters = decl;if(circularThisInvocation_ConstructorDecl_visited == null) circularThisInvocation_ConstructorDecl_visited = new java.util.HashMap(4);if(circularThisInvocation_ConstructorDecl_values == null) circularThisInvocation_ConstructorDecl_values = new java.util.HashMap(4);        if(circularThisInvocation_ConstructorDecl_values.containsKey(_parameters))            return ((Boolean)circularThisInvocation_ConstructorDecl_values.get(_parameters)).booleanValue();        if(new Integer(boundariesCrossed).equals(circularThisInvocation_ConstructorDecl_visited.get(_parameters)))            throw new RuntimeException("Circular definition of attr: circularThisInvocation in class: ");        circularThisInvocation_ConstructorDecl_visited.put(_parameters, new Integer(boundariesCrossed));        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        boolean circularThisInvocation_ConstructorDecl_value = circularThisInvocation_compute(decl);        if(isFinal && num == boundariesCrossed)            circularThisInvocation_ConstructorDecl_values.put(_parameters, Boolean.valueOf(circularThisInvocation_ConstructorDecl_value));        circularThisInvocation_ConstructorDecl_visited.remove(_parameters);        return circularThisInvocation_ConstructorDecl_value;    }    private boolean circularThisInvocation_compute(ConstructorDecl decl) {    if(hasConstructorInvocation()) {      Expr e = ((ExprStmt)getConstructorInvocation()).getExpr();      if(e instanceof ConstructorAccess) {        ConstructorDecl constructorDecl = ((ConstructorAccess)e).decl();        if(constructorDecl == decl)          return true;        return constructorDecl.circularThisInvocation(decl);      }    }    return false;  }    protected int type_visited = -1;    // Declared in TypeAnalysis.jrag at line 269 @SuppressWarnings({"unchecked", "cast"})     public TypeDecl type() {        if(type_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: type in class: ");        type_visited = boundariesCrossed;        TypeDecl type_value = type_compute();        type_visited = -1;        return type_value;    }    private TypeDecl type_compute() {  return unknownType();  }    protected int isVoid_visited = -1;    // Declared in TypeAnalysis.jrag at line 275 @SuppressWarnings({"unchecked", "cast"})     public boolean isVoid() {        if(isVoid_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: isVoid in class: ");        isVoid_visited = boundariesCrossed;        boolean isVoid_value = isVoid_compute();        isVoid_visited = -1;        return isVoid_value;    }    private boolean isVoid_compute() {  return true;  }    protected java.util.Map handlesException_TypeDecl_visited;    protected java.util.Map handlesException_TypeDecl_values;    // Declared in ExceptionHandling.jrag at line 36 @SuppressWarnings({"unchecked", "cast"})     public boolean handlesException(TypeDecl exceptionType) {        Object _parameters = exceptionType;if(handlesException_TypeDecl_visited == null) handlesException_TypeDecl_visited = new java.util.HashMap(4);if(handlesException_TypeDecl_values == null) handlesException_TypeDecl_values = new java.util.HashMap(4);        if(handlesException_TypeDecl_values.containsKey(_parameters))            return ((Boolean)handlesException_TypeDecl_values.get(_parameters)).booleanValue();        if(new Integer(boundariesCrossed).equals(handlesException_TypeDecl_visited.get(_parameters)))            throw new RuntimeException("Circular definition of attr: handlesException in class: ");        handlesException_TypeDecl_visited.put(_parameters, new Integer(boundariesCrossed));        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        boolean handlesException_TypeDecl_value = getParent().Define_boolean_handlesException(this, null, exceptionType);        if(isFinal && num == boundariesCrossed)            handlesException_TypeDecl_values.put(_parameters, Boolean.valueOf(handlesException_TypeDecl_value));        handlesException_TypeDecl_visited.remove(_parameters);        return handlesException_TypeDecl_value;    }    protected int unknownType_visited = -1;    // Declared in TypeAnalysis.jrag at line 268 @SuppressWarnings({"unchecked", "cast"})     public TypeDecl unknownType() {        if(unknownType_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: unknownType in class: ");        unknownType_visited = boundariesCrossed;        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        TypeDecl unknownType_value = getParent().Define_TypeDecl_unknownType(this, null);        unknownType_visited = -1;        return unknownType_value;    }    // Declared in VariableDeclaration.jrag at line 78    public boolean Define_boolean_isConstructorParameter(ASTNode caller, ASTNode child) {        if(caller == getParameterListNoTransform()) {      int childIndex = caller.getIndexOfChild(child);            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_isConstructorParameter(this, caller);    }    // Declared in Modifiers.jrag at line 282    public boolean Define_boolean_mayBePrivate(ASTNode caller, ASTNode child) {        if(caller == getModifiersNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_mayBePrivate(this, caller);    }    // Declared in LookupMethod.jrag at line 45    public Collection Define_Collection_lookupMethod(ASTNode caller, ASTNode child, String name) {        if(caller == getConstructorInvocationOptNoTransform()){    Collection c = new ArrayList();    for(Iterator iter = lookupMethod(name).iterator(); iter.hasNext(); ) {      MethodDecl m = (MethodDecl)iter.next();      if(!hostType().memberMethods(name).contains(m) || m.isStatic())        c.add(m);    }    return c;  }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_Collection_lookupMethod(this, caller, name);    }    // Declared in LookupVariable.jrag at line 64    public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) {        if(caller == getParameterListNoTransform()) {      int childIndex = caller.getIndexOfChild(child);            return parameterDeclaration(name);        }        if(caller == getConstructorInvocationOptNoTransform()){    SimpleSet set = parameterDeclaration(name);    if(!set.isEmpty()) return set;    for(Iterator iter = lookupVariable(name).iterator(); iter.hasNext(); ) {      Variable v = (Variable)iter.next();      if(!hostType().memberFields(name).contains(v) || v.isStatic())        set = set.add(v);    }    return set;  }        if(caller == getBlockNoTransform()){    SimpleSet set = parameterDeclaration(name);    if(!set.isEmpty()) return set;    return lookupVariable(name);  }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_SimpleSet_lookupVariable(this, caller, name);    }    // Declared in ExceptionHandling.jrag at line 133    public boolean Define_boolean_handlesException(ASTNode caller, ASTNode child, TypeDecl exceptionType) {        if(caller == getConstructorInvocationOptNoTransform()) {            return throwsException(exceptionType) || handlesException(exceptionType);        }        if(caller == getBlockNoTransform()) {            return throwsException(exceptionType) || handlesException(exceptionType);        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_handlesException(this, caller, exceptionType);    }    // Declared in UnreachableStatements.jrag at line 32    public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) {        if(caller == getBlockNoTransform()) {            return !hasConstructorInvocation() ? true : getConstructorInvocation().canCompleteNormally();        }        if(caller == getConstructorInvocationOptNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_reachable(this, caller);    }    // Declared in DefiniteAssignment.jrag at line 300    public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) {        if(caller == getBlockNoTransform()) {            return hasConstructorInvocation() ? getConstructorInvocation().isDAafter(v) : isDAbefore(v);        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_isDAbefore(this, caller, v);    }    // Declared in TypeHierarchyCheck.jrag at line 132    public boolean Define_boolean_inExplicitConstructorInvocation(ASTNode caller, ASTNode child) {        if(caller == getConstructorInvocationOptNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_inExplicitConstructorInvocation(this, caller);    }    // Declared in VariableDeclaration.jrag at line 77    public boolean Define_boolean_isMethodParameter(ASTNode caller, ASTNode child) {        if(caller == getParameterListNoTransform()) {      int childIndex = caller.getIndexOfChild(child);            return false;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_isMethodParameter(this, caller);    }    // Declared in Modifiers.jrag at line 280    public boolean Define_boolean_mayBePublic(ASTNode caller, ASTNode child) {        if(caller == getModifiersNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_mayBePublic(this, caller);    }    // Declared in Modifiers.jrag at line 281    public boolean Define_boolean_mayBeProtected(ASTNode caller, ASTNode child) {        if(caller == getModifiersNoTransform()) {            return true;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_mayBeProtected(this, caller);    }    // Declared in NameCheck.jrag at line 242    public ASTNode Define_ASTNode_enclosingBlock(ASTNode caller, ASTNode child) {        if(caller == getBlockNoTransform()) {            return this;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_ASTNode_enclosingBlock(this, caller);    }    // Declared in VariableDeclaration.jrag at line 79    public boolean Define_boolean_isExceptionHandlerParameter(ASTNode caller, ASTNode child) {        if(caller == getParameterListNoTransform()) {      int childIndex = caller.getIndexOfChild(child);            return false;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_isExceptionHandlerParameter(this, caller);    }    // Declared in SyntacticClassification.jrag at line 117    public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {        if(caller == getConstructorInvocationOptNoTransform()) {            return NameType.EXPRESSION_NAME;        }        if(caller == getExceptionListNoTransform()) {      int childIndex = caller.getIndexOfChild(child);            return NameType.TYPE_NAME;        }        if(caller == getParameterListNoTransform()) {      int childIndex = caller.getIndexOfChild(child);            return NameType.TYPE_NAME;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_NameType_nameType(this, caller);    }    // Declared in TypeCheck.jrag at line 517    public TypeDecl Define_TypeDecl_enclosingInstance(ASTNode caller, ASTNode child) {        if(caller == getConstructorInvocationOptNoTransform()) {            return unknownType();        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_TypeDecl_enclosingInstance(this, caller);    }    // Declared in TypeHierarchyCheck.jrag at line 144    public boolean Define_boolean_inStaticContext(ASTNode caller, ASTNode child) {        if(caller == getConstructorInvocationOptNoTransform()) {            return false;        }        if(caller == getBlockNoTransform()) {            return false;        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_inStaticContext(this, caller);    }    // Declared in DefiniteAssignment.jrag at line 756    public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) {        if(caller == getBlockNoTransform()) {            return hasConstructorInvocation() ? getConstructorInvocation().isDUafter(v) : isDUbefore(v);        }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        return getParent().Define_boolean_isDUbefore(this, caller, v);    }public ASTNode rewriteTo() {    // Declared in LookupConstructor.jrag at line 186    if(!hasConstructorInvocation() && !hostType().isObject()) {        duringLookupConstructor++;        ASTNode result = rewriteRule0();        duringLookupConstructor--;        return result;    }    return super.rewriteTo();}    // Declared in LookupConstructor.jrag at line 186    private ConstructorDecl rewriteRule0() {         debugRewrite("Rewriting " + getClass().getName() + " using rule in LookupConstructor.jrag at line 186");{      setConstructorInvocation(        new ExprStmt(          new SuperConstructorAccess("super", new List())          )        );      return this;    }    }}

⌨️ 快捷键说明

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