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

📄 varaccess.java

📁 JDK1.4编译器前端
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
                isConstant_visited = CIRCLE_INDEX;                CHANGE = false;        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");                boolean new_isConstant_value = isConstant_compute();                if (new_isConstant_value!=isConstant_value)                    CHANGE = true;                isConstant_value = new_isConstant_value;                 CIRCLE_INDEX++;if(CIRCLE_INDEX > 100) throw new java.lang.RuntimeException("Iteration limit 100 exceeded");            } while (CHANGE);            if(isFinal && num == boundariesCrossed){            isConstant_computed = true;            LAST_CYCLE = true;        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");            isConstant_compute();            LAST_CYCLE = false;            }            else {            RESET_CYCLE = true;        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");            isConstant_compute();            RESET_CYCLE = false;              isConstant_computed = false;              isConstant_initialized = false;            }            IN_CIRCLE = false;             return isConstant_value;        }        if(isConstant_visited != CIRCLE_INDEX) {            isConstant_visited = CIRCLE_INDEX;            if (LAST_CYCLE) {                isConstant_computed = true;        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");                return isConstant_compute();            }            if (RESET_CYCLE) {                isConstant_computed = false;                isConstant_initialized = false;                return isConstant_value;            }        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");            boolean new_isConstant_value = isConstant_compute();            if (new_isConstant_value!=isConstant_value)                CHANGE = true;            isConstant_value = new_isConstant_value;             return isConstant_value;        }        return isConstant_value;    }    private boolean isConstant_compute() {    Variable v = decl();    if(v instanceof FieldDeclaration) {      FieldDeclaration f = (FieldDeclaration)v;      return f.isConstant() && (!isQualified() || (isQualified() && qualifier().isTypeAccess()));    }    boolean result = v.isFinal() && v.hasInit() && v.getInit().isConstant() && (v.type().isPrimitive() || v.type().isString());    return result && (!isQualified() || (isQualified() && qualifier().isTypeAccess()));  }    protected int varDecl_visited = -1;    // Declared in DefiniteAssignment.jrag at line 60 @SuppressWarnings({"unchecked", "cast"})     public Variable varDecl() {        if(varDecl_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: varDecl in class: ");        varDecl_visited = boundariesCrossed;        Variable varDecl_value = varDecl_compute();        varDecl_visited = -1;        return varDecl_value;    }    private Variable varDecl_compute() {  return decl();  }    protected java.util.Map isDAafter_Variable_visited;    protected java.util.Map isDAafter_Variable_values;    // Declared in DefiniteAssignment.jrag at line 353 @SuppressWarnings({"unchecked", "cast"})     public boolean isDAafter(Variable v) {        Object _parameters = v;if(isDAafter_Variable_visited == null) isDAafter_Variable_visited = new java.util.HashMap(4);if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4);        if(isDAafter_Variable_values.containsKey(_parameters))            return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue();        if(new Integer(boundariesCrossed).equals(isDAafter_Variable_visited.get(_parameters)))            throw new RuntimeException("Circular definition of attr: isDAafter in class: ");        isDAafter_Variable_visited.put(_parameters, new Integer(boundariesCrossed));        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        boolean isDAafter_Variable_value = isDAafter_compute(v);        if(isFinal && num == boundariesCrossed)            isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value));        isDAafter_Variable_visited.remove(_parameters);        return isDAafter_Variable_value;    }    private boolean isDAafter_compute(Variable v) {    return (isDest() && decl() == v) || isDAbefore(v);  }    protected java.util.Map isDUafter_Variable_visited;    // Declared in DefiniteAssignment.jrag at line 833 @SuppressWarnings({"unchecked", "cast"})     public boolean isDUafter(Variable v) {        Object _parameters = v;if(isDUafter_Variable_visited == null) isDUafter_Variable_visited = new java.util.HashMap(4);        if(new Integer(boundariesCrossed).equals(isDUafter_Variable_visited.get(_parameters)))            throw new RuntimeException("Circular definition of attr: isDUafter in class: ");        isDUafter_Variable_visited.put(_parameters, new Integer(boundariesCrossed));        boolean isDUafter_Variable_value = isDUafter_compute(v);        isDUafter_Variable_visited.remove(_parameters);        return isDUafter_Variable_value;    }    private boolean isDUafter_compute(Variable v) {    if(isDest() && decl() == v)      return false;    return isDUbefore(v);  }    protected java.util.Map unassignedEverywhere_Variable_TryStmt_visited;    // Declared in DefiniteAssignment.jrag at line 1208 @SuppressWarnings({"unchecked", "cast"})     public boolean unassignedEverywhere(Variable v, TryStmt stmt) {        java.util.List _parameters = new java.util.ArrayList(2);        _parameters.add(v);        _parameters.add(stmt);if(unassignedEverywhere_Variable_TryStmt_visited == null) unassignedEverywhere_Variable_TryStmt_visited = new java.util.HashMap(4);        if(new Integer(boundariesCrossed).equals(unassignedEverywhere_Variable_TryStmt_visited.get(_parameters)))            throw new RuntimeException("Circular definition of attr: unassignedEverywhere in class: ");        unassignedEverywhere_Variable_TryStmt_visited.put(_parameters, new Integer(boundariesCrossed));        boolean unassignedEverywhere_Variable_TryStmt_value = unassignedEverywhere_compute(v, stmt);        unassignedEverywhere_Variable_TryStmt_visited.remove(_parameters);        return unassignedEverywhere_Variable_TryStmt_value;    }    private boolean unassignedEverywhere_compute(Variable v, TryStmt stmt) {    if(isDest() && decl() == v && enclosingStmt().reachable()) {      return false;    }    return super.unassignedEverywhere(v, stmt);  }    protected int decls_visited = -1;    protected boolean decls_computed = false;    protected SimpleSet decls_value;    // Declared in LookupVariable.jrag at line 230 @SuppressWarnings({"unchecked", "cast"})     public SimpleSet decls() {        if(decls_computed)            return decls_value;        if(decls_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: decls in class: ");        decls_visited = boundariesCrossed;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        decls_value = decls_compute();        if(isFinal && num == boundariesCrossed)            decls_computed = true;        decls_visited = -1;        return decls_value;    }    private SimpleSet decls_compute() {    SimpleSet set = lookupVariable(name());    if(set.size() == 1) {      Variable v = (Variable)set.iterator().next();      if(!isQualified() && inStaticContext()) {        if(v.isInstanceVariable() && !hostType().memberFields(v.name()).isEmpty())          return SimpleSet.emptySet;      }      else if(isQualified() && qualifier().staticContextQualifier()) {        if(v.isInstanceVariable())          return SimpleSet.emptySet;      }    }    return set;  }    protected int decl_visited = -1;    protected boolean decl_computed = false;    protected Variable decl_value;    // Declared in LookupVariable.jrag at line 245 @SuppressWarnings({"unchecked", "cast"})     public Variable decl() {        if(decl_computed)            return decl_value;        if(decl_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: decl in class: ");        decl_visited = boundariesCrossed;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        decl_value = decl_compute();        if(isFinal && num == boundariesCrossed)            decl_computed = true;        decl_visited = -1;        return decl_value;    }    private Variable decl_compute() {    SimpleSet decls = decls();    if(decls.size() == 1)      return (Variable)decls.iterator().next();    return unknownField();  }    protected int inSameInitializer_visited = -1;    // Declared in NameCheck.jrag at line 221 @SuppressWarnings({"unchecked", "cast"})     public boolean inSameInitializer() {        if(inSameInitializer_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: inSameInitializer in class: ");        inSameInitializer_visited = boundariesCrossed;        boolean inSameInitializer_value = inSameInitializer_compute();        inSameInitializer_visited = -1;        return inSameInitializer_value;    }    private boolean inSameInitializer_compute() {    BodyDecl b = closestBodyDecl(decl().hostType());    if(b == null) return false;    if(b instanceof FieldDeclaration && ((FieldDeclaration)b).isStatic() == decl().isStatic())      return true;    if(b instanceof InstanceInitializer && !decl().isStatic())      return true;    if(b instanceof StaticInitializer && decl().isStatic())      return true;    return false;  }    protected int simpleAssignment_visited = -1;    // Declared in NameCheck.jrag at line 233 @SuppressWarnings({"unchecked", "cast"})     public boolean simpleAssignment() {        if(simpleAssignment_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: simpleAssignment in class: ");        simpleAssignment_visited = boundariesCrossed;        boolean simpleAssignment_value = simpleAssignment_compute();        simpleAssignment_visited = -1;        return simpleAssignment_value;    }    private boolean simpleAssignment_compute() {  return isDest() && getParent() instanceof AssignSimpleExpr;  }    protected int inDeclaringClass_visited = -1;    // Declared in NameCheck.jrag at line 235 @SuppressWarnings({"unchecked", "cast"})     public boolean inDeclaringClass() {        if(inDeclaringClass_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: inDeclaringClass in class: ");        inDeclaringClass_visited = boundariesCrossed;        boolean inDeclaringClass_value = inDeclaringClass_compute();        inDeclaringClass_visited = -1;        return inDeclaringClass_value;    }    private boolean inDeclaringClass_compute() {  return hostType() == decl().hostType();  }    protected int dumpString_visited = -1;    // Declared in PrettyPrint.jadd at line 781 @SuppressWarnings({"unchecked", "cast"})     public String dumpString() {        if(dumpString_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: dumpString in class: ");        dumpString_visited = boundariesCrossed;        String dumpString_value = dumpString_compute();        dumpString_visited = -1;        return dumpString_value;    }    private String dumpString_compute() {  return getClass().getName() + " [" + getID() + "]";  }    protected int name_visited = -1;    // Declared in QualifiedNames.jrag at line 17 @SuppressWarnings({"unchecked", "cast"})     public String name() {        if(name_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: name in class: ");        name_visited = boundariesCrossed;        String name_value = name_compute();        name_visited = -1;        return name_value;    }    private String name_compute() {  return getID();  }    protected int isFieldAccess_visited = -1;    protected boolean isFieldAccess_computed = false;    protected boolean isFieldAccess_value;    // Declared in ResolveAmbiguousNames.jrag at line 23 @SuppressWarnings({"unchecked", "cast"})     public boolean isFieldAccess() {        if(isFieldAccess_computed)            return isFieldAccess_value;        if(isFieldAccess_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: isFieldAccess in class: ");        isFieldAccess_visited = boundariesCrossed;        int num = boundariesCrossed;        boolean isFinal = this.is$Final();        isFieldAccess_value = isFieldAccess_compute();        if(isFinal && num == boundariesCrossed)            isFieldAccess_computed = true;        isFieldAccess_visited = -1;        return isFieldAccess_value;    }    private boolean isFieldAccess_compute() {  return decl().isClassVariable() || decl().isInstanceVariable();  }    protected int predNameType_visited = -1;    // Declared in SyntacticClassification.jrag at line 111 @SuppressWarnings({"unchecked", "cast"})     public NameType predNameType() {        if(predNameType_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: predNameType in class: ");        predNameType_visited = boundariesCrossed;        NameType predNameType_value = predNameType_compute();        predNameType_visited = -1;        return predNameType_value;    }    private NameType predNameType_compute() {  return NameType.AMBIGUOUS_NAME;  }    protected int type_visited = -1;    // Declared in TypeAnalysis.jrag at line 284 @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 decl().type();  }    protected int isVariable_visited = -1;    // Declared in TypeCheck.jrag at line 17 @SuppressWarnings({"unchecked", "cast"})     public boolean isVariable() {        if(isVariable_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: isVariable in class: ");        isVariable_visited = boundariesCrossed;        boolean isVariable_value = isVariable_compute();        isVariable_visited = -1;        return isVariable_value;    }    private boolean isVariable_compute() {  return true;  }    protected int inExplicitConstructorInvocation_visited = -1;    // Declared in TypeHierarchyCheck.jrag at line 122 @SuppressWarnings({"unchecked", "cast"})     public boolean inExplicitConstructorInvocation() {        if(inExplicitConstructorInvocation_visited == boundariesCrossed)            throw new RuntimeException("Circular definition of attr: inExplicitConstructorInvocation in class: ");        inExplicitConstructorInvocation_visited = boundariesCrossed;        if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree");        boolean inExplicitConstructorInvocation_value = getParent().Define_boolean_inExplicitConstructorInvocation(this, null);        inExplicitConstructorInvocation_visited = -1;        return inExplicitConstructorInvocation_value;    }public ASTNode rewriteTo() {    return super.rewriteTo();}}

⌨️ 快捷键说明

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