📄 switchstmt.java
字号:
} private boolean assignedAfterLastStmt_compute(Variable v) { return getBlock().isDAafter(v); } protected java.util.Map isDUafter_Variable_visited; // Declared in DefiniteAssignment.jrag at line 1004 @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(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4); if(isDUafter_Variable_values.containsKey(_parameters)) return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue(); 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)); int num = boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDUafter_Variable_value = isDUafter_compute(v); if(isFinal && num == boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value)); isDUafter_Variable_visited.remove(_parameters); return isDUafter_Variable_value; } private boolean isDUafter_compute(Variable v) { if(!(!noDefaultLabel() || getExpr().isDUafter(v))) return false; if(!(!switchLabelEndsBlock() || getExpr().isDUafter(v))) return false; if(!unassignedAfterLastStmt(v)) return false; for(Iterator iter = targetBreaks().iterator(); iter.hasNext(); ) { BreakStmt stmt = (BreakStmt)iter.next(); if(!stmt.isDUafterReachedFinallyBlocks(v)) return false; } return true; } protected java.util.Map unassignedAfterLastStmt_Variable_visited; // Declared in DefiniteAssignment.jrag at line 1019 @SuppressWarnings({"unchecked", "cast"}) public boolean unassignedAfterLastStmt(Variable v) { Object _parameters = v;if(unassignedAfterLastStmt_Variable_visited == null) unassignedAfterLastStmt_Variable_visited = new java.util.HashMap(4); if(new Integer(boundariesCrossed).equals(unassignedAfterLastStmt_Variable_visited.get(_parameters))) throw new RuntimeException("Circular definition of attr: unassignedAfterLastStmt in class: "); unassignedAfterLastStmt_Variable_visited.put(_parameters, new Integer(boundariesCrossed)); boolean unassignedAfterLastStmt_Variable_value = unassignedAfterLastStmt_compute(v); unassignedAfterLastStmt_Variable_visited.remove(_parameters); return unassignedAfterLastStmt_Variable_value; } private boolean unassignedAfterLastStmt_compute(Variable v) { return getBlock().isDUafter(v); } protected int switchLabelEndsBlock_visited = -1; // Declared in DefiniteAssignment.jrag at line 1022 @SuppressWarnings({"unchecked", "cast"}) public boolean switchLabelEndsBlock() { if(switchLabelEndsBlock_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: switchLabelEndsBlock in class: "); switchLabelEndsBlock_visited = boundariesCrossed; boolean switchLabelEndsBlock_value = switchLabelEndsBlock_compute(); switchLabelEndsBlock_visited = -1; return switchLabelEndsBlock_value; } private boolean switchLabelEndsBlock_compute() { return getBlock().getNumStmt() > 0 && getBlock().getStmt(getBlock().getNumStmt()-1) instanceof ConstCase; } protected int lastStmtCanCompleteNormally_visited = -1; // Declared in UnreachableStatements.jrag at line 60 @SuppressWarnings({"unchecked", "cast"}) public boolean lastStmtCanCompleteNormally() { if(lastStmtCanCompleteNormally_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: lastStmtCanCompleteNormally in class: "); lastStmtCanCompleteNormally_visited = boundariesCrossed; boolean lastStmtCanCompleteNormally_value = lastStmtCanCompleteNormally_compute(); lastStmtCanCompleteNormally_visited = -1; return lastStmtCanCompleteNormally_value; } private boolean lastStmtCanCompleteNormally_compute() { return getBlock().canCompleteNormally(); } protected int noStmts_visited = -1; // Declared in UnreachableStatements.jrag at line 62 @SuppressWarnings({"unchecked", "cast"}) public boolean noStmts() { if(noStmts_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: noStmts in class: "); noStmts_visited = boundariesCrossed; boolean noStmts_value = noStmts_compute(); noStmts_visited = -1; return noStmts_value; } private boolean noStmts_compute() { for(int i = 0; i < getBlock().getNumStmt(); i++) if(!(getBlock().getStmt(i) instanceof Case)) return false; return true; } protected int noStmtsAfterLastLabel_visited = -1; // Declared in UnreachableStatements.jrag at line 69 @SuppressWarnings({"unchecked", "cast"}) public boolean noStmtsAfterLastLabel() { if(noStmtsAfterLastLabel_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: noStmtsAfterLastLabel in class: "); noStmtsAfterLastLabel_visited = boundariesCrossed; boolean noStmtsAfterLastLabel_value = noStmtsAfterLastLabel_compute(); noStmtsAfterLastLabel_visited = -1; return noStmtsAfterLastLabel_value; } private boolean noStmtsAfterLastLabel_compute() { return getBlock().getNumStmt() > 0 && getBlock().getStmt(getBlock().getNumStmt()-1) instanceof Case; } protected int noDefaultLabel_visited = -1; // Declared in UnreachableStatements.jrag at line 72 @SuppressWarnings({"unchecked", "cast"}) public boolean noDefaultLabel() { if(noDefaultLabel_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: noDefaultLabel in class: "); noDefaultLabel_visited = boundariesCrossed; boolean noDefaultLabel_value = noDefaultLabel_compute(); noDefaultLabel_visited = -1; return noDefaultLabel_value; } private boolean noDefaultLabel_compute() { for(int i = 0; i < getBlock().getNumStmt(); i++) if(getBlock().getStmt(i) instanceof DefaultCase) return false; return true; } protected int canCompleteNormally_visited = -1; // Declared in UnreachableStatements.jrag at line 79 @SuppressWarnings({"unchecked", "cast"}) public boolean canCompleteNormally() { if(canCompleteNormally_computed) return canCompleteNormally_value; if(canCompleteNormally_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: canCompleteNormally in class: "); canCompleteNormally_visited = boundariesCrossed; int num = boundariesCrossed; boolean isFinal = this.is$Final(); canCompleteNormally_value = canCompleteNormally_compute(); if(isFinal && num == boundariesCrossed) canCompleteNormally_computed = true; canCompleteNormally_visited = -1; return canCompleteNormally_value; } private boolean canCompleteNormally_compute() { return lastStmtCanCompleteNormally() || noStmts() || noStmtsAfterLastLabel() || noDefaultLabel() || reachableBreak(); } protected int typeInt_visited = -1; protected boolean typeInt_computed = false; protected TypeDecl typeInt_value; // Declared in LookupType.jrag at line 61 @SuppressWarnings({"unchecked", "cast"}) public TypeDecl typeInt() { if(typeInt_computed) return typeInt_value; if(typeInt_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: typeInt in class: "); typeInt_visited = 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"); typeInt_value = getParent().Define_TypeDecl_typeInt(this, null); if(isFinal && num == boundariesCrossed) typeInt_computed = true; typeInt_visited = -1; return typeInt_value; } protected int typeLong_visited = -1; protected boolean typeLong_computed = false; protected TypeDecl typeLong_value; // Declared in LookupType.jrag at line 63 @SuppressWarnings({"unchecked", "cast"}) public TypeDecl typeLong() { if(typeLong_computed) return typeLong_value; if(typeLong_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: typeLong in class: "); typeLong_visited = 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"); typeLong_value = getParent().Define_TypeDecl_typeLong(this, null); if(isFinal && num == boundariesCrossed) typeLong_computed = true; typeLong_visited = -1; return typeLong_value; } // Declared in NameCheck.jrag at line 413 public Case Define_Case_bind(ASTNode caller, ASTNode child, Case c) { if(caller == getBlockNoTransform()){ Block b = getBlock(); for(int i = 0; i < b.getNumStmt(); i++) if(b.getStmt(i) instanceof Case && ((Case)b.getStmt(i)).constValue(c)) return (Case)b.getStmt(i); return null; } if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree"); return getParent().Define_Case_bind(this, caller, c); } // Declared in UnreachableStatements.jrag at line 156 public boolean Define_boolean_reportUnreachable(ASTNode caller, ASTNode child) { if(caller == getBlockNoTransform()) { return reachable(); } if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree"); return getParent().Define_boolean_reportUnreachable(this, caller); } // Declared in UnreachableStatements.jrag at line 82 public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) { if(caller == getBlockNoTransform()) { return reachable(); } 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 TypeCheck.jrag at line 359 public TypeDecl Define_TypeDecl_switchType(ASTNode caller, ASTNode child) { if(caller == getBlockNoTransform()) { return getExpr().type(); } if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree"); return getParent().Define_TypeDecl_switchType(this, caller); } // Declared in DefiniteAssignment.jrag at line 569 public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getBlockNoTransform()) { return getExpr().isDAafter(v); } if(caller == getExprNoTransform()){ if(((ASTNode)v).isDescendantTo(this)) return false; boolean result = isDAbefore(v); return result; } 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 NameCheck.jrag at line 372 public boolean Define_boolean_insideSwitch(ASTNode caller, ASTNode child) { if(caller == getBlockNoTransform()) { return true; } if(getParent() == null) throw new RuntimeException("Trying to evaluate attribute in subtree not attached to main tree"); return getParent().Define_boolean_insideSwitch(this, caller); } // Declared in DefiniteAssignment.jrag at line 1027 public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getBlockNoTransform()) { return getExpr().isDUafter(v); } if(caller == getExprNoTransform()) { return 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() { return super.rewriteTo();}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -