📄 switchstmt.java
字号:
if(!(!noDefaultLabel() || getExpr().isDAafter(v))) { return false; } if(!(!switchLabelEndsBlock() || getExpr().isDAafter(v))) { return false; } if(!assignedAfterLastStmt(v)) { return false; } for(Iterator iter = targetBreaks().iterator(); iter.hasNext(); ) { BreakStmt stmt = (BreakStmt)iter.next(); if(!stmt.isDAafterReachedFinallyBlocks(v)) return false; } return true; } // Declared in DefiniteAssignment.jrag at line 550 @SuppressWarnings({"unchecked", "cast"}) public boolean assignedAfterLastStmt(Variable v) { boolean assignedAfterLastStmt_Variable_value = assignedAfterLastStmt_compute(v); return assignedAfterLastStmt_Variable_value; } private boolean assignedAfterLastStmt_compute(Variable v) { return getBlock().isDAafter(v); } // Declared in DefiniteAssignment.jrag at line 1004 @SuppressWarnings({"unchecked", "cast"}) public boolean isDUafter(Variable v) { Object _parameters = v;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(); 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)); 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; } // Declared in DefiniteAssignment.jrag at line 1019 @SuppressWarnings({"unchecked", "cast"}) public boolean unassignedAfterLastStmt(Variable v) { boolean unassignedAfterLastStmt_Variable_value = unassignedAfterLastStmt_compute(v); return unassignedAfterLastStmt_Variable_value; } private boolean unassignedAfterLastStmt_compute(Variable v) { return getBlock().isDUafter(v); } // Declared in DefiniteAssignment.jrag at line 1022 @SuppressWarnings({"unchecked", "cast"}) public boolean switchLabelEndsBlock() { boolean switchLabelEndsBlock_value = switchLabelEndsBlock_compute(); return switchLabelEndsBlock_value; } private boolean switchLabelEndsBlock_compute() { return getBlock().getNumStmt() > 0 && getBlock().getStmt(getBlock().getNumStmt()-1) instanceof ConstCase; } // Declared in UnreachableStatements.jrag at line 60 @SuppressWarnings({"unchecked", "cast"}) public boolean lastStmtCanCompleteNormally() { boolean lastStmtCanCompleteNormally_value = lastStmtCanCompleteNormally_compute(); return lastStmtCanCompleteNormally_value; } private boolean lastStmtCanCompleteNormally_compute() { return getBlock().canCompleteNormally(); } // Declared in UnreachableStatements.jrag at line 62 @SuppressWarnings({"unchecked", "cast"}) public boolean noStmts() { boolean noStmts_value = noStmts_compute(); 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; } // Declared in UnreachableStatements.jrag at line 69 @SuppressWarnings({"unchecked", "cast"}) public boolean noStmtsAfterLastLabel() { boolean noStmtsAfterLastLabel_value = noStmtsAfterLastLabel_compute(); return noStmtsAfterLastLabel_value; } private boolean noStmtsAfterLastLabel_compute() { return getBlock().getNumStmt() > 0 && getBlock().getStmt(getBlock().getNumStmt()-1) instanceof Case; } // Declared in UnreachableStatements.jrag at line 72 @SuppressWarnings({"unchecked", "cast"}) public boolean noDefaultLabel() { boolean noDefaultLabel_value = noDefaultLabel_compute(); 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; } // Declared in UnreachableStatements.jrag at line 79 @SuppressWarnings({"unchecked", "cast"}) public boolean canCompleteNormally() { if(canCompleteNormally_computed) return canCompleteNormally_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); canCompleteNormally_value = canCompleteNormally_compute(); if(isFinal && num == boundariesCrossed) canCompleteNormally_computed = true; return canCompleteNormally_value; } private boolean canCompleteNormally_compute() { return lastStmtCanCompleteNormally() || noStmts() || noStmtsAfterLastLabel() || noDefaultLabel() || reachableBreak(); } protected boolean defaultCase_computed = false; protected DefaultCase defaultCase_value; // Declared in CreateBCode.jrag at line 1191 @SuppressWarnings({"unchecked", "cast"}) public DefaultCase defaultCase() { if(defaultCase_computed) return defaultCase_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); defaultCase_value = defaultCase_compute(); if(isFinal && num == boundariesCrossed) defaultCase_computed = true; return defaultCase_value; } private DefaultCase defaultCase_compute() { for(int i= 0; i < getBlock().getNumStmt(); i++) { if(getBlock().getStmt(i) instanceof DefaultCase) return (DefaultCase)getBlock().getStmt(i); } return null; } protected boolean end_label_computed = false; protected int end_label_value; // Declared in CreateBCode.jrag at line 1199 @SuppressWarnings({"unchecked", "cast"}) public int end_label() { if(end_label_computed) return end_label_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); end_label_value = end_label_compute(); if(isFinal && num == boundariesCrossed) end_label_computed = true; return end_label_value; } private int end_label_compute() { return hostType().constantPool().newLabel(); } // Declared in CreateBCode.jrag at line 1270 @SuppressWarnings({"unchecked", "cast"}) public int numCase() { int numCase_value = numCase_compute(); return numCase_value; } private int numCase_compute() { int result = 0; for(int i = 0; i < getBlock().getNumStmt(); i++) if(getBlock().getStmt(i) instanceof Case) result++; return result; } // Declared in CreateBCode.jrag at line 1385 @SuppressWarnings({"unchecked", "cast"}) public int break_label() { int break_label_value = break_label_compute(); return break_label_value; } private int break_label_compute() { return end_label(); } 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; int num = boundariesCrossed; boolean isFinal = this.is$Final(); typeInt_value = getParent().Define_TypeDecl_typeInt(this, null); if(isFinal && num == boundariesCrossed) typeInt_computed = true; return typeInt_value; } 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; int num = boundariesCrossed; boolean isFinal = this.is$Final(); typeLong_value = getParent().Define_TypeDecl_typeLong(this, null); if(isFinal && num == boundariesCrossed) typeLong_computed = true; 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; } 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(); } 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(); } 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(); } 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; } 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; } 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); } return getParent().Define_boolean_isDUbefore(this, caller, v); }public ASTNode rewriteTo() { return super.rewriteTo();}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -