📄 methoddecl.java
字号:
b.append(type().typeDescriptor()); return b.toString(); } protected java.util.Map bytecodes_ConstantPool_values; // Declared in CreateBCode.jrag at line 60 @SuppressWarnings({"unchecked", "cast"}) public CodeGeneration bytecodes(ConstantPool constantPool) { Object _parameters = constantPool;if(bytecodes_ConstantPool_values == null) bytecodes_ConstantPool_values = new java.util.HashMap(4); if(bytecodes_ConstantPool_values.containsKey(_parameters)) return (CodeGeneration)bytecodes_ConstantPool_values.get(_parameters); int num = boundariesCrossed; boolean isFinal = this.is$Final(); CodeGeneration bytecodes_ConstantPool_value = bytecodes_compute(constantPool); if(isFinal && num == boundariesCrossed) bytecodes_ConstantPool_values.put(_parameters, bytecodes_ConstantPool_value); return bytecodes_ConstantPool_value; } private CodeGeneration bytecodes_compute(ConstantPool constantPool) { //if(Program.verbose()) // System.out.println("Generating bytecodes for " + signature() + " in " + hostType().fullName()); CodeGeneration gen = new CodeGeneration(constantPool); generateBytecodes(gen); if(!gen.numberFormatError()) return gen; gen = new CodeGeneration(constantPool, true); generateBytecodes(gen); if(!gen.numberFormatError()) return gen; throw new Error("Could not generate code for " + signature() + " in " + hostType().typeName()); } protected boolean flags_computed = false; protected int flags_value; // Declared in Flags.jrag at line 40 @SuppressWarnings({"unchecked", "cast"}) public int flags() { if(flags_computed) return flags_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); flags_value = flags_compute(); if(isFinal && num == boundariesCrossed) flags_computed = true; return flags_value; } private int flags_compute() { int res = 0; if(isPublic()) res |= Modifiers.ACC_PUBLIC; if(isPrivate()) res |= Modifiers.ACC_PRIVATE; if(isProtected()) res |= Modifiers.ACC_PROTECTED; if(isStatic()) res |= Modifiers.ACC_STATIC; if(isFinal()) res |= Modifiers.ACC_FINAL; if(isSynchronized()) res |= Modifiers.ACC_SYNCHRONIZED; if(isNative()) res |= Modifiers.ACC_NATIVE; if(isAbstract()) res |= Modifiers.ACC_ABSTRACT; if(isStrictfp() || (hostType().isStrictfp() && !hostType().isInterfaceDecl())) res |= Modifiers.ACC_STRICT; return res; } // Declared in GenerateClassfile.jrag at line 297 @SuppressWarnings({"unchecked", "cast"}) public boolean isBytecodeMethod() { boolean isBytecodeMethod_value = isBytecodeMethod_compute(); return isBytecodeMethod_value; } private boolean isBytecodeMethod_compute() { return true; } // Declared in GenerateClassfile.jrag at line 331 @SuppressWarnings({"unchecked", "cast"}) public boolean flush() { boolean flush_value = flush_compute(); return flush_value; } private boolean flush_compute() { return false; } protected boolean offsetBeforeParameters_computed = false; protected int offsetBeforeParameters_value; // Declared in LocalNum.jrag at line 17 @SuppressWarnings({"unchecked", "cast"}) public int offsetBeforeParameters() { if(offsetBeforeParameters_computed) return offsetBeforeParameters_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); offsetBeforeParameters_value = offsetBeforeParameters_compute(); if(isFinal && num == boundariesCrossed) offsetBeforeParameters_computed = true; return offsetBeforeParameters_value; } private int offsetBeforeParameters_compute() { return isStatic() ? 0 : 1; } protected boolean offsetAfterParameters_computed = false; protected int offsetAfterParameters_value; // Declared in LocalNum.jrag at line 19 @SuppressWarnings({"unchecked", "cast"}) public int offsetAfterParameters() { if(offsetAfterParameters_computed) return offsetAfterParameters_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); offsetAfterParameters_value = offsetAfterParameters_compute(); if(isFinal && num == boundariesCrossed) offsetAfterParameters_computed = true; return offsetAfterParameters_value; } private int offsetAfterParameters_compute() { if(getNumParameter() == 0) return offsetBeforeParameters(); return getParameter(getNumParameter()-1).localNum() + getParameter(getNumParameter()-1).type().variableSize(); } protected boolean resultOffset_computed = false; protected int resultOffset_value; // Declared in LocalNum.jrag at line 50 @SuppressWarnings({"unchecked", "cast"}) public int resultOffset() { if(resultOffset_computed) return resultOffset_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); resultOffset_value = resultOffset_compute(); if(isFinal && num == boundariesCrossed) resultOffset_computed = true; return resultOffset_value; } private int resultOffset_compute() { return type().isVoid() ? 0 : type().variableSize(); } protected java.util.Map handlesException_TypeDecl_values; // Declared in ExceptionHandling.jrag at line 37 @SuppressWarnings({"unchecked", "cast"}) public boolean handlesException(TypeDecl exceptionType) { Object _parameters = exceptionType;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(); int num = boundariesCrossed; boolean isFinal = this.is$Final(); 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)); return handlesException_TypeDecl_value; } // Declared in LookupMethod.jrag at line 14 @SuppressWarnings({"unchecked", "cast"}) public MethodDecl unknownMethod() { MethodDecl unknownMethod_value = getParent().Define_MethodDecl_unknownMethod(this, null); return unknownMethod_value; } // Declared in VariableDeclaration.jrag at line 81 public boolean Define_boolean_isConstructorParameter(ASTNode caller, ASTNode child) { if(caller == getParameterListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return false; } return getParent().Define_boolean_isConstructorParameter(this, caller); } // Declared in Modifiers.jrag at line 271 public boolean Define_boolean_mayBePrivate(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBePrivate(this, caller); } // Declared in LookupVariable.jrag at line 46 public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) { if(caller == getParameterListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return parameterDeclaration(name); } if(caller == getBlockOptNoTransform()){ SimpleSet set = parameterDeclaration(name); // A declaration of a method parameter name shadows any other variable declarations if(!set.isEmpty()) return set; // Delegate to other declarations in scope return lookupVariable(name); } return getParent().Define_SimpleSet_lookupVariable(this, caller, name); } // Declared in ExceptionHandling.jrag at line 120 public boolean Define_boolean_handlesException(ASTNode caller, ASTNode child, TypeDecl exceptionType) { if(caller == getBlockOptNoTransform()) { return throwsException(exceptionType) || handlesException(exceptionType); } return getParent().Define_boolean_handlesException(this, caller, exceptionType); } // Declared in LocalNum.jrag at line 45 public int Define_int_resultSaveLocalNum(ASTNode caller, ASTNode child) { if(caller == getBlockOptNoTransform()) { return offsetAfterParameters(); } return getParent().Define_int_resultSaveLocalNum(this, caller); } // Declared in Modifiers.jrag at line 272 public boolean Define_boolean_mayBeAbstract(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBeAbstract(this, caller); } // Declared in Modifiers.jrag at line 277 public boolean Define_boolean_mayBeStrictfp(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBeStrictfp(this, caller); } // Declared in UnreachableStatements.jrag at line 33 public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) { if(caller == getBlockOptNoTransform()) { return true; } return getParent().Define_boolean_reachable(this, caller); } // Declared in DefiniteAssignment.jrag at line 438 public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getBlockOptNoTransform()) { return v.isFinal() && (v.isClassVariable() || v.isInstanceVariable()) ? true : isDAbefore(v); } return getParent().Define_boolean_isDAbefore(this, caller, v); } // Declared in Modifiers.jrag at line 274 public boolean Define_boolean_mayBeFinal(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBeFinal(this, caller); } // Declared in VariableDeclaration.jrag at line 80 public boolean Define_boolean_isMethodParameter(ASTNode caller, ASTNode child) { if(caller == getParameterListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return true; } return getParent().Define_boolean_isMethodParameter(this, caller); } // Declared in Modifiers.jrag at line 269 public boolean Define_boolean_mayBePublic(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBePublic(this, caller); } // Declared in LocalNum.jrag at line 52 public int Define_int_localNum(ASTNode caller, ASTNode child) { if(caller == getBlockOptNoTransform()) { return offsetAfterParameters() + resultOffset(); } if(caller == getParameterListNoTransform()) { int index = caller.getIndexOfChild(child);{ if(index == 0) return offsetBeforeParameters(); return getParameter(index-1).localNum() + getParameter(index-1).type().variableSize(); }} return getParent().Define_int_localNum(this, caller); } // Declared in TypeCheck.jrag at line 405 public TypeDecl Define_TypeDecl_returnType(ASTNode caller, ASTNode child) { if(caller == getBlockOptNoTransform()) { return type(); } return getParent().Define_TypeDecl_returnType(this, caller); } // Declared in Modifiers.jrag at line 270 public boolean Define_boolean_mayBeProtected(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBeProtected(this, caller); } // Declared in NameCheck.jrag at line 241 public ASTNode Define_ASTNode_enclosingBlock(ASTNode caller, ASTNode child) { if(caller == getBlockOptNoTransform()) { return this; } return getParent().Define_ASTNode_enclosingBlock(this, caller); } // Declared in Modifiers.jrag at line 275 public boolean Define_boolean_mayBeSynchronized(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBeSynchronized(this, caller); } // Declared in VariableDeclaration.jrag at line 82 public boolean Define_boolean_isExceptionHandlerParameter(ASTNode caller, ASTNode child) { if(caller == getParameterListNoTransform()) { int childIndex = caller.getIndexOfChild(child); return false; } return getParent().Define_boolean_isExceptionHandlerParameter(this, caller); } // Declared in Modifiers.jrag at line 276 public boolean Define_boolean_mayBeNative(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBeNative(this, caller); } // Declared in SyntacticClassification.jrag at line 82 public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { 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(caller == getTypeAccessNoTransform()) { return NameType.TYPE_NAME; } return getParent().Define_NameType_nameType(this, caller); } // Declared in TypeHierarchyCheck.jrag at line 142 public boolean Define_boolean_inStaticContext(ASTNode caller, ASTNode child) { if(caller == getBlockOptNoTransform()) { return isStatic(); } return getParent().Define_boolean_inStaticContext(this, caller); } // Declared in DefiniteAssignment.jrag at line 872 public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getBlockOptNoTransform()) { return v.isFinal() && (v.isClassVariable() || v.isInstanceVariable()) ? false : true; } return getParent().Define_boolean_isDUbefore(this, caller, v); } // Declared in Modifiers.jrag at line 273 public boolean Define_boolean_mayBeStatic(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBeStatic(this, caller); }public ASTNode rewriteTo() { return super.rewriteTo();}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -