├── .flow ├── .idea ├── .name ├── codeStyleSettings.xml ├── copyright │ ├── Assembler.xml │ ├── DLR.xml │ ├── Non_DLR.xml │ └── profiles_settings.xml ├── inspectionProfiles │ ├── Project_Default.xml │ └── profiles_settings.xml ├── modules.xml ├── runConfigurations │ └── All_in_Procyon_CompilerTools.xml ├── scopes │ ├── Procyon_CompilerTools.xml │ ├── com_strobel.xml │ ├── com_strobel_expressions.xml │ └── scope_settings.xml └── vcs.xml ├── License.Rtf ├── License.html ├── License.txt ├── Procyon.CompilerTools ├── build.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── strobel │ │ ├── assembler │ │ ├── CodePrinter.java │ │ ├── Collection.java │ │ ├── InputTypeLoader.java │ │ ├── flowanalysis │ │ │ ├── ControlFlowEdge.java │ │ │ ├── ControlFlowGraph.java │ │ │ ├── ControlFlowGraphBuilder.java │ │ │ ├── ControlFlowNode.java │ │ │ ├── ControlFlowNodeType.java │ │ │ └── JumpType.java │ │ ├── ir │ │ │ ├── AnnotationReader.java │ │ │ ├── ConstantPool.java │ │ │ ├── Error.java │ │ │ ├── ErrorOperand.java │ │ │ ├── ExceptionHandler.java │ │ │ ├── ExceptionHandlerType.java │ │ │ ├── FlowControl.java │ │ │ ├── Frame.java │ │ │ ├── FrameType.java │ │ │ ├── FrameValue.java │ │ │ ├── FrameValueType.java │ │ │ ├── Instruction.java │ │ │ ├── InstructionBlock.java │ │ │ ├── InstructionCollection.java │ │ │ ├── InstructionVisitor.java │ │ │ ├── MetadataReader.java │ │ │ ├── OpCode.java │ │ │ ├── OpCodeHelpers.java │ │ │ ├── OpCodeType.java │ │ │ ├── OperandType.java │ │ │ ├── StackBehavior.java │ │ │ ├── StackMapAnalyzer.java │ │ │ ├── StackMapFrame.java │ │ │ ├── StackMappingVisitor.java │ │ │ └── attributes │ │ │ │ ├── AnnotationDefaultAttribute.java │ │ │ │ ├── AnnotationsAttribute.java │ │ │ │ ├── AttributeNames.java │ │ │ │ ├── BlobAttribute.java │ │ │ │ ├── BootstrapMethodsAttribute.java │ │ │ │ ├── BootstrapMethodsTableEntry.java │ │ │ │ ├── CodeAttribute.java │ │ │ │ ├── ConstantValueAttribute.java │ │ │ │ ├── EnclosingMethodAttribute.java │ │ │ │ ├── ExceptionTableEntry.java │ │ │ │ ├── ExceptionsAttribute.java │ │ │ │ ├── InnerClassEntry.java │ │ │ │ ├── InnerClassesAttribute.java │ │ │ │ ├── LineNumberTableAttribute.java │ │ │ │ ├── LineNumberTableEntry.java │ │ │ │ ├── LocalVariableTableAttribute.java │ │ │ │ ├── LocalVariableTableEntry.java │ │ │ │ ├── MethodParameterEntry.java │ │ │ │ ├── MethodParametersAttribute.java │ │ │ │ ├── ParameterAnnotationsAttribute.java │ │ │ │ ├── SignatureAttribute.java │ │ │ │ ├── SourceAttribute.java │ │ │ │ └── SourceFileAttribute.java │ │ └── metadata │ │ │ ├── AnonymousLocalTypeCollection.java │ │ │ ├── ArrayType.java │ │ │ ├── ArrayTypeLoader.java │ │ │ ├── Buffer.java │ │ │ ├── BuiltinTypes.java │ │ │ ├── CapturedType.java │ │ │ ├── ClassFileReader.java │ │ │ ├── ClasspathTypeLoader.java │ │ │ ├── CommonTypeReferences.java │ │ │ ├── CompilerTarget.java │ │ │ ├── CompositeTypeLoader.java │ │ │ ├── CompoundTypeReference.java │ │ │ ├── ConstantPoolPrinter.java │ │ │ ├── ConversionType.java │ │ │ ├── CoreMetadataFactory.java │ │ │ ├── DefaultTypeVisitor.java │ │ │ ├── DeobfuscationUtilities.java │ │ │ ├── DynamicCallSite.java │ │ │ ├── Error.java │ │ │ ├── ExceptionHandlerMapper.java │ │ │ ├── FieldDefinition.java │ │ │ ├── FieldMetadataVisitor.java │ │ │ ├── FieldReference.java │ │ │ ├── FieldVisitor.java │ │ │ ├── Flags.java │ │ │ ├── GenericMethodInstance.java │ │ │ ├── GenericParameter.java │ │ │ ├── GenericParameterCollection.java │ │ │ ├── GenericParameterType.java │ │ │ ├── IAnnotationsProvider.java │ │ │ ├── ICapturedType.java │ │ │ ├── IClassSignature.java │ │ │ ├── IConstantValueProvider.java │ │ │ ├── IGenericContext.java │ │ │ ├── IGenericInstance.java │ │ │ ├── IGenericParameterProvider.java │ │ │ ├── IMemberDefinition.java │ │ │ ├── IMetadataResolver.java │ │ │ ├── IMetadataScope.java │ │ │ ├── IMetadataTypeMember.java │ │ │ ├── IMethodSignature.java │ │ │ ├── IResolverFrame.java │ │ │ ├── ITypeLoader.java │ │ │ ├── IVariableDefinitionProvider.java │ │ │ ├── JarTypeLoader.java │ │ │ ├── JvmType.java │ │ │ ├── Label.java │ │ │ ├── MemberReference.java │ │ │ ├── MetadataFilters.java │ │ │ ├── MetadataHelper.java │ │ │ ├── MetadataParser.java │ │ │ ├── MetadataResolver.java │ │ │ ├── MetadataSystem.java │ │ │ ├── MethodBinder.java │ │ │ ├── MethodBody.java │ │ │ ├── MethodBodyParseException.java │ │ │ ├── MethodDefinition.java │ │ │ ├── MethodHandle.java │ │ │ ├── MethodHandleType.java │ │ │ ├── MethodMetadataVisitor.java │ │ │ ├── MethodReader.java │ │ │ ├── MethodReference.java │ │ │ ├── MethodVisitor.java │ │ │ ├── PackageReference.java │ │ │ ├── ParameterDefinition.java │ │ │ ├── ParameterDefinitionCollection.java │ │ │ ├── ParameterReference.java │ │ │ ├── ParameterizedType.java │ │ │ ├── PrimitiveType.java │ │ │ ├── RawMethod.java │ │ │ ├── RawType.java │ │ │ ├── SentinelTypes.java │ │ │ ├── SwitchInfo.java │ │ │ ├── TypeDefinition.java │ │ │ ├── TypeMapper.java │ │ │ ├── TypeMetadataVisitor.java │ │ │ ├── TypeReference.java │ │ │ ├── TypeRelation.java │ │ │ ├── TypeSubstitutionVisitor.java │ │ │ ├── TypeVisitor.java │ │ │ ├── VariableDefinition.java │ │ │ ├── VariableDefinitionCollection.java │ │ │ ├── VariableReference.java │ │ │ ├── WildcardType.java │ │ │ ├── annotations │ │ │ ├── AnnotationAnnotationElement.java │ │ │ ├── AnnotationElement.java │ │ │ ├── AnnotationElementType.java │ │ │ ├── AnnotationParameter.java │ │ │ ├── AnnotationReader.java │ │ │ ├── ArrayAnnotationElement.java │ │ │ ├── ClassAnnotationElement.java │ │ │ ├── ConstantAnnotationElement.java │ │ │ ├── CustomAnnotation.java │ │ │ └── EnumAnnotationElement.java │ │ │ └── signatures │ │ │ ├── ArrayTypeSignature.java │ │ │ ├── BaseType.java │ │ │ ├── BooleanSignature.java │ │ │ ├── BottomSignature.java │ │ │ ├── ByteSignature.java │ │ │ ├── CharSignature.java │ │ │ ├── ClassSignature.java │ │ │ ├── ClassTypeSignature.java │ │ │ ├── DoubleSignature.java │ │ │ ├── FieldTypeSignature.java │ │ │ ├── FloatSignature.java │ │ │ ├── FormalTypeParameter.java │ │ │ ├── IntSignature.java │ │ │ ├── LongSignature.java │ │ │ ├── MetadataFactory.java │ │ │ ├── MethodTypeSignature.java │ │ │ ├── Reifier.java │ │ │ ├── ReturnType.java │ │ │ ├── ShortSignature.java │ │ │ ├── Signature.java │ │ │ ├── SignatureParser.java │ │ │ ├── SimpleClassTypeSignature.java │ │ │ ├── Tree.java │ │ │ ├── TypeArgument.java │ │ │ ├── TypeSignature.java │ │ │ ├── TypeTree.java │ │ │ ├── TypeTreeVisitor.java │ │ │ ├── TypeVariableSignature.java │ │ │ ├── Visitor.java │ │ │ ├── VoidSignature.java │ │ │ └── Wildcard.java │ │ └── decompiler │ │ ├── AnsiTextOutput.java │ │ ├── DecompilationOptions.java │ │ ├── Decompiler.java │ │ ├── DecompilerContext.java │ │ ├── DecompilerHelpers.java │ │ ├── DecompilerSettings.java │ │ ├── ITextOutput.java │ │ ├── InstructionHelper.java │ │ ├── NameSyntax.java │ │ ├── PlainTextOutput.java │ │ ├── ast │ │ ├── AstBuilder.java │ │ ├── AstCode.java │ │ ├── AstCodeHelpers.java │ │ ├── AstKeys.java │ │ ├── AstOptimizationStep.java │ │ ├── AstOptimizer.java │ │ ├── BasicBlock.java │ │ ├── Block.java │ │ ├── CaseBlock.java │ │ ├── CatchBlock.java │ │ ├── Condition.java │ │ ├── DefaultMap.java │ │ ├── Error.java │ │ ├── Expression.java │ │ ├── GotoRemoval.java │ │ ├── Inlining.java │ │ ├── Label.java │ │ ├── Lambda.java │ │ ├── LockInfo.java │ │ ├── Loop.java │ │ ├── LoopType.java │ │ ├── LoopsAndConditions.java │ │ ├── Node.java │ │ ├── PatternMatching.java │ │ ├── Range.java │ │ ├── Switch.java │ │ ├── TryCatchBlock.java │ │ ├── TypeAnalysis.java │ │ └── Variable.java │ │ ├── languages │ │ ├── BytecodeAstLanguage.java │ │ ├── BytecodeLanguage.java │ │ ├── BytecodeOutputOptions.java │ │ ├── EntityType.java │ │ ├── Language.java │ │ ├── Languages.java │ │ ├── LineNumberPosition.java │ │ ├── Region.java │ │ ├── TextLocation.java │ │ ├── TypeDecompilationResults.java │ │ └── java │ │ │ ├── BraceEnforcement.java │ │ │ ├── BraceStyle.java │ │ │ ├── IOutputFormatter.java │ │ │ ├── JavaFormattingOptions.java │ │ │ ├── JavaLanguage.java │ │ │ ├── JavaOutputVisitor.java │ │ │ ├── LineNumberTableConverter.java │ │ │ ├── MemberMapping.java │ │ │ ├── OffsetToLineNumberConverter.java │ │ │ ├── TextOutputFormatter.java │ │ │ ├── Wrapping.java │ │ │ ├── analysis │ │ │ ├── ControlFlowEdge.java │ │ │ ├── ControlFlowEdgeType.java │ │ │ ├── ControlFlowGraphBuilder.java │ │ │ ├── ControlFlowNode.java │ │ │ ├── ControlFlowNodeType.java │ │ │ ├── Correlator.java │ │ │ ├── UsageClassifier.java │ │ │ └── UsageType.java │ │ │ ├── ast │ │ │ ├── Annotation.java │ │ │ ├── AnonymousObjectCreationExpression.java │ │ │ ├── ArrayCreationExpression.java │ │ │ ├── ArrayInitializerExpression.java │ │ │ ├── ArraySpecifier.java │ │ │ ├── AssertStatement.java │ │ │ ├── AssignmentExpression.java │ │ │ ├── AssignmentOperatorType.java │ │ │ ├── AstBuilder.java │ │ │ ├── AstMethodBodyBuilder.java │ │ │ ├── AstNode.java │ │ │ ├── AstNodeCollection.java │ │ │ ├── AstType.java │ │ │ ├── BinaryOperatorExpression.java │ │ │ ├── BinaryOperatorType.java │ │ │ ├── BlockStatement.java │ │ │ ├── BreakStatement.java │ │ │ ├── CaseLabel.java │ │ │ ├── CastExpression.java │ │ │ ├── CatchClause.java │ │ │ ├── ClassOfExpression.java │ │ │ ├── ClassType.java │ │ │ ├── Comment.java │ │ │ ├── CommentStatement.java │ │ │ ├── CommentType.java │ │ │ ├── CompilationUnit.java │ │ │ ├── ComposedType.java │ │ │ ├── ConditionalExpression.java │ │ │ ├── ConstructorDeclaration.java │ │ │ ├── ConstructorInitializerType.java │ │ │ ├── ContextTrackingVisitor.java │ │ │ ├── ContinueStatement.java │ │ │ ├── ConvertTypeOptions.java │ │ │ ├── DefiniteAssignmentAnalysis.java │ │ │ ├── DefiniteAssignmentStatus.java │ │ │ ├── DepthFirstAstVisitor.java │ │ │ ├── DoWhileStatement.java │ │ │ ├── EmptyStatement.java │ │ │ ├── EntityDeclaration.java │ │ │ ├── EnumValueDeclaration.java │ │ │ ├── Expression.java │ │ │ ├── ExpressionStatement.java │ │ │ ├── FieldDeclaration.java │ │ │ ├── ForEachStatement.java │ │ │ ├── ForStatement.java │ │ │ ├── GotoStatement.java │ │ │ ├── IAstVisitor.java │ │ │ ├── Identifier.java │ │ │ ├── IdentifierExpression.java │ │ │ ├── IfElseStatement.java │ │ │ ├── ImportDeclaration.java │ │ │ ├── IndexerExpression.java │ │ │ ├── InliningHelper.java │ │ │ ├── InsertParenthesesVisitor.java │ │ │ ├── InstanceInitializer.java │ │ │ ├── InstanceOfExpression.java │ │ │ ├── InvocationExpression.java │ │ │ ├── JavaModifierToken.java │ │ │ ├── JavaNameResolver.java │ │ │ ├── JavaPrimitiveCast.java │ │ │ ├── JavaResolver.java │ │ │ ├── JavaTokenNode.java │ │ │ ├── Keys.java │ │ │ ├── LabelStatement.java │ │ │ ├── LabeledStatement.java │ │ │ ├── LambdaExpression.java │ │ │ ├── LocalClassHelper.java │ │ │ ├── LocalTypeDeclarationStatement.java │ │ │ ├── MacNewLine.java │ │ │ ├── MemberReferenceExpression.java │ │ │ ├── MethodDeclaration.java │ │ │ ├── MethodGroupExpression.java │ │ │ ├── NameResolveMode.java │ │ │ ├── NameResolveResult.java │ │ │ ├── NameVariables.java │ │ │ ├── NewLineNode.java │ │ │ ├── NewLineType.java │ │ │ ├── NodeType.java │ │ │ ├── NullReferenceExpression.java │ │ │ ├── ObjectCreationExpression.java │ │ │ ├── PackageDeclaration.java │ │ │ ├── ParameterDeclaration.java │ │ │ ├── ParenthesizedExpression.java │ │ │ ├── PrimitiveExpression.java │ │ │ ├── ReturnStatement.java │ │ │ ├── Roles.java │ │ │ ├── SimpleNameLookupMode.java │ │ │ ├── SimpleType.java │ │ │ ├── Statement.java │ │ │ ├── SuperReferenceExpression.java │ │ │ ├── SwitchSection.java │ │ │ ├── SwitchStatement.java │ │ │ ├── SynchronizedStatement.java │ │ │ ├── TextNode.java │ │ │ ├── ThisReferenceExpression.java │ │ │ ├── ThrowStatement.java │ │ │ ├── TokenRole.java │ │ │ ├── TryCatchStatement.java │ │ │ ├── TypeDeclaration.java │ │ │ ├── TypeParameterDeclaration.java │ │ │ ├── TypeReferenceExpression.java │ │ │ ├── UnaryOperatorExpression.java │ │ │ ├── UnaryOperatorType.java │ │ │ ├── UnixNewLine.java │ │ │ ├── VariableDeclarationStatement.java │ │ │ ├── VariableInitializer.java │ │ │ ├── WhileStatement.java │ │ │ ├── WildcardType.java │ │ │ ├── WindowsNewLine.java │ │ │ └── transforms │ │ │ │ ├── AddReferenceQualifiersTransform.java │ │ │ │ ├── AssertStatementTransform.java │ │ │ │ ├── BreakTargetRelocation.java │ │ │ │ ├── CollapseImportsTransform.java │ │ │ │ ├── ConvertLoopsTransform.java │ │ │ │ ├── DeclareLocalClassesTransform.java │ │ │ │ ├── DeclareVariablesTransform.java │ │ │ │ ├── EclipseEnumSwitchRewriterTransform.java │ │ │ │ ├── EclipseStringSwitchRewriterTransform.java │ │ │ │ ├── EliminateSyntheticAccessorsTransform.java │ │ │ │ ├── EnumRewriterTransform.java │ │ │ │ ├── EnumSwitchRewriterTransform.java │ │ │ │ ├── FlattenElseIfStatementsTransform.java │ │ │ │ ├── FlattenSwitchBlocksTransform.java │ │ │ │ ├── IAstTransform.java │ │ │ │ ├── InlineEscapingAssignmentsTransform.java │ │ │ │ ├── InsertConstantReferencesTransform.java │ │ │ │ ├── InsertNecessaryConversionsTransform.java │ │ │ │ ├── InsertOverrideAnnotationsTransform.java │ │ │ │ ├── IntroduceInitializersTransform.java │ │ │ │ ├── IntroduceOuterClassReferencesTransform.java │ │ │ │ ├── IntroduceStringConcatenationTransform.java │ │ │ │ ├── LabelCleanupTransform.java │ │ │ │ ├── LambdaTransform.java │ │ │ │ ├── MarkReferencedSyntheticsTransform.java │ │ │ │ ├── RemoveHiddenMembersTransform.java │ │ │ │ ├── RemoveImplicitBoxingTransform.java │ │ │ │ ├── RemoveRedundantCastsTransform.java │ │ │ │ ├── RemoveRedundantInitializersTransform.java │ │ │ │ ├── RewriteInnerClassConstructorCalls.java │ │ │ │ ├── RewriteLocalClassesTransform.java │ │ │ │ ├── RewriteNewArrayLambdas.java │ │ │ │ ├── SimplifyArithmeticExpressionsTransform.java │ │ │ │ ├── SimplifyAssignmentsTransform.java │ │ │ │ ├── StringSwitchRewriterTransform.java │ │ │ │ ├── TransformationPipeline.java │ │ │ │ ├── TryWithResourcesTransform.java │ │ │ │ └── VarArgsTransform.java │ │ │ └── utilities │ │ │ ├── RedundantCastUtility.java │ │ │ └── TypeUtilities.java │ │ ├── patterns │ │ ├── AnyNode.java │ │ ├── AssignmentChain.java │ │ ├── BackReference.java │ │ ├── BacktrackingInfo.java │ │ ├── Choice.java │ │ ├── DeclaredVariableBackReference.java │ │ ├── INode.java │ │ ├── IdentifierExpressionBackReference.java │ │ ├── IdentifierExpressionRegexNode.java │ │ ├── LeftmostBinaryOperandNode.java │ │ ├── Match.java │ │ ├── MemberReferenceExpressionRegexNode.java │ │ ├── MemberReferenceTypeNode.java │ │ ├── NamedNode.java │ │ ├── OptionalNode.java │ │ ├── ParameterReferenceNode.java │ │ ├── Pattern.java │ │ ├── PossibleMatch.java │ │ ├── Repeat.java │ │ ├── Role.java │ │ ├── SingleOrBinaryAggregateNode.java │ │ ├── SubtreeMatch.java │ │ ├── TypeReferenceDescriptorComparisonNode.java │ │ ├── TypedExpression.java │ │ ├── TypedNode.java │ │ └── TypedPrimitiveValueNode.java │ │ ├── semantics │ │ └── ResolveResult.java │ │ ├── types │ │ ├── ITypeInfo.java │ │ ├── ITypeListener.java │ │ ├── TypeManager.java │ │ └── TypeProxy.java │ │ └── utilities │ │ └── TreeTraversal.java │ └── test │ ├── java │ └── com │ │ └── strobel │ │ ├── assembler │ │ └── metadata │ │ │ ├── MetadataHelperTests.java │ │ │ └── MetadataParserTests.java │ │ └── decompiler │ │ ├── AnnotationTests.java │ │ ├── ArrayCreationTests.java │ │ ├── AssertTests.java │ │ ├── BoxingTests.java │ │ ├── CallTests.java │ │ ├── CastTests.java │ │ ├── ConditionalTests.java │ │ ├── DecompilerTest.java │ │ ├── EncodingTests.java │ │ ├── EnhancedTryTests.java │ │ ├── EnumTests.java │ │ ├── GenericsTests.java │ │ ├── HandlerTests.java │ │ ├── ImportTests.java │ │ ├── InitializerTests.java │ │ ├── InliningTests.java │ │ ├── InnerClassTests.java │ │ ├── LoopTests.java │ │ ├── ModifierTests.java │ │ ├── NameTests.java │ │ ├── OperatorTests.java │ │ ├── PerformanceTests.java │ │ ├── PrimitiveTests.java │ │ ├── StringTests.java │ │ ├── SwitchTests.java │ │ ├── SyncTests.java │ │ ├── ThirdPartyTests.java │ │ ├── TypeInferenceTests.java │ │ ├── TypeTests.java │ │ └── VariableTests.java │ └── resources │ ├── ArgumentTypes.class │ ├── Circle.class │ ├── Drawable.class │ ├── Hello.class │ ├── Issue216GotoWVulnerability.class │ ├── Issue216GotoWVulnerability.j │ ├── JsrWithoutRet.class │ ├── JsrWithoutRet.j │ ├── LiteralAssignments.class │ ├── LiteralAssignments.j │ ├── OddsAndEnds.class │ ├── Rectangle.class │ ├── SkipJSR.class │ ├── SootOptimizationTest.class │ ├── Switch.class │ ├── UnboxToNumber.class │ └── WhileLoops.class ├── Procyon.Core ├── build.gradle └── src │ └── main │ └── java │ └── com │ └── strobel │ ├── Procyon.java │ ├── annotations │ ├── NotNull.java │ └── Nullable.java │ ├── collections │ ├── ArrayIterator.java │ ├── Cache.java │ ├── Constants.java │ ├── ImmutableList.java │ ├── ListBuffer.java │ ├── SmartList.java │ └── concurrent │ │ ├── ConcurrentIntObjectHashMap.java │ │ ├── ConcurrentIntObjectMap.java │ │ ├── ConcurrentRefValueIntObjectHashMap.java │ │ ├── ConcurrentWeakIntObjectHashMap.java │ │ └── IntObjectEntry.java │ ├── compilerservices │ ├── CallerResolver.java │ └── RuntimeHelpers.java │ ├── componentmodel │ ├── FrugalKeyMap.java │ ├── Key.java │ ├── UserDataStore.java │ └── UserDataStoreBase.java │ ├── concurrent │ ├── StripedLock.java │ └── StripedReentrantLock.java │ ├── core │ ├── Accumulator.java │ ├── Aggregate.java │ ├── Aggregator.java │ ├── ArrayUtilities.java │ ├── BooleanBox.java │ ├── ByteBox.java │ ├── CharacterBox.java │ ├── Closeables.java │ ├── CollectionUtilities.java │ ├── Comparer.java │ ├── DoubleBox.java │ ├── Environment.java │ ├── Error.java │ ├── ExceptionUtilities.java │ ├── Fences.java │ ├── FloatBox.java │ ├── Freezable.java │ ├── HashUtilities.java │ ├── IEqualityComparator.java │ ├── IFreezable.java │ ├── IReadOnlyList.java │ ├── IStrongBox.java │ ├── IntegerBox.java │ ├── KeyedQueue.java │ ├── LongBox.java │ ├── Mapping.java │ ├── MutableInteger.java │ ├── OS.java │ ├── Pair.java │ ├── Predicate.java │ ├── Predicates.java │ ├── ReadOnlyList.java │ ├── SafeCloseable.java │ ├── Selector.java │ ├── Selectors.java │ ├── ShortBox.java │ ├── StringComparator.java │ ├── StringComparison.java │ ├── StringUtilities.java │ ├── StrongBox.java │ ├── Triple.java │ ├── VerifyArgument.java │ └── delegates │ │ ├── Action1.java │ │ ├── Func.java │ │ ├── Func1.java │ │ └── Func2.java │ ├── functions │ ├── Block.java │ ├── Function.java │ ├── Supplier.java │ └── Suppliers.java │ ├── io │ ├── Ansi.java │ └── PathHelper.java │ ├── reflection │ └── TargetInvocationException.java │ └── util │ ├── ContractUtils.java │ └── EmptyArrayCache.java ├── Procyon.Decompiler ├── build.gradle └── src │ └── main │ └── java │ └── com │ └── strobel │ └── decompiler │ ├── CommandLineOptions.java │ ├── DecompilerDriver.java │ ├── LineNumberFormatter.java │ └── LineNumberPrintWriter.java ├── Procyon.Expressions ├── build.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── strobel │ │ ├── compilerservices │ │ ├── Closure.java │ │ └── DebugInfoGenerator.java │ │ └── expressions │ │ ├── AnalyzedTree.java │ │ ├── BinaryExpression.java │ │ ├── BlockExpression.java │ │ ├── BoundConstants.java │ │ ├── CatchBlock.java │ │ ├── CompilerScope.java │ │ ├── ConcatExpression.java │ │ ├── ConditionalExpression.java │ │ ├── ConstantCheck.java │ │ ├── ConstantExpression.java │ │ ├── CustomDelegateTypeCache.java │ │ ├── DebugViewWriter.java │ │ ├── DefaultValueExpression.java │ │ ├── Delegate.java │ │ ├── Error.java │ │ ├── Expression.java │ │ ├── ExpressionList.java │ │ ├── ExpressionStringBuilder.java │ │ ├── ExpressionType.java │ │ ├── ExpressionVisitor.java │ │ ├── FieldExpression.java │ │ ├── ForEachExpression.java │ │ ├── ForExpression.java │ │ ├── GotoExpression.java │ │ ├── GotoExpressionKind.java │ │ ├── Helpers.java │ │ ├── HoistedLocals.java │ │ ├── IArgumentProvider.java │ │ ├── IRuntimeVariables.java │ │ ├── InvocationExpression.java │ │ ├── LabelExpression.java │ │ ├── LabelInfo.java │ │ ├── LabelTarget.java │ │ ├── LambdaCompiler.java │ │ ├── LambdaExpression.java │ │ ├── LoopExpression.java │ │ ├── MemberExpression.java │ │ ├── MethodBinder.java │ │ ├── MethodCallExpression.java │ │ ├── NewArrayExpression.java │ │ ├── NewExpression.java │ │ ├── Optimizer.java │ │ ├── ParameterExpression.java │ │ ├── ParameterExpressionList.java │ │ ├── RuntimeOperations.java │ │ ├── RuntimeVariablesExpression.java │ │ ├── SelfExpression.java │ │ ├── StackSpiller.java │ │ ├── SwitchCase.java │ │ ├── SwitchExpression.java │ │ ├── TryExpression.java │ │ ├── TypeBinaryExpression.java │ │ ├── UnaryExpression.java │ │ ├── VariableBinder.java │ │ └── VariableStorageKind.java │ └── test │ └── java │ └── com │ └── strobel │ └── expressions │ ├── AbstractExpressionTest.java │ ├── BinaryExpressionTests.java │ ├── CallTests.java │ ├── CompilerTests.java │ ├── ConcatTests.java │ ├── ConstantTests.java │ ├── ConvertTests.java │ ├── DynamicMethodTests.java │ ├── LogicalBranchTests.java │ ├── OutputRecorder.java │ └── UnaryExpressionTests.java ├── Procyon.Reflection ├── build.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── strobel │ │ ├── reflection │ │ ├── ArrayType.java │ │ ├── Binder.java │ │ ├── BindingFlags.java │ │ ├── BottomType.java │ │ ├── CallingConvention.java │ │ ├── CapturedType.java │ │ ├── CompoundType.java │ │ ├── ConstructorInfo.java │ │ ├── ConstructorList.java │ │ ├── DefaultTypeVisitor.java │ │ ├── DynamicMethod.java │ │ ├── ErasedType.java │ │ ├── Error.java │ │ ├── FieldInfo.java │ │ ├── FieldList.java │ │ ├── FlagUtilities.java │ │ ├── Flags.java │ │ ├── GenericParameter.java │ │ ├── GenericType.java │ │ ├── Helper.java │ │ ├── ICapturedType.java │ │ ├── LocalVariableInfo.java │ │ ├── MemberFilter.java │ │ ├── MemberInfo.java │ │ ├── MemberList.java │ │ ├── MemberListOptions.java │ │ ├── MemberResolutionException.java │ │ ├── MemberType.java │ │ ├── MethodBase.java │ │ ├── MethodInfo.java │ │ ├── MethodList.java │ │ ├── Missing.java │ │ ├── NullType.java │ │ ├── ParameterInfo.java │ │ ├── ParameterList.java │ │ ├── PrimitiveType.java │ │ ├── PrimitiveTypes.java │ │ ├── Resolver.java │ │ ├── RuntimeTypeCache.java │ │ ├── SignatureType.java │ │ ├── SimpleType.java │ │ ├── SimpleVisitor.java │ │ ├── Type.java │ │ ├── TypeBinder.java │ │ ├── TypeBindings.java │ │ ├── TypeCache.java │ │ ├── TypeContext.java │ │ ├── TypeList.java │ │ ├── TypeMapper.java │ │ ├── TypeMapping.java │ │ ├── TypeParser.java │ │ ├── TypeRelation.java │ │ ├── TypeResolver.java │ │ ├── TypeVisitor.java │ │ ├── Types.java │ │ ├── UnaryTypeVisitor.java │ │ ├── WildcardType.java │ │ └── emit │ │ │ ├── AnnotationBuilder.java │ │ │ ├── ClassWriter.java │ │ │ ├── CodeGenerator.java │ │ │ ├── CodeStream.java │ │ │ ├── CompilationTarget.java │ │ │ ├── ConstantPool.java │ │ │ ├── ConstructorBuilder.java │ │ │ ├── EnumSwitchCallback.java │ │ │ ├── Error.java │ │ │ ├── FieldBuilder.java │ │ │ ├── GenericParameterBuilder.java │ │ │ ├── Label.java │ │ │ ├── LocalBuilder.java │ │ │ ├── LocalSymInfo.java │ │ │ ├── MethodBuilder.java │ │ │ ├── OpCode.java │ │ │ ├── OperandType.java │ │ │ ├── ParameterBuilder.java │ │ │ ├── ScopeAction.java │ │ │ ├── ScopeTree.java │ │ │ ├── StackBehavior.java │ │ │ ├── StringSwitchCallback.java │ │ │ ├── SwitchCallback.java │ │ │ ├── SwitchOptions.java │ │ │ ├── TypeBuilder.java │ │ │ ├── TypeBuilderInstantiation.java │ │ │ ├── VerificationException.java │ │ │ ├── Verifier.java │ │ │ ├── __ExceptionInfo.java │ │ │ └── __FixupData.java │ │ └── util │ │ └── TypeUtils.java │ └── test │ └── java │ └── com │ └── strobel │ └── reflection │ ├── ReflectionTests.java │ ├── SignatureTests.java │ ├── TypeTests.java │ └── emit │ ├── TypeBuilderTests.java │ └── VerifierTests.java ├── README.md ├── build.gradle ├── logo.png ├── logo_small.png └── settings.gradle /.flow: -------------------------------------------------------------------------------- 1 | [branchname] 2 | master = default 3 | develop = develop 4 | feature = feature/ 5 | release = release/ 6 | hotfix = hotfix/ 7 | support = support/ 8 | 9 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | Procyon -------------------------------------------------------------------------------- /.idea/copyright/Assembler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /.idea/copyright/DLR.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /.idea/copyright/Non_DLR.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/runConfigurations/All_in_Procyon_CompilerTools.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /.idea/scopes/Procyon_CompilerTools.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/scopes/com_strobel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/scopes/com_strobel_expressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/build.gradle: -------------------------------------------------------------------------------- 1 | compileTestJava.options.encoding = 'UTF-8' 2 | 3 | dependencies { 4 | compile project(':Procyon.Core') 5 | testCompile project(':Procyon.Reflection') 6 | testCompile files('src/test/resources') 7 | } 8 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/flowanalysis/ControlFlowNodeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ControlFlowNodeType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.flowanalysis; 18 | 19 | public enum ControlFlowNodeType { 20 | Normal, 21 | EntryPoint, 22 | RegularExit, 23 | ExceptionalExit, 24 | CatchHandler, 25 | FinallyHandler, 26 | EndFinally 27 | } 28 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/flowanalysis/JumpType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JumpType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.flowanalysis; 18 | 19 | public enum JumpType { 20 | /** 21 | * A regular control flow edge. 22 | */ 23 | Normal, 24 | 25 | /** 26 | * Jump to exception handler (an exception occurred). 27 | */ 28 | JumpToExceptionHandler, 29 | 30 | /** 31 | * Jump from try block (not a real jump, as the finally handler executes first). 32 | */ 33 | LeaveTry, 34 | 35 | /** 36 | * Jump at the end of a finally block. 37 | */ 38 | EndFinally 39 | } 40 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/ErrorOperand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ErrorOperand.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | public final class ErrorOperand { 23 | private final String _message; 24 | 25 | public ErrorOperand(final String message) { 26 | _message = message; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | if (_message != null) { 32 | return _message; 33 | } 34 | 35 | return "!!! BAD OPERAND !!!"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/ExceptionHandlerType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ExceptionHandlerType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir; 18 | 19 | public enum ExceptionHandlerType { 20 | Catch, 21 | Finally 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/FlowControl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * FlowControl.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir; 18 | 19 | public enum FlowControl { 20 | Branch, 21 | Breakpoint, 22 | Call, 23 | ConditionalBranch, 24 | Next, 25 | Return, 26 | Throw 27 | } 28 | 29 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/FrameValueType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * FrameValueType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir; 18 | 19 | public enum FrameValueType { 20 | Empty, 21 | Top, 22 | Integer, 23 | Float, 24 | Long, 25 | Double, 26 | Null, 27 | UninitializedThis, 28 | Reference, 29 | Uninitialized, 30 | Address; 31 | 32 | public final boolean isDoubleWord() { 33 | return this == Double || this == Long; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/OpCodeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * OpCodeType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir; 18 | 19 | public enum OpCodeType { 20 | Annotation, 21 | Macro, 22 | Internal, 23 | ObjectModel, 24 | Prefix, 25 | Primitive, 26 | } 27 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/StackMapFrame.java: -------------------------------------------------------------------------------- 1 | /* 2 | * StackMapFrame.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir; 18 | 19 | import com.strobel.core.VerifyArgument; 20 | 21 | public final class StackMapFrame { 22 | private final Frame _frame; 23 | private final Instruction _startInstruction; 24 | 25 | public StackMapFrame(final Frame frame, final Instruction startInstruction) { 26 | _frame = VerifyArgument.notNull(frame, "frame"); 27 | _startInstruction = VerifyArgument.notNull(startInstruction, "startInstruction"); 28 | } 29 | 30 | public final Frame getFrame() { 31 | return _frame; 32 | } 33 | 34 | public final Instruction getStartInstruction() { 35 | return _startInstruction; 36 | } 37 | 38 | @Override 39 | public final String toString() { 40 | return String.format("#%1$04d: %2$s", _startInstruction.getOffset(), _frame); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/attributes/AnnotationDefaultAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * AnnotationDefaultAttribute.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir.attributes; 18 | 19 | import com.strobel.assembler.metadata.annotations.AnnotationElement; 20 | import com.strobel.core.VerifyArgument; 21 | 22 | /** 23 | * @author Mike Strobel 24 | */ 25 | public final class AnnotationDefaultAttribute extends SourceAttribute { 26 | private final AnnotationElement _defaultValue; 27 | 28 | public AnnotationDefaultAttribute(final int length, final AnnotationElement defaultValue) { 29 | super(AttributeNames.AnnotationDefault, length); 30 | _defaultValue = VerifyArgument.notNull(defaultValue, "defaultValue"); 31 | } 32 | 33 | public AnnotationElement getDefaultValue() { 34 | return _defaultValue; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/attributes/AnnotationsAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * AnnotationsAttribute.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir.attributes; 18 | 19 | import com.strobel.assembler.metadata.annotations.CustomAnnotation; 20 | 21 | /** 22 | * @author Mike Strobel 23 | */ 24 | public final class AnnotationsAttribute extends SourceAttribute { 25 | private final CustomAnnotation[] _annotations; 26 | 27 | public AnnotationsAttribute(final String name, final int length, final CustomAnnotation[] annotations) { 28 | super(name, length); 29 | _annotations = annotations; 30 | } 31 | 32 | public CustomAnnotation[] getAnnotations() { 33 | return _annotations; 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/attributes/BlobAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * BlobAttribute.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir.attributes; 18 | 19 | import com.strobel.core.VerifyArgument; 20 | 21 | /** 22 | * @author Mike Strobel 23 | */ 24 | public final class BlobAttribute extends SourceAttribute { 25 | private final int _dataOffset; 26 | private final byte[] _data; 27 | 28 | public BlobAttribute(final String name, final byte[] data) { 29 | this(name, data, -1); 30 | } 31 | 32 | public BlobAttribute(final String name, final byte[] data, final int dataOffset) { 33 | super(name, data.length); 34 | _dataOffset = dataOffset; 35 | _data = VerifyArgument.notNull(data, "data"); 36 | } 37 | 38 | public int getDataOffset() { 39 | return _dataOffset; 40 | } 41 | 42 | public byte[] getData() { 43 | return _data; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/attributes/ConstantValueAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ConstantValueAttribute.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir.attributes; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | public final class ConstantValueAttribute extends SourceAttribute { 23 | private final Object _value; 24 | 25 | public ConstantValueAttribute(final Object value) { 26 | super(AttributeNames.ConstantValue, 2); 27 | _value = value; 28 | } 29 | 30 | public Object getValue() { 31 | return _value; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/attributes/InnerClassesAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * InnerClassesAttribute.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir.attributes; 18 | 19 | import com.strobel.core.VerifyArgument; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * @author Mike Strobel 25 | */ 26 | public final class InnerClassesAttribute extends SourceAttribute { 27 | private final List _entries; 28 | 29 | public InnerClassesAttribute(final int length, final List entries) { 30 | super(AttributeNames.InnerClasses, length); 31 | _entries = VerifyArgument.notNull(entries, "entries"); 32 | } 33 | 34 | public List getEntries() { 35 | return _entries; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/attributes/LineNumberTableEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * LineNumberTableEntry.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir.attributes; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | public final class LineNumberTableEntry { 23 | private final int _offset; 24 | private final int _lineNumber; 25 | 26 | public LineNumberTableEntry(final int offset, final int lineNumber) { 27 | _offset = offset; 28 | _lineNumber = lineNumber; 29 | } 30 | 31 | public int getOffset() { 32 | return _offset; 33 | } 34 | 35 | public int getLineNumber() { 36 | return _lineNumber; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/attributes/LocalVariableTableAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * LocalVariableTableAttribute.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir.attributes; 18 | 19 | import com.strobel.core.ArrayUtilities; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * @author Mike Strobel 25 | */ 26 | public final class LocalVariableTableAttribute extends SourceAttribute { 27 | private final List _entries; 28 | 29 | public LocalVariableTableAttribute(final String name, final LocalVariableTableEntry[] entries) { 30 | super(name, 2 + (entries.length * 10)); 31 | _entries = ArrayUtilities.asUnmodifiableList(entries.clone()); 32 | } 33 | 34 | public List getEntries() { 35 | return _entries; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/attributes/MethodParameterEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MethodParameterEntry.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir.attributes; 18 | 19 | import com.strobel.assembler.metadata.Flags; 20 | 21 | public final class MethodParameterEntry { 22 | private final String _name; 23 | private final int _flags; 24 | 25 | public MethodParameterEntry(final String name, final int flags) { 26 | _name = name; 27 | _flags = flags; 28 | } 29 | 30 | public String getName() { 31 | return _name; 32 | } 33 | 34 | public int getFlags() { 35 | return _flags; 36 | } 37 | 38 | @Override 39 | public String toString() { 40 | return "MethodParameterEntry{" + 41 | "name='" + _name + "'" + 42 | ", flags=" + Flags.toString(_flags) + 43 | '}'; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/attributes/MethodParametersAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MethodParametersAttribute.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir.attributes; 18 | 19 | import com.strobel.core.VerifyArgument; 20 | 21 | import java.util.List; 22 | 23 | public final class MethodParametersAttribute extends SourceAttribute { 24 | private final List _entries; 25 | 26 | public MethodParametersAttribute(final List entries) { 27 | super(AttributeNames.MethodParameters, 1 + entries.size() * 4); 28 | _entries = VerifyArgument.notNull(entries, "entries"); 29 | } 30 | 31 | public List getEntries() { 32 | return _entries; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/attributes/ParameterAnnotationsAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ParameterAnnotationsAttribute.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir.attributes; 18 | 19 | import com.strobel.assembler.metadata.annotations.CustomAnnotation; 20 | 21 | /** 22 | * @author Mike Strobel 23 | */ 24 | public final class ParameterAnnotationsAttribute extends SourceAttribute { 25 | private final CustomAnnotation[][] _annotations; 26 | 27 | public ParameterAnnotationsAttribute(final String name, final int length, final CustomAnnotation[][] annotations) { 28 | super(name, length); 29 | _annotations = annotations; 30 | } 31 | 32 | public CustomAnnotation[][] getAnnotations() { 33 | return _annotations; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/attributes/SignatureAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SignatureAttribute.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir.attributes; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | public final class SignatureAttribute extends SourceAttribute { 23 | private final String _signature; 24 | 25 | public SignatureAttribute(final String signature) { 26 | super(AttributeNames.Signature, 4); 27 | _signature = signature; 28 | } 29 | 30 | public String getSignature() { 31 | return _signature; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/ir/attributes/SourceFileAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SourceFileAttribute.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.ir.attributes; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | public final class SourceFileAttribute extends SourceAttribute { 23 | private final String _sourceFile; 24 | 25 | public SourceFileAttribute(final String sourceFile) { 26 | super(AttributeNames.SourceFile, 2); 27 | _sourceFile = sourceFile; 28 | } 29 | 30 | public String getSourceFile() { 31 | return _sourceFile; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/CompositeTypeLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CompositeTypeLoader.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | import com.strobel.core.VerifyArgument; 20 | 21 | public final class CompositeTypeLoader implements ITypeLoader { 22 | private final ITypeLoader[] _typeLoaders; 23 | 24 | public CompositeTypeLoader(final ITypeLoader... typeLoaders) { 25 | _typeLoaders = VerifyArgument.noNullElementsAndNotEmpty(typeLoaders, "typeLoaders").clone(); 26 | } 27 | 28 | @Override 29 | public boolean tryLoadType(final String internalName, final Buffer buffer) { 30 | for (final ITypeLoader typeLoader : _typeLoaders) { 31 | if (typeLoader.tryLoadType(internalName, buffer)) { 32 | return true; 33 | } 34 | 35 | buffer.reset(); 36 | } 37 | 38 | return false; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/ConversionType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ConversionType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | public enum ConversionType { 20 | IDENTITY, 21 | IMPLICIT, 22 | EXPLICIT, 23 | EXPLICIT_TO_UNBOXED, 24 | NONE 25 | } 26 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/FieldMetadataVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * FieldMetadataVisitor.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | public interface FieldMetadataVisitor { 23 | R visitField(final FieldReference f, final P p); 24 | } 25 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/GenericParameterType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * GenericParameterType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | public enum GenericParameterType { 20 | Type, 21 | Method 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/IAnnotationsProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IAnnotationsProvider.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | import com.strobel.assembler.metadata.annotations.CustomAnnotation; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * @author Mike Strobel 25 | */ 26 | public interface IAnnotationsProvider { 27 | boolean hasAnnotations(); 28 | List getAnnotations(); 29 | } 30 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/ICapturedType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ICapturedType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | public interface ICapturedType { 23 | TypeReference getWildcard(); 24 | } 25 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/IClassSignature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IClassSignature.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | import java.util.List; 20 | 21 | public interface IClassSignature extends IGenericParameterProvider { 22 | public TypeReference getBaseType(); 23 | public List getExplicitInterfaces(); 24 | public boolean hasGenericParameters(); 25 | public List getGenericParameters(); 26 | } 27 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/IConstantValueProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IConstantValueProvider.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | public interface IConstantValueProvider { 23 | boolean hasConstantValue(); 24 | Object getConstantValue(); 25 | } 26 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/IGenericContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IGenericContext.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | public interface IGenericContext { 23 | public GenericParameter findTypeVariable(final String name); 24 | } 25 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/IGenericInstance.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IGenericInstance.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | import java.util.List; 20 | 21 | public interface IGenericInstance { 22 | boolean hasTypeArguments(); 23 | List getTypeArguments(); 24 | IGenericParameterProvider getGenericDefinition(); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/IGenericParameterProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IGenericParameterProvider.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | import java.util.List; 20 | 21 | public interface IGenericParameterProvider { 22 | boolean hasGenericParameters(); 23 | boolean isGenericDefinition(); 24 | List getGenericParameters(); 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/IMemberDefinition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IMemberDefinition.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | /** 20 | * User: Mike Strobel 21 | * Date: 1/6/13 22 | * Time: 5:37 PM 23 | */ 24 | public interface IMemberDefinition { 25 | String getName(); 26 | String getFullName(); 27 | boolean isSpecialName(); 28 | TypeReference getDeclaringType(); 29 | long getFlags(); 30 | int getModifiers(); 31 | boolean isFinal(); 32 | boolean isNonPublic(); 33 | boolean isPrivate(); 34 | boolean isProtected(); 35 | boolean isPublic(); 36 | boolean isStatic(); 37 | boolean isSynthetic(); 38 | boolean isDeprecated(); 39 | boolean isPackagePrivate(); 40 | String getBriefDescription(); 41 | String getDescription(); 42 | String getErasedDescription(); 43 | String getSimpleDescription(); 44 | } 45 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/IMetadataTypeMember.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IMetadataTypeMember.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | public interface IMetadataTypeMember { 20 | String getName(); 21 | TypeReference getDeclaringType(); 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/IMethodSignature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IMethodSignature.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | import java.util.List; 20 | 21 | public interface IMethodSignature extends IGenericParameterProvider, IGenericContext { 22 | boolean hasParameters(); 23 | List getParameters(); 24 | TypeReference getReturnType(); 25 | List getThrownTypes(); 26 | 27 | String getSignature(); 28 | String getErasedSignature(); 29 | 30 | /** 31 | * Invalidate any signature information. This is not guaranteed to be thread-safe, 32 | * should only be called when a partially constructed method definition changes, e.g., 33 | * by changing the return type or parameter types. 34 | */ 35 | void invalidateSignature(); 36 | } 37 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/IResolverFrame.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IResolverFrame.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | public interface IResolverFrame extends IGenericContext { 23 | public TypeReference findType(final String descriptor); 24 | } 25 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/ITypeLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ITypeLoader.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | public interface ITypeLoader { 23 | public boolean tryLoadType(final String internalName, final Buffer buffer); 24 | } 25 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/IVariableDefinitionProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IVariableDefinitionProvider.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | import com.strobel.assembler.metadata.VariableDefinition; 20 | 21 | import java.util.List; 22 | 23 | public interface IVariableDefinitionProvider { 24 | boolean hasVariables(); 25 | List getVariables(); 26 | } 27 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/MethodBodyParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MethodBodyParseException.java 3 | * 4 | * Copyright (c) 2014 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | public class MethodBodyParseException extends IllegalStateException { 20 | private final static String DEFAULT_MESSAGE = "An error occurred while parsing a method body."; 21 | 22 | public MethodBodyParseException() { 23 | this(DEFAULT_MESSAGE); 24 | } 25 | 26 | public MethodBodyParseException(final Throwable cause) { 27 | this(DEFAULT_MESSAGE, cause); 28 | } 29 | 30 | public MethodBodyParseException(final String message) { 31 | super(message); 32 | } 33 | 34 | public MethodBodyParseException(final String message, final Throwable cause) { 35 | super(message, cause); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/MethodHandleType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MethodHandleType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | public enum MethodHandleType { 20 | GetField, 21 | GetStatic, 22 | PutField, 23 | PutStatic, 24 | InvokeVirtual, 25 | InvokeStatic, 26 | InvokeSpecial, 27 | NewInvokeSpecial, 28 | InvokeInterface; 29 | } 30 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/MethodMetadataVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MethodMetadataVisitor.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | public interface MethodMetadataVisitor { 23 | R visitParameterizedMethod(final MethodReference m, final P p); 24 | R visitMethod(final MethodReference m, final P p); 25 | } 26 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/TypeRelation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * TypeRelation.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata; 18 | 19 | public abstract class TypeRelation extends DefaultTypeVisitor { 20 | } 21 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/annotations/AnnotationAnnotationElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * AnnotationAnnotationElement.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata.annotations; 18 | 19 | import com.strobel.core.VerifyArgument; 20 | 21 | /** 22 | * @author Mike Strobel 23 | */ 24 | public final class AnnotationAnnotationElement extends AnnotationElement { 25 | private final CustomAnnotation _annotation; 26 | 27 | public AnnotationAnnotationElement(final CustomAnnotation annotation) { 28 | super(AnnotationElementType.Annotation); 29 | _annotation = VerifyArgument.notNull(annotation, "annotation"); 30 | } 31 | 32 | public CustomAnnotation getAnnotation() { 33 | return _annotation; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/annotations/AnnotationElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * AnnotationElement.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata.annotations; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | public abstract class AnnotationElement { 23 | private final AnnotationElementType _elementType; 24 | 25 | protected AnnotationElement(final AnnotationElementType elementType) { 26 | _elementType = elementType; 27 | } 28 | 29 | public AnnotationElementType getElementType() { 30 | return _elementType; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/annotations/AnnotationParameter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * AnnotationParameter.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata.annotations; 18 | 19 | import com.strobel.core.VerifyArgument; 20 | 21 | /** 22 | * @author Mike Strobel 23 | */ 24 | public final class AnnotationParameter { 25 | private final AnnotationElement _value; 26 | private final String _member; 27 | 28 | public AnnotationParameter(final String member, final AnnotationElement value) { 29 | _member = VerifyArgument.notNull(member, "member"); 30 | _value = VerifyArgument.notNull(value, "value"); 31 | } 32 | 33 | public final String getMember() { 34 | return _member; 35 | } 36 | 37 | public final AnnotationElement getValue() { 38 | return _value; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/annotations/ArrayAnnotationElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ArrayAnnotationElement.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata.annotations; 18 | 19 | import com.strobel.core.VerifyArgument; 20 | 21 | /** 22 | * @author Mike Strobel 23 | */ 24 | public final class ArrayAnnotationElement extends AnnotationElement { 25 | private final AnnotationElement[] _elements; 26 | 27 | public ArrayAnnotationElement(final AnnotationElement[] elements) { 28 | super(AnnotationElementType.Array); 29 | _elements = VerifyArgument.notNull(elements, "elements"); 30 | } 31 | 32 | public AnnotationElement[] getElements() { 33 | return _elements; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/annotations/ClassAnnotationElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ClassAnnotationElement.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata.annotations; 18 | 19 | import com.strobel.assembler.metadata.TypeReference; 20 | 21 | /** 22 | * @author Mike Strobel 23 | */ 24 | public final class ClassAnnotationElement extends AnnotationElement { 25 | private final TypeReference _classType; 26 | 27 | public ClassAnnotationElement(final TypeReference classType) { 28 | super(AnnotationElementType.Class); 29 | _classType = classType; 30 | } 31 | 32 | public TypeReference getClassType() { 33 | return _classType; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/annotations/ConstantAnnotationElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ConstantAnnotationElement.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.assembler.metadata.annotations; 18 | 19 | import com.strobel.core.VerifyArgument; 20 | 21 | /** 22 | * @author Mike Strobel 23 | */ 24 | public final class ConstantAnnotationElement extends AnnotationElement { 25 | private final Object _constantValue; 26 | 27 | public ConstantAnnotationElement(final Object constantValue) { 28 | super(AnnotationElementType.Constant); 29 | _constantValue = VerifyArgument.notNull(constantValue, "constantValue"); 30 | } 31 | 32 | public Object getConstantValue() { 33 | return _constantValue; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/signatures/BaseType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | 26 | package com.strobel.assembler.metadata.signatures; 27 | 28 | public interface BaseType extends TypeSignature {} 29 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/signatures/FieldTypeSignature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | 26 | package com.strobel.assembler.metadata.signatures; 27 | 28 | public interface FieldTypeSignature extends BaseType, TypeSignature, TypeArgument {} 29 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/signatures/ReturnType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | 26 | package com.strobel.assembler.metadata.signatures; 27 | 28 | public interface ReturnType extends TypeTree {} 29 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/signatures/Signature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | 26 | package com.strobel.assembler.metadata.signatures; 27 | 28 | public interface Signature extends Tree { 29 | FormalTypeParameter[] getFormalTypeParameters(); 30 | } 31 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/signatures/Tree.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | 26 | package com.strobel.assembler.metadata.signatures; 27 | 28 | /** 29 | * Root of the abstract syntax tree hierarchy for generic signatures 30 | */ 31 | public interface Tree {} 32 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/signatures/TypeArgument.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | 26 | package com.strobel.assembler.metadata.signatures; 27 | 28 | public interface TypeArgument extends TypeTree {} 29 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/signatures/TypeSignature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | 26 | package com.strobel.assembler.metadata.signatures; 27 | 28 | public interface TypeSignature extends ReturnType {} 29 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/signatures/TypeTree.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | 26 | package com.strobel.assembler.metadata.signatures; 27 | 28 | public interface TypeTree extends Tree { 29 | void accept(TypeTreeVisitor v); 30 | } 31 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/signatures/Visitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | 26 | package com.strobel.assembler.metadata.signatures; 27 | 28 | public interface Visitor extends TypeTreeVisitor { 29 | void visitClassSignature(ClassSignature cs); 30 | void visitMethodTypeSignature(MethodTypeSignature ms); 31 | } 32 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/DecompilationOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DecompilationOptions.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler; 18 | 19 | public class DecompilationOptions { 20 | private boolean _fullDecompilation = true; 21 | private DecompilerSettings _settings; 22 | 23 | public final boolean isFullDecompilation() { 24 | return _fullDecompilation; 25 | } 26 | 27 | public final void setFullDecompilation(final boolean fullDecompilation) { 28 | _fullDecompilation = fullDecompilation; 29 | } 30 | 31 | public final DecompilerSettings getSettings() { 32 | if (_settings == null) { 33 | _settings = new DecompilerSettings(); 34 | } 35 | return _settings; 36 | } 37 | 38 | public final void setSettings(final DecompilerSettings settings) { 39 | _settings = settings; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/NameSyntax.java: -------------------------------------------------------------------------------- 1 | /* 2 | * NameSyntax.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler; 18 | 19 | public enum NameSyntax { 20 | SIGNATURE, 21 | ERASED_SIGNATURE, 22 | DESCRIPTOR, 23 | TYPE_NAME, 24 | SHORT_TYPE_NAME 25 | } 26 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/ast/AstKeys.java: -------------------------------------------------------------------------------- 1 | /* 2 | * AstKeys.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.ast; 18 | 19 | import com.strobel.assembler.metadata.SwitchInfo; 20 | import com.strobel.assembler.metadata.TypeReference; 21 | import com.strobel.componentmodel.Key; 22 | import com.strobel.util.ContractUtils; 23 | 24 | import java.util.List; 25 | 26 | public final class AstKeys { 27 | public final static Key SWITCH_INFO = Key.create("SwitchInfo"); 28 | public final static Key PARENT_LAMBDA_BINDING = Key.create("ParentLambdaBinding"); 29 | public final static Key> TYPE_ARGUMENTS = Key.create("TypeArguments"); 30 | 31 | private AstKeys() { 32 | throw ContractUtils.unreachable(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/ast/Error.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Error.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.ast; 18 | 19 | import com.strobel.util.ContractUtils; 20 | 21 | final class Error { 22 | private Error() { 23 | throw ContractUtils.unreachable(); 24 | } 25 | 26 | public static RuntimeException expressionLinkedFromMultipleLocations(final Node node) { 27 | return new IllegalStateException("Expression is linked from several locations: " + node); 28 | } 29 | 30 | public static RuntimeException unsupportedNode(final Node node) { 31 | final String nodeType = node != null ? node.getClass().getName() : String.valueOf(node); 32 | return new IllegalStateException("Unsupported node type: " + nodeType); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/ast/Label.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Label.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.ast; 18 | 19 | import com.strobel.decompiler.ITextOutput; 20 | 21 | public class Label extends Node { 22 | private String _name; 23 | private int _offset = -1; 24 | 25 | public Label() { 26 | } 27 | 28 | public Label(final String name) { 29 | _name = name; 30 | } 31 | 32 | public String getName() { 33 | return _name; 34 | } 35 | 36 | public void setName(final String name) { 37 | _name = name; 38 | } 39 | 40 | public int getOffset() { 41 | return _offset; 42 | } 43 | 44 | public void setOffset(final int offset) { 45 | _offset = offset; 46 | } 47 | 48 | @Override 49 | public void writeTo(final ITextOutput output) { 50 | output.writeDefinition(getName() + ":", this); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/ast/LoopType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * LoopType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.ast; 18 | 19 | public enum LoopType { 20 | PreCondition, 21 | PostCondition 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/EntityType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * EntityType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages; 18 | 19 | public enum EntityType { 20 | NONE, 21 | TYPE_DEFINITION, 22 | ENUM_VALUE, 23 | FIELD, 24 | METHOD, 25 | CONSTRUCTOR, 26 | PARAMETER 27 | } 28 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/BraceEnforcement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * BraceEnforcement.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java; 18 | 19 | public enum BraceEnforcement { 20 | DoNotChange, 21 | RemoveBraces, 22 | AddBraces, 23 | // AddBracesForMultiLine, 24 | // AddBracesForMultiLineOrAdjacent 25 | } 26 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/BraceStyle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * BraceStyle.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java; 18 | 19 | public enum BraceStyle { 20 | DoNotChange, 21 | EndOfLine, 22 | EndOfLineWithoutSpace, 23 | NextLine, 24 | NextLineShifted, 25 | NextLineShifted2, 26 | BannerStyle 27 | } 28 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/OffsetToLineNumberConverter.java: -------------------------------------------------------------------------------- 1 | package com.strobel.decompiler.languages.java; 2 | 3 | /** 4 | * An instance capable of converting from a raw bytecode offset number to a Java 5 | * source code line number. 6 | */ 7 | public interface OffsetToLineNumberConverter { 8 | /** 9 | * indicates that the line number is unknown 10 | */ 11 | public static final int UNKNOWN_LINE_NUMBER = -100; 12 | 13 | /** 14 | * a do-nothing offset-to-line-number converter which always returns {@link #UNKNOWN_LINE_NUMBER} 15 | */ 16 | public static final OffsetToLineNumberConverter NOOP_CONVERTER = new OffsetToLineNumberConverter() { 17 | @Override 18 | public int getLineForOffset(int offset) { return UNKNOWN_LINE_NUMBER; } 19 | }; 20 | 21 | /** 22 | * Given a raw bytecode offset number, returns the corresponding Java line number. 23 | * If there is no exact match for 'offset', returns the previous exact-match line number. 24 | * 25 | * @param offset a raw bytecode offset 26 | * @return the corresponding Java source code line number 27 | */ 28 | public int getLineForOffset( int offset); 29 | } 30 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/Wrapping.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Wrapping.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java; 18 | 19 | public enum Wrapping { 20 | DoNotWrap, 21 | WrapAlways, 22 | WrapIfTooLong 23 | } 24 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/analysis/ControlFlowEdgeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ControlFlowEdgeType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.analysis; 18 | 19 | public enum ControlFlowEdgeType { 20 | /** 21 | * Regular control flow. 22 | */ 23 | Normal, 24 | 25 | /** 26 | * Conditional control flow (edge taken if condition is true) 27 | */ 28 | ConditionTrue, 29 | 30 | /** 31 | * Conditional control flow (edge taken if condition is false) 32 | */ 33 | ConditionFalse, 34 | 35 | /** 36 | * A jump statement (goto, goto case, break or continue) 37 | */ 38 | Jump 39 | } -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/analysis/ControlFlowNodeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ControlFlowNodeType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.analysis; 18 | 19 | public enum ControlFlowNodeType { 20 | /** 21 | * Unknown node type 22 | */ 23 | None, 24 | 25 | /** 26 | * Node in front of a statement 27 | */ 28 | StartNode, 29 | 30 | /** 31 | * Node between two statements 32 | */ 33 | BetweenStatements, 34 | 35 | /** 36 | * Node at the end of a statement list 37 | */ 38 | EndNode, 39 | 40 | /** 41 | * Node representing the position before evaluating the condition of a loop. 42 | */ 43 | LoopCondition 44 | } 45 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/analysis/UsageType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * UsageType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.analysis; 18 | 19 | public enum UsageType { 20 | Read, 21 | Write, 22 | ReadWrite 23 | } 24 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/ast/AssignmentOperatorType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * AssignmentOperatorType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.ast; 18 | 19 | public enum AssignmentOperatorType { 20 | ASSIGN, 21 | ADD, 22 | SUBTRACT, 23 | MULTIPLY, 24 | DIVIDE, 25 | MODULUS, 26 | SHIFT_LEFT, 27 | SHIFT_RIGHT, 28 | UNSIGNED_SHIFT_RIGHT, 29 | BITWISE_AND, 30 | BITWISE_OR, 31 | EXCLUSIVE_OR, 32 | ANY; 33 | 34 | public final boolean isCompoundAssignment() { 35 | switch (this) { 36 | case ASSIGN: 37 | case ANY: 38 | return false; 39 | 40 | default: 41 | return true; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/ast/ClassType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ClassType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.ast; 18 | 19 | public enum ClassType 20 | { 21 | CLASS, 22 | INTERFACE, 23 | ANNOTATION, 24 | ENUM 25 | } 26 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/ast/CommentType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CommentType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.ast; 18 | 19 | public enum CommentType { 20 | SingleLine, 21 | MultiLine, 22 | Documentation 23 | } 24 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/ast/ConstructorInitializerType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ConstructorInitializerType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.ast; 18 | 19 | public enum ConstructorInitializerType { 20 | SUPER, 21 | THIS 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/ast/MacNewLine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MacNewLine.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.ast; 18 | 19 | import com.strobel.decompiler.languages.TextLocation; 20 | import com.strobel.decompiler.patterns.INode; 21 | import com.strobel.decompiler.patterns.Match; 22 | 23 | public final class MacNewLine extends NewLineNode { 24 | @Override 25 | public NewLineType getNewLineType() { 26 | return NewLineType.UNIX; 27 | } 28 | 29 | public MacNewLine() { 30 | super(); 31 | } 32 | 33 | public MacNewLine(final TextLocation startLocation) { 34 | super(startLocation); 35 | } 36 | 37 | @Override 38 | public boolean matches(final INode other, final Match match) { 39 | return other instanceof UnixNewLine; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/ast/NameResolveMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * NameResolveMode.java 3 | * 4 | * Copyright (c) 2014 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.ast; 18 | 19 | public enum NameResolveMode { 20 | TYPE, 21 | EXPRESSION 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/ast/NameResolveResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * NameResolveResult.java 3 | * 4 | * Copyright (c) 2014 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.ast; 18 | 19 | import com.strobel.assembler.metadata.IMetadataTypeMember; 20 | 21 | import java.util.List; 22 | 23 | public abstract class NameResolveResult { 24 | public abstract List getCandidates(); 25 | 26 | public abstract NameResolveMode getMode(); 27 | 28 | public boolean hasMatch() { 29 | return !getCandidates().isEmpty(); 30 | } 31 | 32 | public boolean isAmbiguous() { 33 | return getCandidates().size() > 1; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/ast/NewLineType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * NewLineType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.ast; 18 | 19 | public enum NewLineType { 20 | UNIX, 21 | WINDOWS, 22 | MAC 23 | } 24 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/ast/NodeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * NodeType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.ast; 18 | 19 | public enum NodeType { 20 | UNKNOWN, 21 | TYPE_REFERENCE, 22 | TYPE_DECLARATION, 23 | MEMBER, 24 | STATEMENT, 25 | EXPRESSION, 26 | TOKEN, 27 | WHITESPACE, 28 | PATTERN 29 | } 30 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/ast/SimpleNameLookupMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SimpleNameLookupMode.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.ast; 18 | 19 | public enum SimpleNameLookupMode { 20 | EXPRESSION, 21 | INVOCATION_TARGET, 22 | TYPE, 23 | TYPE_IN_IMPORT_DECLARATION, 24 | BASE_TYPE_REFERENCE 25 | } 26 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/ast/UnaryOperatorType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * UnaryOperatorType.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.ast; 18 | 19 | public enum UnaryOperatorType 20 | { 21 | ANY, 22 | NOT, 23 | BITWISE_NOT, 24 | MINUS, 25 | PLUS, 26 | INCREMENT, 27 | DECREMENT, 28 | POST_INCREMENT, 29 | POST_DECREMENT, 30 | } 31 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/ast/UnixNewLine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * UnixNewLine.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.ast; 18 | 19 | import com.strobel.decompiler.languages.TextLocation; 20 | import com.strobel.decompiler.patterns.INode; 21 | import com.strobel.decompiler.patterns.Match; 22 | 23 | public final class UnixNewLine extends NewLineNode { 24 | @Override 25 | public NewLineType getNewLineType() { 26 | return NewLineType.UNIX; 27 | } 28 | 29 | public UnixNewLine() { 30 | super(); 31 | } 32 | 33 | public UnixNewLine(final TextLocation startLocation) { 34 | super(startLocation); 35 | } 36 | 37 | @Override 38 | public boolean matches(final INode other, final Match match) { 39 | return other instanceof UnixNewLine; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/ast/WindowsNewLine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * WindowsNewLine.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.ast; 18 | 19 | import com.strobel.decompiler.languages.TextLocation; 20 | import com.strobel.decompiler.patterns.INode; 21 | import com.strobel.decompiler.patterns.Match; 22 | 23 | public final class WindowsNewLine extends NewLineNode { 24 | @Override 25 | public NewLineType getNewLineType() { 26 | return NewLineType.WINDOWS; 27 | } 28 | 29 | public WindowsNewLine() { 30 | super(); 31 | } 32 | 33 | public WindowsNewLine(final TextLocation startLocation) { 34 | super(startLocation); 35 | } 36 | 37 | @Override 38 | public boolean matches(final INode other, final Match match) { 39 | return other instanceof UnixNewLine; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/languages/java/ast/transforms/IAstTransform.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IAstTransform.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.languages.java.ast.transforms; 18 | 19 | import com.strobel.decompiler.languages.java.ast.AstNode; 20 | 21 | public interface IAstTransform { 22 | void run(final AstNode compilationUnit); 23 | } 24 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/patterns/AnyNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * AnyNode.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.patterns; 18 | 19 | public final class AnyNode extends Pattern { 20 | private final String _groupName; 21 | 22 | public AnyNode() { 23 | _groupName = null; 24 | } 25 | 26 | public AnyNode(final String groupName) { 27 | _groupName = groupName; 28 | } 29 | 30 | public final String getGroupName() { 31 | return _groupName; 32 | } 33 | 34 | @Override 35 | public final boolean matches(final INode other, final Match match) { 36 | match.add(_groupName, other); 37 | return other != null && !other.isNull(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/patterns/BackReference.java: -------------------------------------------------------------------------------- 1 | /* 2 | * BackReference.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.patterns; 18 | 19 | import static com.strobel.core.CollectionUtilities.lastOrDefault; 20 | 21 | public final class BackReference extends Pattern { 22 | private final String _referencedGroupName; 23 | 24 | public BackReference(final String referencedGroupName) { 25 | _referencedGroupName = referencedGroupName; 26 | } 27 | 28 | public final String getReferencedGroupName() { 29 | return _referencedGroupName; 30 | } 31 | 32 | @Override 33 | public final boolean matches(final INode other, final Match match) { 34 | final INode node = lastOrDefault(match.get(_referencedGroupName)); 35 | return node != null && node.matches(other); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/patterns/BacktrackingInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * BacktrackingInfo.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.patterns; 18 | 19 | import java.util.Stack; 20 | 21 | public class BacktrackingInfo { 22 | final Stack stack = new Stack<>(); 23 | } 24 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/patterns/NamedNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * NamedNode.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.patterns; 18 | 19 | import com.strobel.core.VerifyArgument; 20 | 21 | public final class NamedNode extends Pattern { 22 | private final String _groupName; 23 | private final INode _node; 24 | 25 | public NamedNode(final String groupName, final INode node) { 26 | _groupName = groupName; 27 | _node = VerifyArgument.notNull(node, "node"); 28 | } 29 | 30 | public final String getGroupName() { 31 | return _groupName; 32 | } 33 | 34 | public final INode getNode() { 35 | return _node; 36 | } 37 | 38 | @Override 39 | public final boolean matches(final INode other, final Match match) { 40 | match.add(_groupName, other); 41 | return _node.matches(other, match); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/patterns/PossibleMatch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * PossibleMatch.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.patterns; 18 | 19 | final class PossibleMatch { 20 | final INode nextOther; 21 | final int checkPoint; 22 | 23 | PossibleMatch(final INode nextOther, final int checkPoint) { 24 | this.nextOther = nextOther; 25 | this.checkPoint = checkPoint; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/types/ITypeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ITypeListener.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.types; 18 | 19 | interface ITypeListener { 20 | void onChanged(); 21 | } 22 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/main/java/com/strobel/decompiler/types/TypeManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * TypeManager.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is based on Mono.Cecil from Jb Evain, Copyright (c) Jb Evain; 7 | * and ILSpy/ICSharpCode from SharpDevelop, Copyright (c) AlphaSierraPapa. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.decompiler.types; 18 | 19 | class TypeManager { 20 | } 21 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/java/com/strobel/decompiler/ImportTests.java: -------------------------------------------------------------------------------- 1 | package com.strobel.decompiler; 2 | 3 | import com.strobel.assembler.Collection; 4 | import org.junit.Test; 5 | 6 | public class ImportTests extends DecompilerTest { 7 | @SuppressWarnings("UnusedDeclaration") 8 | private abstract class A implements java.util.Collection { 9 | private Collection innerCollection; 10 | } 11 | 12 | @Test 13 | public void testImportCollision() throws Throwable { 14 | verifyOutput( 15 | A.class, 16 | defaultSettings(), 17 | "private abstract class A implements Collection {\n" + 18 | " private com.strobel.assembler.Collection innerCollection;\n" + 19 | "}\n" 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/java/com/strobel/decompiler/InitializerTests.java: -------------------------------------------------------------------------------- 1 | package com.strobel.decompiler; 2 | 3 | import org.junit.Test; 4 | 5 | public class InitializerTests extends DecompilerTest { 6 | private static class A { 7 | static final int c = 42; 8 | final int i = 42; 9 | } 10 | 11 | @Test 12 | public void testConstantNotInitializedInConstructor() throws Throwable { 13 | verifyOutput( 14 | A.class, 15 | defaultSettings(), 16 | "private static class A {\n" + 17 | " static final int c = 42;\n" + 18 | " final int i = 42;\n" + 19 | "}\n" 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/java/com/strobel/decompiler/InliningTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * InliningTests.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.decompiler; 15 | 16 | import org.junit.Test; 17 | 18 | public class InliningTests extends DecompilerTest { 19 | private final static class A { 20 | int x; 21 | 22 | public int test(final A a) { 23 | final A result = new A(); 24 | return result.x - result.x; 25 | } 26 | } 27 | 28 | @Test 29 | public void testDeclarationNotInlinedIntoSelfReferencingAssignment() { 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/java/com/strobel/decompiler/StringTests.java: -------------------------------------------------------------------------------- 1 | package com.strobel.decompiler; 2 | 3 | import org.junit.Test; 4 | 5 | public class StringTests extends DecompilerTest { 6 | private static class A { 7 | public String test() { 8 | return "\0\b\f\t\r\n\""; 9 | } 10 | } 11 | 12 | @Test 13 | public void testStringEscaping() throws Throwable { 14 | verifyOutput( 15 | A.class, 16 | defaultSettings(), 17 | "private static class A {\n" + 18 | " public String test() {\n" + 19 | " return \"\\u0000\\b\\f\\t\\r\\n\\\"\";\n" + 20 | " }\n" + 21 | "}\n" 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/resources/ArgumentTypes.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/Procyon.CompilerTools/src/test/resources/ArgumentTypes.class -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/resources/Circle.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/Procyon.CompilerTools/src/test/resources/Circle.class -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/resources/Drawable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/Procyon.CompilerTools/src/test/resources/Drawable.class -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/resources/Hello.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/Procyon.CompilerTools/src/test/resources/Hello.class -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/resources/Issue216GotoWVulnerability.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/Procyon.CompilerTools/src/test/resources/Issue216GotoWVulnerability.class -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/resources/JsrWithoutRet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/Procyon.CompilerTools/src/test/resources/JsrWithoutRet.class -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/resources/JsrWithoutRet.j: -------------------------------------------------------------------------------- 1 | .version 49 0 2 | .source JsrWithoutRet.java 3 | .class super public JsrWithoutRet 4 | .super java/lang/Object 5 | 6 | .method public : ()V 7 | .limit stack 1 8 | .limit locals 1 9 | 10 | aload_0 11 | invokespecial java/lang/Object ()V 12 | return 13 | .end method 14 | 15 | .method static public main : ([Ljava/lang/String;)V 16 | .limit stack 2 17 | .limit locals 1 18 | goto first 19 | second: 20 | pop 21 | getstatic java/lang/System out Ljava/io/PrintStream; 22 | ldc 'Hello world' 23 | invokevirtual java/io/PrintStream println (Ljava/lang/String;)V 24 | goto third 25 | first: 26 | jsr_w second 27 | third: 28 | return 29 | .end method 30 | -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/resources/LiteralAssignments.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/Procyon.CompilerTools/src/test/resources/LiteralAssignments.class -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/resources/OddsAndEnds.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/Procyon.CompilerTools/src/test/resources/OddsAndEnds.class -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/resources/Rectangle.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/Procyon.CompilerTools/src/test/resources/Rectangle.class -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/resources/SkipJSR.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/Procyon.CompilerTools/src/test/resources/SkipJSR.class -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/resources/SootOptimizationTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/Procyon.CompilerTools/src/test/resources/SootOptimizationTest.class -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/resources/Switch.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/Procyon.CompilerTools/src/test/resources/Switch.class -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/resources/UnboxToNumber.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/Procyon.CompilerTools/src/test/resources/UnboxToNumber.class -------------------------------------------------------------------------------- /Procyon.CompilerTools/src/test/resources/WhileLoops.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/Procyon.CompilerTools/src/test/resources/WhileLoops.class -------------------------------------------------------------------------------- /Procyon.Core/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | see Expressions build.gradle file for surefire plugin 3 | */ -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/Procyon.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Framework.java 3 | * 4 | * Copyright (c) 2015 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel; 15 | 16 | public final class Procyon { 17 | private static final String VERSION = "0.5.32"; 18 | 19 | public static String version() { 20 | return VERSION; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/annotations/NotNull.java: -------------------------------------------------------------------------------- 1 | /* 2 | * NotNull.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.annotations; 15 | 16 | import java.lang.annotation.Documented; 17 | import java.lang.annotation.ElementType; 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.RetentionPolicy; 20 | import java.lang.annotation.Target; 21 | 22 | @Documented 23 | @Retention(RetentionPolicy.CLASS) 24 | @Target({ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE }) 25 | public @interface NotNull { 26 | java.lang.String value() default ""; 27 | } -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/annotations/Nullable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Nullable.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.annotations; 15 | 16 | import java.lang.annotation.Documented; 17 | import java.lang.annotation.ElementType; 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.RetentionPolicy; 20 | import java.lang.annotation.Target; 21 | 22 | @Documented 23 | @Retention(RetentionPolicy.CLASS) 24 | @Target({ 25 | ElementType.METHOD, 26 | ElementType.FIELD, 27 | ElementType.PARAMETER, 28 | ElementType.LOCAL_VARIABLE 29 | }) 30 | public @interface Nullable { 31 | java.lang.String value() default ""; 32 | } -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/collections/ArrayIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ArrayIterator.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.collections; 15 | 16 | import com.strobel.core.VerifyArgument; 17 | import com.strobel.util.ContractUtils; 18 | 19 | import java.util.Iterator; 20 | 21 | /** 22 | * @author strobelm 23 | */ 24 | public final class ArrayIterator implements Iterator { 25 | private final E[] _elements; 26 | private int _index; 27 | 28 | public ArrayIterator(final E[] elements) { 29 | _elements = VerifyArgument.notNull(elements, "elements"); 30 | } 31 | 32 | @Override 33 | public boolean hasNext() { 34 | return _index < _elements.length; 35 | } 36 | 37 | @Override 38 | public E next() { 39 | return _elements[_index++]; 40 | } 41 | 42 | @Override 43 | public void remove() { 44 | throw ContractUtils.unsupported(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/collections/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Constants.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.collections; 15 | 16 | /** 17 | * @author strobelm 18 | */ 19 | final class Constants { 20 | /** 21 | * The default value that represents for {@code int} types. 22 | */ 23 | public static final int DEFAULT_INT_NO_ENTRY_VALUE; 24 | 25 | static { 26 | final int value; 27 | final String property = System.getProperty("gnu.trove.no_entry.int", "0"); 28 | 29 | if ("MAX_VALUE".equalsIgnoreCase(property)) { 30 | value = Integer.MAX_VALUE; 31 | } 32 | else if ("MIN_VALUE".equalsIgnoreCase(property)) { 33 | value = Integer.MIN_VALUE; 34 | } 35 | else { 36 | value = Integer.valueOf(property); 37 | } 38 | 39 | DEFAULT_INT_NO_ENTRY_VALUE = value; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/collections/concurrent/ConcurrentIntObjectMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ConcurrentIntObjectMap.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.collections.concurrent; 15 | 16 | import com.strobel.annotations.NotNull; 17 | import com.strobel.annotations.Nullable; 18 | 19 | public interface ConcurrentIntObjectMap { 20 | @NotNull 21 | V addOrGet(final int key, @NotNull final V value); 22 | 23 | boolean remove(final int key, @NotNull final V value); 24 | boolean replace(final int key, @NotNull final V oldValue, @NotNull final V newValue); 25 | 26 | @Nullable 27 | V put(final int key, @NotNull final V value); 28 | V putIfAbsent(final int key, @NotNull final V value); 29 | 30 | @Nullable 31 | V get(final int key); 32 | 33 | @Nullable 34 | V remove(final int key); 35 | 36 | int size(); 37 | boolean isEmpty(); 38 | boolean contains(final int key); 39 | void clear(); 40 | 41 | @NotNull 42 | int[] keys(); 43 | 44 | @NotNull 45 | Iterable> entries(); 46 | } 47 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/collections/concurrent/IntObjectEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IntObjectEntry.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.collections.concurrent; 15 | 16 | import com.strobel.annotations.NotNull; 17 | 18 | public interface IntObjectEntry { 19 | int key(); 20 | @NotNull 21 | V value(); 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/compilerservices/CallerResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CallerResolver.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.compilerservices; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public final class CallerResolver extends SecurityManager { 20 | private static final CallerResolver CALLER_RESOLVER = new CallerResolver(); 21 | private static final int CALL_CONTEXT_OFFSET = 3; // may need to change if this class is redesigned 22 | 23 | protected Class[] getClassContext() { 24 | return super.getClassContext(); 25 | } 26 | 27 | /** 28 | * Indexes into the current method call context with a given offset. 29 | */ 30 | public static Class getCallerClass(final int callerOffset) { 31 | return CALLER_RESOLVER.getClassContext()[CALL_CONTEXT_OFFSET + callerOffset]; 32 | } 33 | 34 | public static int getContextSize(final int callerOffset) { 35 | return CALLER_RESOLVER.getClassContext().length - callerOffset; 36 | } 37 | 38 | public static int getContextSize() { 39 | return getContextSize(CALL_CONTEXT_OFFSET); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/componentmodel/UserDataStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * UserDataStore.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.componentmodel; 15 | 16 | public interface UserDataStore { 17 | T getUserData(final Key key); 18 | void putUserData(final Key key, final T value); 19 | T putUserDataIfAbsent(final Key key, final T value); 20 | boolean replace(final Key key, final T oldValue, final T newValue); 21 | } 22 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/concurrent/StripedReentrantLock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * StripedReentrantLock.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.concurrent; 15 | 16 | import com.strobel.annotations.NotNull; 17 | 18 | import java.util.concurrent.locks.ReentrantLock; 19 | 20 | public final class StripedReentrantLock extends StripedLock { 21 | private final static StripedReentrantLock INSTANCE = new StripedReentrantLock(); 22 | 23 | public static StripedReentrantLock instance() { 24 | return INSTANCE; 25 | } 26 | 27 | public StripedReentrantLock() { 28 | super(ReentrantLock.class); 29 | } 30 | 31 | @NotNull 32 | @Override 33 | protected final ReentrantLock createLock() { 34 | return new ReentrantLock(); 35 | } 36 | 37 | @Override 38 | public final void lock(final int index) { 39 | locks[index].lock(); 40 | } 41 | 42 | @Override 43 | public final void unlock(final int index) { 44 | locks[index].unlock(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/Accumulator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Accumulator.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public interface Accumulator { 20 | TAccumulate accumulate(final TAccumulate accumulate, final TSource item); 21 | } 22 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/Aggregator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Aggregator.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public interface Aggregator { 20 | TResult aggregate( 21 | final TSource source, 22 | final TAccumulate seed, 23 | final Accumulator accumulator, 24 | final Selector resultSelector); 25 | } 26 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/BooleanBox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * BooleanBox.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | @SuppressWarnings("PublicField") 17 | public final class BooleanBox implements IStrongBox { 18 | public boolean value; 19 | 20 | public BooleanBox() {} 21 | 22 | public BooleanBox(final boolean value) { 23 | this.value = value; 24 | } 25 | 26 | @Override 27 | public Boolean get() { 28 | return this.value; 29 | } 30 | 31 | @Override 32 | @SuppressWarnings("unchecked") 33 | public void set(final Object value) { 34 | this.value = (Boolean) value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/ByteBox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ByteBox.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | @SuppressWarnings("PublicField") 17 | public final class ByteBox implements IStrongBox { 18 | public byte value; 19 | 20 | public ByteBox() {} 21 | 22 | public ByteBox(final byte value) { 23 | this.value = value; 24 | } 25 | 26 | @Override 27 | public Byte get() { 28 | return this.value; 29 | } 30 | 31 | @Override 32 | @SuppressWarnings("unchecked") 33 | public void set(final Object value) { 34 | this.value = (Byte) value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/CharacterBox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CharacterBox.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | @SuppressWarnings("PublicField") 17 | public final class CharacterBox implements IStrongBox { 18 | public char value; 19 | 20 | public CharacterBox() {} 21 | 22 | public CharacterBox(final char value) { 23 | this.value = value; 24 | } 25 | 26 | @Override 27 | public Character get() { 28 | return this.value; 29 | } 30 | 31 | @Override 32 | @SuppressWarnings("unchecked") 33 | public void set(final Object value) { 34 | this.value = (Character) value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/DoubleBox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DoubleBox.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | @SuppressWarnings("PublicField") 17 | public final class DoubleBox implements IStrongBox { 18 | public double value; 19 | 20 | public DoubleBox() {} 21 | 22 | public DoubleBox(final double value) { 23 | this.value = value; 24 | } 25 | 26 | @Override 27 | public Double get() { 28 | return this.value; 29 | } 30 | 31 | @Override 32 | @SuppressWarnings("unchecked") 33 | public void set(final Object value) { 34 | this.value = (Double) value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/FloatBox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * FloatBox.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | @SuppressWarnings("PublicField") 17 | public final class FloatBox implements IStrongBox { 18 | public float value; 19 | 20 | public FloatBox() {} 21 | 22 | public FloatBox(final float value) { 23 | this.value = value; 24 | } 25 | 26 | @Override 27 | public Float get() { 28 | return this.value; 29 | } 30 | 31 | @Override 32 | @SuppressWarnings("unchecked") 33 | public void set(final Object value) { 34 | this.value = (Float) value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/IEqualityComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IEqualityComparator.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public interface IEqualityComparator { 20 | boolean equals(final T o1, final T o2); 21 | int hash(final T o); 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/IFreezable.java: -------------------------------------------------------------------------------- 1 | package com.strobel.core; 2 | 3 | /** 4 | * @author Mike Strobel 5 | */ 6 | public interface IFreezable { 7 | boolean canFreeze(); 8 | boolean isFrozen(); 9 | void freeze() 10 | throws IllegalStateException; 11 | boolean tryFreeze(); 12 | void freezeIfUnfrozen() throws IllegalStateException; 13 | } 14 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/IReadOnlyList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IReadOnlyList.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | import com.strobel.annotations.NotNull; 17 | 18 | import java.util.ListIterator; 19 | import java.util.RandomAccess; 20 | 21 | /** 22 | * @author Mike Strobel 23 | */ 24 | public interface IReadOnlyList extends Iterable, RandomAccess { 25 | int size(); 26 | 27 | int indexOf(U o); 28 | int lastIndexOf(U o); 29 | 30 | boolean isEmpty(); 31 | boolean contains(U o); 32 | boolean containsAll(Iterable c); 33 | 34 | T get(int index); 35 | 36 | @NotNull 37 | T[] toArray(); 38 | @NotNull 39 | T[] toArray(T[] a); 40 | 41 | @NotNull 42 | ListIterator listIterator(); 43 | 44 | @NotNull 45 | ListIterator listIterator(int index); 46 | } 47 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/IStrongBox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IStrongBox.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | public interface IStrongBox { 17 | Object get(); 18 | void set(final Object value); 19 | } 20 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/IntegerBox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IntegerBox.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | @SuppressWarnings("PublicField") 17 | public final class IntegerBox implements IStrongBox { 18 | public int value; 19 | 20 | public IntegerBox() {} 21 | 22 | public IntegerBox(final int value) { 23 | this.value = value; 24 | } 25 | 26 | @Override 27 | public Integer get() { 28 | return this.value; 29 | } 30 | 31 | @Override 32 | @SuppressWarnings("unchecked") 33 | public void set(final Object value) { 34 | this.value = (Integer) value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/LongBox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * LongBox.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | @SuppressWarnings("PublicField") 17 | public final class LongBox implements IStrongBox { 18 | public long value; 19 | 20 | public LongBox() {} 21 | 22 | public LongBox(final long value) { 23 | this.value = value; 24 | } 25 | 26 | @Override 27 | public Long get() { 28 | return this.value; 29 | } 30 | 31 | @Override 32 | @SuppressWarnings("unchecked") 33 | public void set(final Object value) { 34 | this.value = (Long) value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/Mapping.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Mapping.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public abstract class Mapping { 20 | private final String _name; 21 | 22 | protected Mapping() { 23 | this(null); 24 | } 25 | 26 | protected Mapping(final String name) { 27 | _name = name; 28 | } 29 | 30 | public abstract T apply(final T t); 31 | 32 | @Override 33 | public String toString() { 34 | if (_name != null) { 35 | return _name; 36 | } 37 | return super.toString(); 38 | } 39 | } -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/Predicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Predicate.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | /** 17 | * Determines if the input object matches some criteria. * 18 | * 19 | * @param the type of input objects provided to {@code test}. 20 | */ 21 | public interface Predicate { 22 | 23 | /** 24 | * Return {@code true} if the input object matches some criteria. 25 | * 26 | * @param t the input object. 27 | * 28 | * @return {@code true} if the input object matched some criteria. 29 | */ 30 | boolean test(T t); 31 | } 32 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/SafeCloseable.java: -------------------------------------------------------------------------------- 1 | package com.strobel.core; 2 | 3 | /** 4 | * @author Mike Strobel 5 | */ 6 | public interface SafeCloseable extends AutoCloseable { 7 | public void close(); 8 | } 9 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/Selector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selector.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public interface Selector { 20 | TResult select(final TSource source); 21 | } 22 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/ShortBox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ShortBox.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | @SuppressWarnings("PublicField") 17 | public final class ShortBox implements IStrongBox { 18 | public short value; 19 | 20 | public ShortBox() {} 21 | 22 | public ShortBox(final short value) { 23 | this.value = value; 24 | } 25 | 26 | @Override 27 | public Short get() { 28 | return this.value; 29 | } 30 | 31 | @Override 32 | @SuppressWarnings("unchecked") 33 | public void set(final Object value) { 34 | this.value = (Short) value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/StringComparison.java: -------------------------------------------------------------------------------- 1 | /* 2 | * StringComparison.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public enum StringComparison { 20 | Ordinal, 21 | OrdinalIgnoreCase 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/StrongBox.java: -------------------------------------------------------------------------------- 1 | /* 2 | * StrongBox.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core; 15 | 16 | import com.strobel.functions.Block; 17 | 18 | /** 19 | * @author Mike Strobel 20 | */ 21 | @SuppressWarnings("PublicField") 22 | public final class StrongBox implements IStrongBox, Block { 23 | public T value; 24 | 25 | public StrongBox() {} 26 | 27 | public StrongBox(final T value) { 28 | this.value = value; 29 | } 30 | 31 | @Override 32 | public T get() { 33 | return this.value; 34 | } 35 | 36 | @Override 37 | @SuppressWarnings("unchecked") 38 | public void set(final Object value) { 39 | this.value = (T) value; 40 | } 41 | 42 | @Override 43 | public void accept(final T input) { 44 | this.value = input; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return "StrongBox{" + 50 | "value=" + value + 51 | '}'; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/delegates/Action1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Action1.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core.delegates; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public interface Action1 { 20 | void invoke(final T t); 21 | } 22 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/delegates/Func.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Func.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core.delegates; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public interface Func { 20 | R invoke(); 21 | } 22 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/delegates/Func1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Func1.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core.delegates; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public interface Func1 { 20 | R apply(final T t); 21 | } 22 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/core/delegates/Func2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Func2.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.core.delegates; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public interface Func2 { 20 | R apply(final T1 t1, final T2 t2); 21 | } 22 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/functions/Block.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Block.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.functions; 15 | 16 | /** 17 | * @author mstrobel 18 | */ 19 | public interface Block { 20 | public void accept(final T input); 21 | } 22 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/functions/Function.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Function.java 3 | * 4 | * Copyright (c) 2013 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.functions; 15 | 16 | public interface Function { 17 | public R apply(final T input); 18 | } 19 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/functions/Supplier.java: -------------------------------------------------------------------------------- 1 | package com.strobel.functions; 2 | 3 | public interface Supplier { 4 | T get(); 5 | } 6 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/functions/Suppliers.java: -------------------------------------------------------------------------------- 1 | package com.strobel.functions; 2 | 3 | import com.strobel.util.ContractUtils; 4 | 5 | public final class Suppliers { 6 | private Suppliers() { 7 | throw ContractUtils.unreachable(); 8 | } 9 | 10 | public static Supplier forValue(final T value) { 11 | return new Supplier() { 12 | @Override 13 | public T get() { 14 | return value; 15 | } 16 | }; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Procyon.Core/src/main/java/com/strobel/util/ContractUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ContractUtils.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.util; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public final class ContractUtils { 20 | private ContractUtils() {} 21 | 22 | public static IllegalStateException unreachable() { 23 | return new IllegalStateException("Code supposed to be unreachable"); 24 | } 25 | 26 | public static UnsupportedOperationException unsupported() { 27 | return new UnsupportedOperationException("The requested operation is not supported."); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Procyon.Decompiler/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'eu.appsatori:gradle-fatjar-plugin:0.3' 8 | } 9 | } 10 | 11 | jar.enabled = false 12 | uploadArchives.enabled = false 13 | 14 | apply plugin: 'eu.appsatori.fatjar' 15 | 16 | fatJar { 17 | // from rootProject.allprojects.collect({ it.sourceSets.main.allSource }) 18 | 19 | manifest { 20 | attributes 'Title': archivesBaseName, 'Manifest-Version': '1.0', 'Version': version, 'Main-Class' : 'com.strobel.decompiler.DecompilerDriver' 21 | } 22 | } 23 | 24 | dependencies { 25 | compile 'com.beust:jcommander:1.30' 26 | compile project(':Procyon.Core') 27 | compile project(':Procyon.CompilerTools') 28 | } -------------------------------------------------------------------------------- /Procyon.Expressions/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':Procyon.Reflection') 3 | } 4 | 5 | /* 6 | about the surefire plugin.. 7 | 8 | http://forums.gradle.org/gradle/topics/does_anyone_know_how_to_configure_maven_surefire_plugin_with_gradle_for_unit_tests?page=1 9 | */ -------------------------------------------------------------------------------- /Procyon.Expressions/src/main/java/com/strobel/compilerservices/Closure.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Closure.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.compilerservices; 15 | 16 | /** 17 | * Represents the runtime state of a dynamically generated method. 18 | * 19 | * @author strobelm 20 | */ 21 | @SuppressWarnings("PublicField") 22 | public final class Closure { 23 | 24 | /** 25 | * Represents the non-trivial constants and locally executable expressions that are 26 | * referenced by a dynamically generated method. 27 | */ 28 | public final Object[] constants; 29 | 30 | /** 31 | * Represents the hoisted local variables from the parent context. 32 | */ 33 | public final Object[] locals; 34 | 35 | /** 36 | * Creates an object to hold state of a dynamically generated method. 37 | * 38 | * @param constants The constant values used by the method. 39 | * @param locals The hoisted local variables from the parent context. 40 | */ 41 | public Closure(final Object[] constants, final Object[] locals) { 42 | this.constants = constants; 43 | this.locals = locals; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Procyon.Expressions/src/main/java/com/strobel/expressions/AnalyzedTree.java: -------------------------------------------------------------------------------- 1 | /* 2 | * AnalyzedTree.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is based on the Dynamic Language Runtime from Microsoft, 7 | * Copyright (c) Microsoft Corporation. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.expressions; 18 | 19 | import com.strobel.compilerservices.DebugInfoGenerator; 20 | 21 | import java.util.HashMap; 22 | import java.util.Map; 23 | 24 | final class AnalyzedTree { 25 | private DebugInfoGenerator _debugInfoGenerator; 26 | 27 | final Map scopes = new HashMap<>(); 28 | final Map constants = new HashMap<>(); 29 | 30 | DebugInfoGenerator getDebugInfoGenerator() { 31 | if (_debugInfoGenerator == null) { 32 | return DebugInfoGenerator.empty(); 33 | } 34 | return _debugInfoGenerator; 35 | } 36 | 37 | void setDebugInfoGenerator(final DebugInfoGenerator debugInfoGenerator) { 38 | _debugInfoGenerator = debugInfoGenerator; 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /Procyon.Expressions/src/main/java/com/strobel/expressions/DefaultValueExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DefaultValueExpression.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is based on the Dynamic Language Runtime from Microsoft, 7 | * Copyright (c) Microsoft Corporation. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.expressions; 18 | 19 | import com.strobel.reflection.Type; 20 | 21 | /** 22 | * @author Mike Strobel 23 | */ 24 | public final class DefaultValueExpression extends Expression { 25 | private final Type _type; 26 | 27 | DefaultValueExpression(final Type type) { 28 | _type = type; 29 | } 30 | 31 | @Override 32 | public ExpressionType getNodeType() { 33 | return ExpressionType.DefaultValue; 34 | } 35 | 36 | @Override 37 | public Type getType() { 38 | return _type; 39 | } 40 | 41 | @Override 42 | protected Expression accept(final ExpressionVisitor visitor) { 43 | return visitor.visitDefaultValue(this); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Procyon.Expressions/src/main/java/com/strobel/expressions/FieldExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * FieldExpression.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is based on the Dynamic Language Runtime from Microsoft, 7 | * Copyright (c) Microsoft Corporation. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.expressions; 18 | 19 | import com.strobel.reflection.FieldInfo; 20 | import com.strobel.reflection.Type; 21 | 22 | /** 23 | * Represents accessing a field. 24 | * @author Mike Strobel 25 | */ 26 | final class FieldExpression extends MemberExpression { 27 | 28 | private final FieldInfo _field; 29 | 30 | FieldExpression(final Expression target, final FieldInfo field) { 31 | super(target); 32 | _field = field; 33 | } 34 | 35 | @Override 36 | FieldInfo getMember() { 37 | return _field; 38 | } 39 | 40 | @Override 41 | public final Type getType() { 42 | return _field.getFieldType(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Procyon.Expressions/src/main/java/com/strobel/expressions/GotoExpressionKind.java: -------------------------------------------------------------------------------- 1 | /* 2 | * GotoExpressionKind.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is based on the Dynamic Language Runtime from Microsoft, 7 | * Copyright (c) Microsoft Corporation. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.expressions; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | public enum GotoExpressionKind { 23 | Goto, 24 | Return, 25 | Break, 26 | Continue 27 | } 28 | -------------------------------------------------------------------------------- /Procyon.Expressions/src/main/java/com/strobel/expressions/IArgumentProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IArgumentProvider.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is based on the Dynamic Language Runtime from Microsoft, 7 | * Copyright (c) Microsoft Corporation. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.expressions; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | interface IArgumentProvider { 23 | int getArgumentCount(); 24 | Expression getArgument(final int index); 25 | } 26 | -------------------------------------------------------------------------------- /Procyon.Expressions/src/main/java/com/strobel/expressions/IRuntimeVariables.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IRuntimeVariables.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is based on the Dynamic Language Runtime from Microsoft, 7 | * Copyright (c) Microsoft Corporation. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.expressions; 18 | 19 | /** 20 | * Represents the values of run-time variables. 21 | * @author Mike Strobel 22 | */ 23 | public interface IRuntimeVariables 24 | { 25 | int size(); 26 | Object get(final int index); 27 | void set(final int index, final Object value); 28 | } 29 | -------------------------------------------------------------------------------- /Procyon.Expressions/src/main/java/com/strobel/expressions/LabelTarget.java: -------------------------------------------------------------------------------- 1 | /* 2 | * LabelTarget.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is based on the Dynamic Language Runtime from Microsoft, 7 | * Copyright (c) Microsoft Corporation. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.expressions; 18 | 19 | import com.strobel.core.StringUtilities; 20 | import com.strobel.reflection.Type; 21 | 22 | /** 23 | * Used to denote the target of a {@link GotoExpression} 24 | * @author Mike Strobel 25 | */ 26 | public final class LabelTarget { 27 | private final Type _type; 28 | private final String _name; 29 | 30 | LabelTarget(final Type type, final String name) { 31 | _type = type; 32 | _name = name; 33 | } 34 | 35 | public final String getName() { 36 | return _name; 37 | } 38 | 39 | public final Type getType() { 40 | return _type; 41 | } 42 | 43 | public final String toString() { 44 | return StringUtilities.isNullOrEmpty(_name) ? "UnnamedLabel" : _name; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Procyon.Expressions/src/main/java/com/strobel/expressions/MethodBinder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MethodBinder.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is based on the Dynamic Language Runtime from Microsoft, 7 | * Copyright (c) Microsoft Corporation. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.expressions; 18 | 19 | import java.lang.reflect.Method; 20 | 21 | interface IMethodFilter { 22 | public static final IMethodFilter FilterNameIgnoreCase = new IMethodFilter() { 23 | @Override 24 | public boolean accept(final Method m, final String name) { 25 | return m.getName().equalsIgnoreCase(name); 26 | } 27 | }; 28 | boolean accept(final Method m, final T filterCriteria); 29 | } -------------------------------------------------------------------------------- /Procyon.Expressions/src/main/java/com/strobel/expressions/SelfExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SelfExpression.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is based on the Dynamic Language Runtime from Microsoft, 7 | * Copyright (c) Microsoft Corporation. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.expressions; 18 | 19 | import com.strobel.reflection.Type; 20 | 21 | /** 22 | * @author Mike Strobel 23 | */ 24 | final class SelfExpression extends ParameterExpression { 25 | private final Type _type; 26 | 27 | SelfExpression(final Type type) { 28 | super("this"); 29 | _type = type; 30 | } 31 | 32 | @Override 33 | public Type getType() { 34 | return _type; 35 | } 36 | } 37 | 38 | /** 39 | * @author Mike Strobel 40 | */ 41 | final class SuperExpression extends ParameterExpression { 42 | private final Type _type; 43 | 44 | SuperExpression(final Type type) { 45 | super("super"); 46 | _type = type; 47 | } 48 | 49 | @Override 50 | public Type getType() { 51 | return _type; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Procyon.Expressions/src/main/java/com/strobel/expressions/VariableStorageKind.java: -------------------------------------------------------------------------------- 1 | /* 2 | * VariableStorageKind.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is based on the Dynamic Language Runtime from Microsoft, 7 | * Copyright (c) Microsoft Corporation. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.expressions; 18 | 19 | /** 20 | * @author strobelm 21 | */ 22 | enum VariableStorageKind { 23 | Local, 24 | Hoisted 25 | } 26 | -------------------------------------------------------------------------------- /Procyon.Reflection/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':Procyon.Core') 3 | } 4 | 5 | /* 6 | see Expressions build.gradle file for surefire plugin 7 | */ -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/CallingConvention.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CallingConvention.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection; 15 | 16 | import static com.strobel.reflection.FlagUtilities.all; 17 | 18 | /** 19 | * @author Mike Strobel 20 | */ 21 | public enum CallingConvention { 22 | Standard(1), 23 | VarArgs(2), 24 | Any(VarArgs.mask | Standard.mask); 25 | 26 | private final int mask; 27 | 28 | CallingConvention(final int mask) { 29 | this.mask = mask; 30 | } 31 | 32 | static CallingConvention fromMethodModifiers(final int modifiers) { 33 | if (all(modifiers, Type.VARARGS_MODIFIER)) { 34 | return VarArgs; 35 | } 36 | return Standard; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/FlagUtilities.java: -------------------------------------------------------------------------------- 1 | /* 2 | * FlagUtilities.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | final class FlagUtilities { 20 | private FlagUtilities() {} 21 | 22 | static boolean all(final int flags, final int mask) { 23 | return (flags & mask) == mask; 24 | } 25 | 26 | static boolean any(final int flags, final int mask) { 27 | return (flags & mask) != 0; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/ICapturedType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ICapturedType.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public interface ICapturedType { 20 | Type getWildcard(); 21 | } 22 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/LocalVariableInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * LocalVariableInfo.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection; 15 | 16 | /** 17 | * @author strobelm 18 | */ 19 | public abstract class LocalVariableInfo { 20 | protected LocalVariableInfo() {} 21 | 22 | public abstract Type getLocalType(); 23 | public abstract int getLocalIndex(); 24 | 25 | @Override 26 | public String toString() { 27 | return getLocalType().getBriefDescription(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/MemberFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MemberFilter.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public interface MemberFilter { 20 | boolean apply(final MemberInfo m, final Object filterCriteria); 21 | } 22 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/MemberListOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MemberListOptions.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | enum MemberListOptions { 20 | CaseSensitive(0x01), 21 | CaseInsensitive(0x02), 22 | All(CaseSensitive.mask | CaseInsensitive.mask); 23 | 24 | private final int mask; 25 | 26 | private MemberListOptions(final int mask) { 27 | this.mask = mask; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/MethodBase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MethodBase.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public abstract class MethodBase extends MemberInfo { 20 | public abstract SignatureType getSignatureType(); 21 | 22 | public ParameterList getParameters() { 23 | return ParameterList.empty(); 24 | } 25 | 26 | public TypeList getThrownTypes() { 27 | return TypeList.empty(); 28 | } 29 | 30 | public CallingConvention getCallingConvention() { 31 | return CallingConvention.fromMethodModifiers(getModifiers()); 32 | } 33 | 34 | public abstract boolean containsGenericParameter(final Type genericParameter); 35 | 36 | @Override 37 | public boolean isEquivalentTo(final MemberInfo m) { 38 | return m instanceof MethodBase && 39 | super.isEquivalentTo(m) && 40 | ((MethodBase) m).getParameters().getParameterTypes().isEquivalentTo(getParameters().getParameterTypes()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/Missing.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Missing.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public final class Missing { 20 | public static final Missing Value = new Missing(); 21 | Missing() {} 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/ParameterInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ParameterInfo.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public class ParameterInfo { 20 | private final String _name; 21 | private final int _position; 22 | private final Type _parameterType; 23 | 24 | public ParameterInfo(final String name, final int position, final Type parameterType) { 25 | _name = name; 26 | _position = position; 27 | _parameterType = parameterType; 28 | } 29 | 30 | public String getName() { 31 | return _name; 32 | } 33 | 34 | public Type getParameterType() { 35 | return _parameterType; 36 | } 37 | 38 | public int getPosition() { 39 | return _position; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/SimpleVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SimpleVisitor.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection; 15 | 16 | public abstract class SimpleVisitor extends DefaultTypeVisitor { 17 | @Override 18 | public R visitCapturedType(final Type t, final P s) { 19 | return visitWildcardType(((CapturedType) t).getWildcard(), s); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/TypeContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * TypeContext.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public abstract class TypeContext { 20 | public final static TypeContext SYSTEM = new SystemTypeContext(); 21 | 22 | public abstract ClassLoader getClassLoader(); 23 | } 24 | 25 | class SystemTypeContext extends TypeContext { 26 | 27 | private final ClassLoader _systemClassLoader; 28 | 29 | public SystemTypeContext() { 30 | _systemClassLoader = ClassLoader.getSystemClassLoader(); 31 | } 32 | 33 | @Override 34 | public ClassLoader getClassLoader() { 35 | return _systemClassLoader; 36 | } 37 | } -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/TypeMapping.java: -------------------------------------------------------------------------------- 1 | /* 2 | * TypeMapping.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection; 15 | 16 | import com.strobel.core.Mapping; 17 | 18 | /** 19 | * @author Mike Strobel 20 | */ 21 | public abstract class TypeMapping extends Mapping> { 22 | protected TypeMapping() {} 23 | 24 | protected TypeMapping(final String name) { 25 | super(name); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/TypeRelation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * TypeRelation.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection; 15 | 16 | public abstract class TypeRelation extends SimpleVisitor, Boolean> { 17 | public final Boolean visit(final TypeList types, final Type p) { 18 | for (int i = 0, n = types.size(); i < n; i++) { 19 | if (visit(types.get(i), p)) { 20 | return true; 21 | } 22 | } 23 | return false; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/UnaryTypeVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * UnaryTypeVisitor.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public abstract class UnaryTypeVisitor extends SimpleVisitor { 20 | public final R visit(final Type t) { 21 | return t.accept(this, null); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/emit/EnumSwitchCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * EnumSwitchCallback.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection.emit; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public interface EnumSwitchCallback> { 20 | void emitCase(final E key, final Label breakTarget) throws Exception; 21 | void emitDefault(final Label breakTarget) throws Exception; 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/emit/Label.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Label.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection.emit; 15 | 16 | /** 17 | * @author strobelm 18 | */ 19 | public final class Label { 20 | @SuppressWarnings("PackageVisibleField") 21 | final int label; 22 | 23 | Label(final int label) { 24 | this.label = label; 25 | } 26 | 27 | int getLabelValue() { 28 | return this.label; 29 | } 30 | 31 | public int hashCode() { 32 | return this.label; 33 | } 34 | 35 | public boolean equals(final Object o) { 36 | return o instanceof Label && 37 | equals((Label)o); 38 | } 39 | 40 | public boolean equals(final Label other) { 41 | return other != null && 42 | other.label == this.label; 43 | } 44 | } -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/emit/LocalSymInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * LocalSymInfo.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection.emit; 15 | 16 | /** 17 | * @author strobelm 18 | */ 19 | final class LocalSymInfo { 20 | public void addLocalSymInfo( 21 | final String name, 22 | final byte[] signature, 23 | final int slot, 24 | final int startOffset, 25 | final int endOffset) {} 26 | 27 | public void addPackageImport(final String packageName) {} 28 | } 29 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/emit/ScopeAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ScopeAction.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection.emit; 15 | 16 | /** 17 | * @author strobelm 18 | */ 19 | enum ScopeAction { 20 | Open, 21 | Close 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/emit/StackBehavior.java: -------------------------------------------------------------------------------- 1 | /* 2 | * StackBehavior.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection.emit; 15 | 16 | /** 17 | * @author strobelm 18 | */ 19 | public enum StackBehavior { 20 | Pop0, 21 | Pop1, 22 | Pop1_Pop1, 23 | PopI, 24 | PopI_Pop1, 25 | PopI_PopI, 26 | PopI_PopI8, 27 | PopI_PopI_PopI, 28 | PopI_PopR4, 29 | PopI_PopR8, 30 | PopRef, 31 | PopRef_Pop1, 32 | PopRef_PopI, 33 | PopRef_PopI_PopI, 34 | PopRef_PopI_PopI8, 35 | PopRef_PopI_PopR4, 36 | PopRef_PopI_PopR8, 37 | PopRef_PopI_PopRef, 38 | Push0, 39 | Push1, 40 | Push1_Push1, 41 | PushI, 42 | PushI8, 43 | PushR4, 44 | PushR8, 45 | PushRef, 46 | VarPop, 47 | VarPush, 48 | PopRef_PopI_Pop1, 49 | } 50 | 51 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/emit/StringSwitchCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * StringSwitchCallback.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection.emit; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public interface StringSwitchCallback { 20 | void emitCase(final String key, final Label breakTarget) throws Exception; 21 | void emitDefault(final Label breakTarget) throws Exception; 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/emit/SwitchCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SwitchCallback.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection.emit; 15 | 16 | /** 17 | * @author Mike Strobel 18 | */ 19 | public interface SwitchCallback { 20 | void emitCase(final int key, final Label breakTarget) throws Exception; 21 | void emitDefault(final Label breakTarget) throws Exception; 22 | } 23 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/emit/SwitchOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SwitchOptions.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is based on the Dynamic Language Runtime from Microsoft, 7 | * Copyright (c) Microsoft Corporation. 8 | * 9 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 10 | * A copy of the license can be found in the License.html file at the root of this distribution. 11 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 12 | * Apache License, Version 2.0. 13 | * 14 | * You must not remove this notice, or any other, from this software. 15 | */ 16 | 17 | package com.strobel.reflection.emit; 18 | 19 | /** 20 | * @author Mike Strobel 21 | */ 22 | public enum SwitchOptions { 23 | Default, 24 | PreferLookup, 25 | PreferTrie, 26 | PreferTable 27 | } 28 | -------------------------------------------------------------------------------- /Procyon.Reflection/src/main/java/com/strobel/reflection/emit/__FixupData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * __FixupData.java 3 | * 4 | * Copyright (c) 2012 Mike Strobel 5 | * 6 | * This source code is subject to terms and conditions of the Apache License, Version 2.0. 7 | * A copy of the license can be found in the License.html file at the root of this distribution. 8 | * By using this source code in any fashion, you are agreeing to be bound by the terms of the 9 | * Apache License, Version 2.0. 10 | * 11 | * You must not remove this notice, or any other, from this software. 12 | */ 13 | 14 | package com.strobel.reflection.emit; 15 | 16 | /** 17 | * @author strobelm 18 | */ 19 | @SuppressWarnings("PackageVisibleField") 20 | final class __FixupData { 21 | Label fixupLabel; 22 | int offsetOrigin; 23 | int fixupPosition; 24 | int operandSize; 25 | } 26 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/logo.png -------------------------------------------------------------------------------- /logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ststeiger/procyon/5caa97cf33fafbee3fe595a4a46af319c13f4b4a/logo_small.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include "Procyon.Core", "Procyon.Reflection", "Procyon.Expressions", "Procyon.CompilerTools", "Procyon.Decompiler" --------------------------------------------------------------------------------