📄 program.java
字号:
@SuppressWarnings({"unchecked", "cast"}) public TypeDecl lookupType(String packageName, String typeName) { java.util.List _parameters = new java.util.ArrayList(2); _parameters.add(packageName); _parameters.add(typeName);if(lookupType_String_String_values == null) lookupType_String_String_values = new java.util.HashMap(4); if(lookupType_String_String_values.containsKey(_parameters)) return (TypeDecl)lookupType_String_String_values.get(_parameters); int num = boundariesCrossed; boolean isFinal = this.is$Final(); TypeDecl lookupType_String_String_value = lookupType_compute(packageName, typeName); if(isFinal && num == boundariesCrossed) lookupType_String_String_values.put(_parameters, lookupType_String_String_value); return lookupType_String_String_value; } private TypeDecl lookupType_compute(String packageName, String typeName) { addPrimitiveTypes(); String fullName = packageName.equals("") ? typeName : packageName + "." + typeName; for(int i = 0; i < getNumCompilationUnit(); i++) { for(int j = 0; j < getCompilationUnit(i).getNumTypeDecl(); j++) { TypeDecl type = getCompilationUnit(i).getTypeDecl(j); if(type.fullName().equals(fullName)) { return type; } } } CompilationUnit u = getCompilationUnit(fullName); if(u != null) { addCompilationUnit(u); getCompilationUnit(getNumCompilationUnit()-1); for(int j = 0; j < u.getNumTypeDecl(); j++) { if(u.getTypeDecl(j).name().equals(typeName)) { return u.getTypeDecl(j); } } throw new Error("No type named " + typeName + " in file " + fullName + ", " + u.pathName() + ", " + u.relativeName()); } return null; } protected boolean unknownConstructor_computed = false; protected ConstructorDecl unknownConstructor_value; // Declared in TypeAnalysis.jrag at line 246 @SuppressWarnings({"unchecked", "cast"}) public ConstructorDecl unknownConstructor() { if(unknownConstructor_computed) return unknownConstructor_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); unknownConstructor_value = unknownConstructor_compute(); if(isFinal && num == boundariesCrossed) unknownConstructor_computed = true; return unknownConstructor_value; } private ConstructorDecl unknownConstructor_compute() { return (ConstructorDecl)unknownType().constructors().iterator().next(); } // Declared in Modifiers.jrag at line 290 public boolean Define_boolean_mayBePrivate(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return false; } return getParent().Define_boolean_mayBePrivate(this, caller); } // Declared in LookupType.jrag at line 47 public TypeDecl Define_TypeDecl_unknownType(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return unknownType(); } return getParent().Define_TypeDecl_unknownType(this, caller); } // Declared in LookupType.jrag at line 20 public TypeDecl Define_TypeDecl_typeSerializable(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return typeSerializable(); } return getParent().Define_TypeDecl_typeSerializable(this, caller); } // Declared in ExceptionHandling.jrag at line 114 public boolean Define_boolean_handlesException(ASTNode caller, ASTNode child, TypeDecl exceptionType) { if(true) { int childIndex = this.getIndexOfChild(caller);{ throw new Error("Operation handlesException not supported"); }} return getParent().Define_boolean_handlesException(this, caller, exceptionType); } // Declared in ExceptionHandling.jrag at line 19 public TypeDecl Define_TypeDecl_typeNullPointerException(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return lookupType("java.lang", "NullPointerException"); } return getParent().Define_TypeDecl_typeNullPointerException(this, caller); } // Declared in LookupConstructor.jrag at line 15 public Collection Define_Collection_lookupConstructor(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return Collections.EMPTY_LIST; } return getParent().Define_Collection_lookupConstructor(this, caller); } // Declared in Modifiers.jrag at line 292 public boolean Define_boolean_mayBeFinal(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return false; } return getParent().Define_boolean_mayBeFinal(this, caller); } // Declared in ExceptionHandling.jrag at line 21 public TypeDecl Define_TypeDecl_typeThrowable(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return lookupType("java.lang", "Throwable"); } return getParent().Define_TypeDecl_typeThrowable(this, caller); } // Declared in InnerClasses.jrag at line 62 public TypeDecl Define_TypeDecl_expectedType(ASTNode caller, ASTNode child) { if(caller == getCompilationUnitListNoTransform()) { int i = caller.getIndexOfChild(child); return null; } return getParent().Define_TypeDecl_expectedType(this, caller); } // Declared in NameCheck.jrag at line 363 public boolean Define_boolean_insideLoop(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return false; } return getParent().Define_boolean_insideLoop(this, caller); } // Declared in BranchTarget.jrag at line 173 public LabeledStmt Define_LabeledStmt_lookupLabel(ASTNode caller, ASTNode child, String name) { if(true) { int childIndex = this.getIndexOfChild(caller); return null; } return getParent().Define_LabeledStmt_lookupLabel(this, caller, name); } // Declared in Modifiers.jrag at line 288 public boolean Define_boolean_mayBePublic(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return false; } return getParent().Define_boolean_mayBePublic(this, caller); } // Declared in LookupConstructor.jrag at line 24 public Collection Define_Collection_lookupSuperConstructor(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return Collections.EMPTY_LIST; } return getParent().Define_Collection_lookupSuperConstructor(this, caller); } // Declared in LookupType.jrag at line 36 public TypeDecl Define_TypeDecl_typeLong(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return typeLong(); } return getParent().Define_TypeDecl_typeLong(this, caller); } // Declared in ExceptionHandling.jrag at line 15 public TypeDecl Define_TypeDecl_typeRuntimeException(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return lookupType("java.lang", "RuntimeException"); } return getParent().Define_TypeDecl_typeRuntimeException(this, caller); } // Declared in ExceptionHandling.jrag at line 17 public TypeDecl Define_TypeDecl_typeError(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return lookupType("java.lang", "Error"); } return getParent().Define_TypeDecl_typeError(this, caller); } // Declared in Modifiers.jrag at line 289 public boolean Define_boolean_mayBeProtected(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return false; } return getParent().Define_boolean_mayBeProtected(this, caller); } // Declared in Modifiers.jrag at line 295 public boolean Define_boolean_mayBeTransient(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return false; } return getParent().Define_boolean_mayBeTransient(this, caller); } // Declared in TypeAnalysis.jrag at line 533 public boolean Define_boolean_isMemberType(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return false; } return getParent().Define_boolean_isMemberType(this, caller); } // Declared in Modifiers.jrag at line 298 public boolean Define_boolean_mayBeNative(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return false; } return getParent().Define_boolean_mayBeNative(this, caller); } // Declared in TypeAnalysis.jrag at line 238 public MethodDecl Define_MethodDecl_unknownMethod(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller);{ for(Iterator iter = unknownType().memberMethods("unknown").iterator(); iter.hasNext(); ) { MethodDecl m = (MethodDecl)iter.next(); return m; } throw new Error("Could not find method unknown in type Unknown"); }} return getParent().Define_MethodDecl_unknownMethod(this, caller); } // Declared in LookupType.jrag at line 31 public TypeDecl Define_TypeDecl_typeBoolean(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return typeBoolean(); } return getParent().Define_TypeDecl_typeBoolean(this, caller); } // Declared in Arrays.jrag at line 19 public TypeDecl Define_TypeDecl_componentType(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return unknownType(); } return getParent().Define_TypeDecl_componentType(this, caller); } // Declared in SyntacticClassification.jrag at line 64 public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return NameType.NO_NAME; } return getParent().Define_NameType_nameType(this, caller); } // Declared in LookupType.jrag at line 44 public TypeDecl Define_TypeDecl_typeNull(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return typeNull(); } return getParent().Define_TypeDecl_typeNull(this, caller); } // Declared in TypeHierarchyCheck.jrag at line 137 public boolean Define_boolean_inStaticContext(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return false; } return getParent().Define_boolean_inStaticContext(this, caller); } // Declared in DefiniteAssignment.jrag at line 711 public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) { if(true) { int childIndex = this.getIndexOfChild(caller); return true; } return getParent().Define_boolean_isDUbefore(this, caller, v); } // Declared in LookupType.jrag at line 39 public TypeDecl Define_TypeDecl_typeString(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return typeString(); } return getParent().Define_TypeDecl_typeString(this, caller); } // Declared in TypeAnalysis.jrag at line 234 public Variable Define_Variable_unknownField(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return unknownType().findSingleVariable("unknown"); } return getParent().Define_Variable_unknownField(this, caller); } // Declared in LookupType.jrag at line 35 public TypeDecl Define_TypeDecl_typeInt(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return typeInt(); } return getParent().Define_TypeDecl_typeInt(this, caller); } // Declared in Modifiers.jrag at line 296 public boolean Define_boolean_mayBeStrictfp(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return false; } return getParent().Define_boolean_mayBeStrictfp(this, caller); } // Declared in TypeCheck.jrag at line 360 public TypeDecl Define_TypeDecl_switchType(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return unknownType(); } return getParent().Define_TypeDecl_switchType(this, caller); } // Declared in LookupType.jrag at line 18 public TypeDecl Define_TypeDecl_typeObject(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return typeObject(); } return getParent().Define_TypeDecl_typeObject(this, caller); } // Declared in DefiniteAssignment.jrag at line 326 public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { if(true) { int childIndex = this.getIndexOfChild(caller); return true; } return getParent().Define_boolean_isDAbefore(this, caller, v); } // Declared in NameCheck.jrag at line 370 public boolean Define_boolean_insideSwitch(ASTNode caller, ASTNode child) { if(true) { int childIndex = this.getIndexOfChild(caller); return false; } return getParent().Define_boolean_insideSwitch(this, caller);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -