├── .gitattributes ├── .gitignore ├── .hgignore ├── CodeRefractor.sln ├── Common ├── CodeRefactor.OpenRuntime │ ├── BoolImpl.cs │ ├── CFile.cs │ ├── CharImpl.cs │ ├── CodeRefactor.OpenRuntime.csproj │ ├── CrConsole.cs │ ├── CrFile.cs │ ├── CrInt32.cs │ ├── CrMath.cs │ ├── CrRuntimeHelpers.cs │ ├── CrStartLib.cs │ ├── CrString.cs │ ├── CrStringBuilder.cs │ ├── DoubleImpl.cs │ ├── FloatImpl.cs │ ├── Generic │ │ └── CrList.cs │ ├── IntImpl.cs │ ├── LongImpl.cs │ ├── MathImpl.cs │ ├── StringImpl.cs │ └── System │ │ ├── Object.cs │ │ ├── Reflection │ │ └── MemberInfo.cs │ │ └── Type.cs └── CodeRefractor.RuntimeBase │ ├── Analyze │ ├── DelegateManager.cs │ ├── FieldDescription.cs │ ├── FieldNameTable.cs │ ├── GlobalMethodPool.cs │ ├── InstructionsUtils.cs │ ├── LinkerInterpretersTable.cs │ ├── NamerUtils.cs │ ├── TypeDescription.cs │ ├── UsedTypeList.cs │ └── UsedTypeListUtils.cs │ ├── Backend │ ├── ComputeClosure │ │ ├── MetaLinkerClosureComputing.cs │ │ └── MethodInterpreterCodeWriter.cs │ ├── CppCodeGenerator.cs.orig │ ├── LinkerInterpretersTableUtils.cs │ ├── ProgramWideOptimizations │ │ ├── ConstParameters │ │ │ ├── CallToFunctionsWithSameConstant.cs │ │ │ └── ConstantParametersData.cs │ │ ├── ProgramOptimizationBase.cs │ │ ├── ProgramOptimizationsTable.cs │ │ └── Virtual │ │ │ ├── DevirtualizeWholeClosureMethods.cs │ │ │ ├── DevirtualizerFinalMethods.cs │ │ │ ├── DevirtualizerIfNoOverrideImplementationExists.cs │ │ │ ├── DevirtualizerIfOneImplementor.cs │ │ │ └── RemoveNotReachableMethos.cs │ └── TypesClosureLinker.cs │ ├── ClosureCompute │ ├── ClosureComputeBase.cs │ ├── ClosureEntities.cs │ ├── ClosureEntitiesBuilder.cs │ ├── ClosureEntitiesUtils.cs │ ├── MethodBaseKey.cs │ ├── MethodBaseKeyComparer.cs │ ├── MethodBaseUtils.cs │ ├── MethodResolverBase.cs │ ├── Resolvers │ │ ├── ResolvePlatformInvokeMethod.cs │ │ ├── ResolveRuntimeMethod.cs │ │ ├── ResolveRuntimeMethodUsingExtensions.cs │ │ └── ResolveRuntimeType.cs │ ├── Steps │ │ ├── AddEntryPointInterpretedMethod.cs │ │ ├── AddNotYetInterpretedMethods.cs │ │ ├── AddTypes │ │ │ ├── AddLocalVariableTypesToClosure.cs │ │ │ ├── AddParameterTypesToClosure.cs │ │ │ └── AddStringTypeToClosure.cs │ │ ├── AddVirtualMethodImplementations.cs │ │ └── AddVirtualMethods.cs │ ├── TypeResolverBase.cs │ ├── TypeSort │ │ └── ClosureTypeSorter.cs │ └── TypeSorter │ │ ├── ClosureTypeSorter.cs │ │ └── TypeComparer.cs │ ├── CodeRefractor.Compiler.Internals.csproj │ ├── CodeWriter │ ├── BasicOperations │ │ ├── CppCastRelatedOperations.cs │ │ ├── CppHandleBranches.cs │ │ ├── CppHandleCalls.cs │ │ ├── CppHandleCompareBranches.cs │ │ ├── CppHandleOperators.cs │ │ ├── CppMethodCodeWriter.cs │ │ ├── CppWriteSignature.cs │ │ └── VirtualMethodTableCodeWriter.cs │ ├── Linker │ │ ├── GenerateTypeTableForIsInst.cs │ │ ├── LinkerUtils.cs │ │ ├── LinkingData.cs │ │ └── StringTable.cs │ ├── Output │ │ └── StringBuilderExtensions.cs │ ├── Platform │ │ ├── PlatformInvokeCodeWriter.cs │ │ ├── PlatformInvokeDllImports.cs │ │ └── PlatformInvokeDllMethod.cs │ └── Types │ │ ├── CallMarshallerFactory.cs │ │ ├── CallParameterMarshaller.cs │ │ ├── CallParameterStringMarshaller.cs │ │ └── TypeBodiesCodeGenerator.cs │ ├── CommonExtensions.cs │ ├── Config │ ├── CodeRefractorVersions.cs │ ├── CommandLineParse.cs │ └── OptimizationLevelBase.cs │ ├── DataNode │ ├── Cursor.cs │ ├── Dict.cs │ ├── DynNode.cs │ ├── ExiLikeEvent.cs │ ├── ExpanderTransformer.cs │ ├── GzipExtractUtils.cs │ └── MinimizeTransformer.cs │ ├── Ensure.cs │ ├── FrontEnd │ ├── EvaluatorStack.cs │ ├── ExceptionCatchClauseRanges.cs │ ├── MetaMidRepresentationOperationFactory.cs │ ├── MethodMidRepresentationBuilder.cs │ └── SimpleOperations │ │ ├── AlwaysBranch.cs │ │ ├── Assignment.cs │ │ ├── Casts │ │ ├── Boxing.cs │ │ ├── ClassCasting.cs │ │ └── IsInstance.cs │ │ ├── Comment.cs │ │ ├── ConstTable │ │ ├── ConstByteArrayData.cs │ │ ├── ConstByteArrayList.cs │ │ └── ConstByteArrayValue.cs │ │ ├── DerefAssignment.cs │ │ ├── FieldRefAssignment.cs │ │ ├── FunctionPointerStore.cs │ │ ├── GetField.cs │ │ ├── Identifiers │ │ ├── ConstValue.cs │ │ ├── EscapingMode.cs │ │ ├── GetArrayElement.cs │ │ ├── IdentifierValue.cs │ │ ├── LocalVariable.cs │ │ ├── SetArrayElement.cs │ │ └── VariableKind.cs │ │ ├── Label.cs │ │ ├── LocalOperation.cs │ │ ├── LocalOperation.cs.BACKUP.6700.cs │ │ ├── LocalOperation.cs.BASE.6700.cs │ │ ├── LocalOperation.cs.LOCAL.6700.cs │ │ ├── LocalOperation.cs.REMOTE.6700.cs │ │ ├── LocalOperation.cs.orig │ │ ├── Methods │ │ ├── CallMethodStatic.cs │ │ ├── CallMethodVirtual.cs │ │ ├── MethodKind.cs │ │ └── Return.cs │ │ ├── NewArrayObject.cs │ │ ├── NewConstructedObject.cs │ │ ├── OperationKind.cs │ │ ├── OperationUtils.cs │ │ ├── Operators │ │ ├── BinaryOperator.cs │ │ ├── BranchOperator.cs │ │ ├── OperatorBase.cs │ │ └── UnaryOperator.cs │ │ ├── RefArrayItemAssignment.cs │ │ ├── RefAssignment.cs │ │ ├── SetField.cs │ │ ├── SizeOfAssignment.cs │ │ ├── StaticFieldGetter.cs │ │ ├── StaticFieldRefAssignment.cs │ │ ├── StaticFieldSetter.cs │ │ ├── Switch.cs │ │ └── Unboxing.cs │ ├── MiddleEnd │ ├── CppLibMethodInvokeRepresentation.cs │ ├── GlobalTable │ │ ├── GlobalFieldDefinition.cs │ │ ├── GlobalFieldKind.cs │ │ └── GlobalTableManager.cs │ ├── Interpreters │ │ ├── AnalyzeProperties.cs │ │ ├── Cil │ │ │ ├── AbstractMethodInterpreter.cs │ │ │ ├── CilMethodInterpreter.cs │ │ │ ├── MetaMidRepresentation.cs │ │ │ └── MidRepresentationVariables.cs │ │ ├── MethodInterpreter.cs │ │ ├── MethodInterpreterKey.cs │ │ ├── MethodInterpreterKeyUtils.cs │ │ ├── MidRepresentationUtils.cs │ │ └── NonCil │ │ │ ├── CppMethodInterpreter.cs │ │ │ └── PlatformInvokeMethod.cs │ ├── MetaMidRepresentationOperationFactory.cs.orig │ ├── Optimizations │ │ ├── Common │ │ │ ├── BlockOptimizationPass.cs │ │ │ ├── OptimizationPassBase.cs │ │ │ ├── ResultingGlobalOptimizationPass.cs │ │ │ ├── ResultingInFunctionOptimizationPass.cs │ │ │ └── ResultingOptimizationPass.cs │ │ ├── ConstantFoldingAndPropagation │ │ │ ├── ComplexAssignments │ │ │ │ ├── ComputeConstantOperator.cs │ │ │ │ ├── FoldVariablesDefinitionsOptimizationPass.cs │ │ │ │ ├── OperatorConstantFolding.cs │ │ │ │ ├── OperatorPartialConstantFolding.cs │ │ │ │ ├── OperatorPartialConstantFolding.cs.orig │ │ │ │ ├── PropagationVariablesOptimizationPass.cs │ │ │ │ └── RemoveDeadStoresInBlockOptimizationPass.cs │ │ │ ├── ConstantVariableBranchOperatorPropagation.cs │ │ │ ├── ConstantVariableBranchOperatorPropagation.cs.BACKUP.6972.cs │ │ │ ├── ConstantVariableBranchOperatorPropagation.cs.BASE.6972.cs │ │ │ ├── ConstantVariableBranchOperatorPropagation.cs.LOCAL.6972.cs │ │ │ ├── ConstantVariableBranchOperatorPropagation.cs.REMOTE.6972.cs │ │ │ ├── ConstantVariableBranchOperatorPropagation.cs.orig │ │ │ ├── ConstantVariableEvaluation.cs │ │ │ ├── ConstantVariableOperatorPropagation.cs │ │ │ ├── ConstantVariablePropagation.cs │ │ │ ├── ConstantVariablePropagationBase.cs │ │ │ ├── ConstantVariablePropagationInCall.cs │ │ │ └── SimpleAssignment │ │ │ │ ├── AssignmentVregWithConstNextLineFolding.cs │ │ │ │ ├── AssignmentWithVregPrevLineFolding.cs │ │ │ │ └── DeleteAssignmentWithSelf.cs │ │ ├── Dfa │ │ │ ├── ConstantDfa │ │ │ │ ├── ConstantDfaAnalysis.cs │ │ │ │ ├── DfaPointOfAnalysis.cs │ │ │ │ └── VariableState.cs │ │ │ └── ReachabilityDfa │ │ │ │ └── ReachabilityDfa.cs │ │ ├── EscapeAndLowering │ │ │ ├── ClearInFunctionUnusedArguments.cs │ │ │ ├── InFunctionLoweringVars.cs │ │ │ └── ReplaceCallsToFunctionsWithUnusedArguments.cs │ │ ├── Inliner │ │ │ ├── InlineGetterAndSetterMethods.cs │ │ │ ├── RemoveCallsToEmptyMethods.cs │ │ │ └── SmallFunctionsInliner.cs │ │ ├── Jumps │ │ │ ├── MergeConsecutiveLabels.cs │ │ │ └── RemoveUnreferencedLabels.cs │ │ ├── Licm │ │ │ ├── LoopDetection.cs │ │ │ └── LoopInvariantCodeMotion.cs │ │ ├── Purity │ │ │ ├── AnalyzeFunctionIsEmpty.cs │ │ │ ├── AnalyzeFunctionIsGetter.cs │ │ │ ├── AnalyzeFunctionIsSetter.cs │ │ │ ├── AnalyzeFunctionNoStaticSideEffects.cs │ │ │ ├── AnalyzeFunctionPurity.cs │ │ │ ├── EvaluatePureFunctionWithConstantCall.cs │ │ │ ├── RemoveDeadPureFunctionCalls.cs │ │ │ └── RemoveDeadStoresToFunctionCalls.cs │ │ ├── RedundantExpressions │ │ │ ├── PrecomputeRepeatedBinaryOperators.cs │ │ │ ├── PrecomputeRepeatedFieldGets.cs │ │ │ ├── PrecomputeRepeatedPureFunctionCall.cs │ │ │ ├── PrecomputeRepeatedUnaryOperators.cs │ │ │ └── PrecomputeRepeatedUtils.cs │ │ ├── SimpleDce │ │ │ ├── AssignBackDcePropagation.cs │ │ │ ├── AssignToReturnPropagation.cs │ │ │ ├── DceLocalAssigned.cs │ │ │ ├── DceVRegUnused.cs │ │ │ ├── DeadStoreAssignment.cs │ │ │ ├── DeleteCallToConstructorOfObject.cs │ │ │ ├── DeleteJumpNextLine.cs │ │ │ ├── DeleteUnusedNewObjectOperations.cs │ │ │ ├── DoubleAssignPropagation.cs │ │ │ └── OneAssignmentDeadStoreAssignment.cs │ │ └── Util │ │ │ └── OptimizationLevels.cs │ └── UseDefs │ │ ├── UseDefDescription.cs │ │ └── UseDefHelper.cs │ ├── Optimizations │ ├── OptimizationAttribute.cs │ ├── OptimizationCategories.cs │ └── OptimizationKind.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── PureMethodAttribute.cs │ ├── Runtime │ ├── Annotations │ │ └── CrTypeResolver.cs │ └── RuntimeLibraryUtils.cs │ ├── Shared │ ├── OpcodeBranchNames.cs │ ├── OpcodeIntValues.cs │ ├── OpcodeOperatorNames.cs │ └── ReflectionUtils.cs │ ├── TypeInfoWriter │ ├── TypeDescriptionTable.cs │ └── VirtualMethodDescription.cs │ ├── Util │ ├── DotNetUtils.cs │ ├── EnumerationUtils.cs │ ├── NativeCompilationUtils.cs │ ├── NativeCompilationUtils.cs.orig │ ├── OnceMany.cs │ └── TypeNamerUtils.cs │ └── packages.config ├── Compiler └── Frontend │ └── MsilReader │ ├── MsilReader.csproj │ └── Properties │ └── AssemblyInfo.cs ├── Deploy └── base_installer.iss ├── Documentation ├── compilation.md └── doc_Jul15_2014.zip ├── Examples └── TaoOpenGlSdl │ ├── App.cs │ ├── MainResources.Designer.cs │ ├── MainResources.resx │ ├── NBody.cs │ ├── SimpleAdditions.csproj │ └── TypeResolver.cs ├── Lib ├── Disasemblers │ ├── IKVM.Reflection.dll │ └── Mono.Cecil.dll ├── Disasm │ ├── ICSharpCode.AvalonEdit.dll │ ├── ICSharpCode.Decompiler.dll │ ├── ICSharpCode.NRefactory.CSharp.dll │ ├── ICSharpCode.NRefactory.VB.dll │ ├── ICSharpCode.NRefactory.dll │ ├── ICSharpCode.TreeView.dll │ ├── ILSpy.BamlDecompiler.Plugin.dll │ ├── ILSpy.exe │ ├── ILSpy.exe.config │ ├── Mono.Cecil.Pdb.dll │ └── Mono.Cecil.dll ├── IdeaProjects │ └── NBody │ │ ├── .idea │ │ ├── .name │ │ ├── copyright │ │ │ └── profiles_settings.xml │ │ ├── encodings.xml │ │ ├── misc.xml │ │ ├── modules.xml │ │ ├── scopes │ │ │ └── scope_settings.xml │ │ └── vcs.xml │ │ ├── out │ │ └── production │ │ │ └── untitled │ │ │ ├── Body.class │ │ │ ├── NBody.class │ │ │ ├── NBodySystem.class │ │ │ └── Pair.class │ │ ├── src │ │ ├── Body.java │ │ ├── NBody.java │ │ ├── NBodySystem.java │ │ └── Pair.java │ │ └── untitled.iml ├── Ikvm.Reflection.zip ├── NRefactory-Completion │ ├── .gitattributes │ ├── .gitignore │ ├── Doc │ │ ├── Screenshot.png │ │ ├── Thumbs.db │ │ ├── copyright.txt │ │ └── license.txt │ ├── Lib │ │ ├── ICSharpCode.NRefactory.CSharp.dll │ │ ├── ICSharpCode.NRefactory.CSharp.xml │ │ ├── ICSharpCode.NRefactory.Cecil.dll │ │ ├── ICSharpCode.NRefactory.IKVM.dll │ │ ├── ICSharpCode.NRefactory.Xml.dll │ │ ├── ICSharpCode.NRefactory.Xml.xml │ │ ├── ICSharpCode.NRefactory.dll │ │ ├── ICSharpCode.NRefactory.xml │ │ ├── IKVM.Reflection.dll │ │ └── Mono.Cecil.dll │ ├── SampleFiles │ │ ├── Sample1.cs │ │ └── SampleScript1.csx │ ├── Src │ │ ├── CodeCompletion.gpState │ │ ├── CodeCompletion.sln │ │ ├── ICSharpCode.AvalonEdit │ │ │ ├── AvalonEditCommands.cs │ │ │ ├── CodeCompletion │ │ │ │ ├── CompletionList.cs │ │ │ │ ├── CompletionList.xaml │ │ │ │ ├── CompletionListBox.cs │ │ │ │ ├── CompletionWindow.cs │ │ │ │ ├── CompletionWindowBase.cs │ │ │ │ ├── ICompletionData.cs │ │ │ │ ├── IOverloadProvider.cs │ │ │ │ ├── Images │ │ │ │ │ ├── Class.png │ │ │ │ │ ├── CompletionImage.cs │ │ │ │ │ ├── Constructor.png │ │ │ │ │ ├── Delegate.png │ │ │ │ │ ├── Enum.png │ │ │ │ │ ├── EnumValue.png │ │ │ │ │ ├── Event.png │ │ │ │ │ ├── ExtensionMethod.png │ │ │ │ │ ├── Field.png │ │ │ │ │ ├── FieldReadOnly.png │ │ │ │ │ ├── Indexer.png │ │ │ │ │ ├── Interface.png │ │ │ │ │ ├── Literal.png │ │ │ │ │ ├── Method.png │ │ │ │ │ ├── NameSpace.png │ │ │ │ │ ├── Operator.png │ │ │ │ │ ├── OverlayInternal.png │ │ │ │ │ ├── OverlayPrivate.png │ │ │ │ │ ├── OverlayProtected.png │ │ │ │ │ ├── OverlayProtectedInternal.png │ │ │ │ │ ├── OverlayStatic.png │ │ │ │ │ ├── PInvokeMethod.png │ │ │ │ │ ├── Property.png │ │ │ │ │ ├── StaticClass.png │ │ │ │ │ ├── Struct.png │ │ │ │ │ └── VirtualMethod.png │ │ │ │ ├── InsightWindow.cs │ │ │ │ ├── InsightWindow.xaml │ │ │ │ ├── OverloadInsightWindow.cs │ │ │ │ └── OverloadViewer.cs │ │ │ ├── Document │ │ │ │ ├── DocumentChangeEventArgs.cs │ │ │ │ ├── DocumentChangeOperation.cs │ │ │ │ ├── DocumentLine.cs │ │ │ │ ├── DocumentLineTree.cs │ │ │ │ ├── GapTextBuffer.cs │ │ │ │ ├── ILineTracker.cs │ │ │ │ ├── IUndoableOperation.cs │ │ │ │ ├── LineManager.cs │ │ │ │ ├── LineNode.cs │ │ │ │ ├── NewLineFinder.cs │ │ │ │ ├── OffsetChangeMap.cs │ │ │ │ ├── RopeTextSource.cs │ │ │ │ ├── SimpleSegment.cs │ │ │ │ ├── TextAnchor.cs │ │ │ │ ├── TextAnchorNode.cs │ │ │ │ ├── TextAnchorTree.cs │ │ │ │ ├── TextDocument.cs │ │ │ │ ├── TextDocumentWeakEventManager.cs │ │ │ │ ├── TextSegment.cs │ │ │ │ ├── TextSegmentCollection.cs │ │ │ │ ├── TextUtilities.cs │ │ │ │ ├── UndoOperationGroup.cs │ │ │ │ ├── UndoStack.cs │ │ │ │ └── WeakLineTracker.cs │ │ │ ├── Editing │ │ │ │ ├── AbstractMargin.cs │ │ │ │ ├── Caret.cs │ │ │ │ ├── CaretLayer.cs │ │ │ │ ├── CaretNavigationCommandHandler.cs │ │ │ │ ├── CaretWeakEventHandler.cs │ │ │ │ ├── DottedLineMargin.cs │ │ │ │ ├── DragDropException.cs │ │ │ │ ├── EditingCommandHandler.cs │ │ │ │ ├── EmptySelection.cs │ │ │ │ ├── IReadOnlySectionProvider.cs │ │ │ │ ├── ImeNativeWrapper.cs │ │ │ │ ├── ImeSupport.cs │ │ │ │ ├── LineNumberMargin.cs │ │ │ │ ├── NoReadOnlySections.cs │ │ │ │ ├── RectangleSelection.cs │ │ │ │ ├── Selection.cs │ │ │ │ ├── SelectionColorizer.cs │ │ │ │ ├── SelectionLayer.cs │ │ │ │ ├── SelectionMouseHandler.cs │ │ │ │ ├── SelectionSegment.cs │ │ │ │ ├── SimpleSelection.cs │ │ │ │ ├── TextArea.cs │ │ │ │ ├── TextAreaDefaultInputHandlers.cs │ │ │ │ ├── TextAreaInputHandler.cs │ │ │ │ └── TextSegmentReadOnlySectionProvider.cs │ │ │ ├── Folding │ │ │ │ ├── FoldingElementGenerator.cs │ │ │ │ ├── FoldingManager.cs │ │ │ │ ├── FoldingMargin.cs │ │ │ │ ├── FoldingMarginMarker.cs │ │ │ │ ├── FoldingSection.cs │ │ │ │ ├── NewFolding.cs │ │ │ │ └── XmlFoldingStrategy.cs │ │ │ ├── Highlighting │ │ │ │ ├── DocumentHighlighter.cs │ │ │ │ ├── HighlightedInlineBuilder.cs │ │ │ │ ├── HighlightedLine.cs │ │ │ │ ├── HighlightedSection.cs │ │ │ │ ├── HighlightingBrush.cs │ │ │ │ ├── HighlightingColor.cs │ │ │ │ ├── HighlightingColorizer.cs │ │ │ │ ├── HighlightingDefinitionInvalidException.cs │ │ │ │ ├── HighlightingDefinitionTypeConverter.cs │ │ │ │ ├── HighlightingManager.cs │ │ │ │ ├── HighlightingRule.cs │ │ │ │ ├── HighlightingRuleSet.cs │ │ │ │ ├── HighlightingSpan.cs │ │ │ │ ├── HtmlClipboard.cs │ │ │ │ ├── IHighlighter.cs │ │ │ │ ├── IHighlightingDefinition.cs │ │ │ │ ├── IHighlightingDefinitionReferenceResolver.cs │ │ │ │ ├── Resources │ │ │ │ │ ├── ASPX.xshd │ │ │ │ │ ├── Boo.xshd │ │ │ │ │ ├── CPP-Mode.xshd │ │ │ │ │ ├── CSS-Mode.xshd │ │ │ │ │ ├── CSharp-Mode.xshd │ │ │ │ │ ├── Coco-Mode.xshd │ │ │ │ │ ├── HTML-Mode.xshd │ │ │ │ │ ├── Java-Mode.xshd │ │ │ │ │ ├── JavaScript-Mode.xshd │ │ │ │ │ ├── ModeV1.xsd │ │ │ │ │ ├── ModeV2.xsd │ │ │ │ │ ├── PHP-Mode.xshd │ │ │ │ │ ├── Patch-Mode.xshd │ │ │ │ │ ├── PowerShell.xshd │ │ │ │ │ ├── Resources.cs │ │ │ │ │ ├── Tex-Mode.xshd │ │ │ │ │ ├── VBNET-Mode.xshd │ │ │ │ │ ├── XML-Mode.xshd │ │ │ │ │ └── XmlDoc.xshd │ │ │ │ └── Xshd │ │ │ │ │ ├── HighlightingLoader.cs │ │ │ │ │ ├── IXshdVisitor.cs │ │ │ │ │ ├── SaveXshdVisitor.cs │ │ │ │ │ ├── V1Loader.cs │ │ │ │ │ ├── V2Loader.cs │ │ │ │ │ ├── XmlHighlightingDefinition.cs │ │ │ │ │ ├── XshdColor.cs │ │ │ │ │ ├── XshdElement.cs │ │ │ │ │ ├── XshdImport.cs │ │ │ │ │ ├── XshdKeywords.cs │ │ │ │ │ ├── XshdProperty.cs │ │ │ │ │ ├── XshdReference.cs │ │ │ │ │ ├── XshdRule.cs │ │ │ │ │ ├── XshdRuleSet.cs │ │ │ │ │ ├── XshdSpan.cs │ │ │ │ │ └── XshdSyntaxDefinition.cs │ │ │ ├── ICSharpCode.AvalonEdit.csproj │ │ │ ├── ICSharpCode.AvalonEdit.snk │ │ │ ├── Indentation │ │ │ │ ├── CSharp │ │ │ │ │ ├── CSharpIndentationStrategy.cs │ │ │ │ │ ├── DocumentAccessor.cs │ │ │ │ │ └── IndentationReformatter.cs │ │ │ │ ├── DefaultIndentationStrategy.cs │ │ │ │ └── IIndentationStrategy.cs │ │ │ ├── Properties │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ └── CodeAnalysisDictionary.xml │ │ │ ├── Rendering │ │ │ │ ├── BackgroundGeometryBuilder.cs │ │ │ │ ├── CollapsedLineSection.cs │ │ │ │ ├── ColorizingTransformer.cs │ │ │ │ ├── ColumnRulerRenderer.cs │ │ │ │ ├── DefaultTextRunTypographyProperties.cs │ │ │ │ ├── DocumentColorizingTransformer.cs │ │ │ │ ├── FormattedTextElement.cs │ │ │ │ ├── GlobalTextRunProperties.cs │ │ │ │ ├── HeightTree.cs │ │ │ │ ├── HeightTreeLineNode.cs │ │ │ │ ├── HeightTreeNode.cs │ │ │ │ ├── IBackgroundRenderer.cs │ │ │ │ ├── ITextRunConstructionContext.cs │ │ │ │ ├── ITextViewConnect.cs │ │ │ │ ├── IVisualLineTransformer.cs │ │ │ │ ├── InlineObjectRun.cs │ │ │ │ ├── Layer.cs │ │ │ │ ├── LayerPosition.cs │ │ │ │ ├── LinkElementGenerator.cs │ │ │ │ ├── MouseHoverLogic.cs │ │ │ │ ├── SimpleTextSource.cs │ │ │ │ ├── SingleCharacterElementGenerator.cs │ │ │ │ ├── TextLayer.cs │ │ │ │ ├── TextView.cs │ │ │ │ ├── TextViewCachedElements.cs │ │ │ │ ├── TextViewWeakEventManager.cs │ │ │ │ ├── VisualLine.cs │ │ │ │ ├── VisualLineConstructionStartEventArgs.cs │ │ │ │ ├── VisualLineElement.cs │ │ │ │ ├── VisualLineElementGenerator.cs │ │ │ │ ├── VisualLineElementTextRunProperties.cs │ │ │ │ ├── VisualLineLinkText.cs │ │ │ │ ├── VisualLineText.cs │ │ │ │ ├── VisualLineTextParagraphProperties.cs │ │ │ │ ├── VisualLineTextSource.cs │ │ │ │ ├── VisualLinesInvalidException.cs │ │ │ │ └── VisualYPosition.cs │ │ │ ├── Search │ │ │ │ ├── DropDownButton.cs │ │ │ │ ├── DropDownButton.xaml │ │ │ │ ├── ISearchStrategy.cs │ │ │ │ ├── Localization.cs │ │ │ │ ├── RegexSearchStrategy.cs │ │ │ │ ├── SearchCommands.cs │ │ │ │ ├── SearchPanel.cs │ │ │ │ ├── SearchPanel.xaml │ │ │ │ ├── SearchResultBackgroundRenderer.cs │ │ │ │ ├── SearchStrategyFactory.cs │ │ │ │ ├── next.png │ │ │ │ └── prev.png │ │ │ ├── Snippets │ │ │ │ ├── IActiveElement.cs │ │ │ │ ├── InsertionContext.cs │ │ │ │ ├── Snippet.cs │ │ │ │ ├── SnippetAnchorElement.cs │ │ │ │ ├── SnippetBoundElement.cs │ │ │ │ ├── SnippetCaretElement.cs │ │ │ │ ├── SnippetContainerElement.cs │ │ │ │ ├── SnippetElement.cs │ │ │ │ ├── SnippetEventArgs.cs │ │ │ │ ├── SnippetInputHandler.cs │ │ │ │ ├── SnippetReplaceableTextElement.cs │ │ │ │ ├── SnippetSelectionElement.cs │ │ │ │ └── SnippetTextElement.cs │ │ │ ├── TextEditor.cs │ │ │ ├── TextEditor.xaml │ │ │ ├── TextEditorAutomationPeer.cs │ │ │ ├── TextEditorComponent.cs │ │ │ ├── TextEditorOptions.cs │ │ │ ├── TextEditorWeakEventManager.cs │ │ │ ├── TextViewPosition.cs │ │ │ ├── Utils │ │ │ │ ├── Boxes.cs │ │ │ │ ├── CharRope.cs │ │ │ │ ├── CompressingTreeList.cs │ │ │ │ ├── Constants.cs │ │ │ │ ├── DelayedEvents.cs │ │ │ │ ├── Deque.cs │ │ │ │ ├── Empty.cs │ │ │ │ ├── ExtensionMethods.cs │ │ │ │ ├── FileReader.cs │ │ │ │ ├── NullSafeCollection.cs │ │ │ │ ├── ObserveAddRemoveCollection.cs │ │ │ │ ├── PixelSnapHelpers.cs │ │ │ │ ├── PropertyChangedWeakEventManager.cs │ │ │ │ ├── Rope.cs │ │ │ │ ├── RopeNode.cs │ │ │ │ ├── RopeTextReader.cs │ │ │ │ ├── StringSegment.cs │ │ │ │ ├── TextFormatterFactory.cs │ │ │ │ ├── ThrowUtil.cs │ │ │ │ ├── WeakEventManagerBase.cs │ │ │ │ └── Win32.cs │ │ │ └── themes │ │ │ │ ├── RightArrow.cur │ │ │ │ └── generic.xaml │ │ ├── ICSharpCode.CodeCompletion.Sample │ │ │ ├── App.xaml │ │ │ ├── App.xaml.cs │ │ │ ├── Dialogs │ │ │ │ ├── CompilerOptionsViewModel.cs │ │ │ │ ├── MainWindow.xaml │ │ │ │ ├── MainWindow.xaml.cs │ │ │ │ ├── MainWindowViewModel.cs │ │ │ │ ├── NotificationViewModel.cs │ │ │ │ ├── OptimizationOptionsDialogs.xaml │ │ │ │ └── OptimizationOptionsDialogs.xaml.cs │ │ │ ├── ICSharpCode.CodeCompletion.Sample.csproj │ │ │ ├── Properties │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ ├── Resources.Designer.cs │ │ │ │ ├── Resources.resx │ │ │ │ ├── Settings.Designer.cs │ │ │ │ └── Settings.settings │ │ │ ├── ScriptProvider.cs │ │ │ └── app.config │ │ └── ICSharpCode.CodeCompletion │ │ │ ├── CSharpCompletion.cs │ │ │ ├── CSharpCompletionContext.cs │ │ │ ├── CSharpCompletionDataFactory.cs │ │ │ ├── CSharpInsightItem.cs │ │ │ ├── CSharpOverloadProvider.cs │ │ │ ├── CodeCompletionResult.cs │ │ │ ├── CodeTextEditor.cs │ │ │ ├── DataItems │ │ │ ├── CompletionData.cs │ │ │ ├── EntityCompletionData.cs │ │ │ ├── ImportCompletionData.cs │ │ │ ├── OverrideCompletionData.cs │ │ │ └── VariableCompletionData.cs │ │ │ ├── ICSharpCode.CodeCompletion.csproj │ │ │ ├── ICSharpScriptProvider.cs │ │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ │ └── SegmentTrackingOutputFormatter.cs │ └── readme.md ├── NUnit │ ├── bin │ │ ├── framework │ │ │ ├── nunit.framework.dll │ │ │ └── nunit.mocks.dll │ │ ├── lib │ │ │ ├── Images │ │ │ │ └── Tree │ │ │ │ │ ├── Circles │ │ │ │ │ ├── failure.jpg │ │ │ │ │ ├── ignored.jpg │ │ │ │ │ ├── inconclusive.jpg │ │ │ │ │ ├── skipped.jpg │ │ │ │ │ └── success.jpg │ │ │ │ │ ├── Classic │ │ │ │ │ ├── failure.jpg │ │ │ │ │ ├── ignored.jpg │ │ │ │ │ ├── inconclusive.jpg │ │ │ │ │ ├── skipped.jpg │ │ │ │ │ └── success.jpg │ │ │ │ │ ├── Default │ │ │ │ │ ├── failure.png │ │ │ │ │ ├── ignored.png │ │ │ │ │ ├── inconclusive.png │ │ │ │ │ ├── skipped.png │ │ │ │ │ └── success.png │ │ │ │ │ └── Visual Studio │ │ │ │ │ ├── failure.png │ │ │ │ │ ├── ignored.png │ │ │ │ │ ├── inconclusive.png │ │ │ │ │ ├── skipped.png │ │ │ │ │ └── success.png │ │ │ ├── nunit-console-runner.dll │ │ │ ├── nunit-gui-runner.dll │ │ │ ├── nunit.core.dll │ │ │ ├── nunit.core.interfaces.dll │ │ │ ├── nunit.uiexception.dll │ │ │ ├── nunit.uikit.dll │ │ │ └── nunit.util.dll │ │ ├── nunit-agent-x86.exe │ │ ├── nunit-agent-x86.exe.config │ │ ├── nunit-agent.exe │ │ ├── nunit-agent.exe.config │ │ ├── nunit-console-x86.exe │ │ ├── nunit-console-x86.exe.config │ │ ├── nunit-console.exe │ │ ├── nunit-console.exe.config │ │ ├── nunit-editor.exe │ │ ├── nunit-x86.exe │ │ ├── nunit-x86.exe.config │ │ ├── nunit.exe │ │ └── nunit.exe.config │ └── license.txt ├── OpenClCppMinimal │ └── CplusplusWrapper │ │ ├── CMakeLists.txt │ │ ├── CplusplusWrapper.cpp │ │ ├── CplusplusWrapperVS10.sln │ │ ├── CplusplusWrapperVS10.vcxproj │ │ ├── CplusplusWrapperVS12.vcxproj │ │ ├── CplusplusWrapper_Kernels.cl │ │ ├── bin │ │ └── x86 │ │ │ └── Debug │ │ │ └── CplusplusWrapper_Kernels.cl │ │ └── docs │ │ └── CplusplusWrapper.pdf ├── Qt5Examples │ └── SimpleConsoleApp │ │ ├── SimpleConsoleApp.pro │ │ └── main.cpp ├── TaoLibs.zip └── mono.reflection-master │ ├── BackingFieldResolver.cs │ ├── ByteBuffer.cs │ ├── Disassembler.cs │ ├── ILPattern.cs │ ├── Image.cs │ ├── Instruction.cs │ ├── MethodBodyReader.cs │ ├── Mono.Reflection.csproj │ ├── Mono.Reflection.sln │ └── README.md ├── MsilCodeCompiler ├── CodeRefractor.Compiler.csproj ├── MiddleEnd │ └── MetaMidRepresentation.cs ├── Program.cs ├── ProgramEntryPoint.cs ├── Properties │ └── AssemblyInfo.cs ├── app.config └── packages.config ├── OclHost ├── App.config ├── OclHost.csproj ├── Program.cs ├── Properties │ └── AssemblyInfo.cs └── packages.config ├── README.md ├── Source ├── CodeRefractor.Annotations │ ├── CodeRefractor.Annotations.csproj │ ├── CppLibMethodAttribute.cs │ ├── CppMethodBodyAttribute.cs │ ├── MapMethod.cs │ ├── MapMethodAttribute.cs │ ├── MapTypeAttribute.cs │ └── PureMethodAttribute.cs ├── CodeRefractor.CodeGen │ ├── CodeRefractor.CodeGen.csproj │ ├── CppCodeGenerator.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config └── Compiler │ └── Compiler.CodeWriter │ ├── BasicOperations │ ├── CppHandleBranches.cs │ ├── CppHandleCalls.cs │ ├── CppHandleCompareBranches.cs │ ├── CppHandleOperators.cs │ ├── CppMethodCodeWriter.cs │ └── CppMethodCodeWriter.cs.orig │ ├── Compiler.CodeWriter.csproj │ ├── CppFullFileMethodWriter.cs │ ├── Linker │ ├── LinkerUtils.cs │ ├── LinkingData.cs │ └── StringTable.cs │ ├── Platform │ ├── PlatformInvokeCodeWriter.cs │ ├── PlatformInvokeDllImports.cs │ └── PlatformInvokeDllMethod.cs │ └── Properties │ └── AssemblyInfo.cs ├── TargetCppApp ├── CMakeLists.txt ├── System_Console.h ├── System_Primitives.h ├── output.cpp ├── output.hpp ├── runtime_base.hpp ├── sloth.cpp ├── sloth.h └── sloth_platform.h ├── Views └── CodeRefractor.Launcher │ ├── CodeRefractor.Launcher.csproj │ ├── MainForm.Designer.cs │ ├── MainForm.cs │ ├── MainForm.resx │ ├── Program.cs │ └── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── VisualCompiler ├── App.config ├── App.xaml ├── App.xaml.cs ├── BraceFoldingStrategy.cs ├── CompilerUtils.cs ├── CustomizedBrush.cs ├── Icons │ └── run.png ├── MahApps.Metro.dll ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── MainWindowViewModel.cs ├── NotificationViewModel.cs ├── OpenRuntime │ ├── System_Console.h │ ├── System_Primitives.h │ ├── libCodeRefactorRuntime.a │ ├── runtime_base.hpp │ ├── runtime_base.partcpp │ ├── sample_delegates.cpp │ └── sloth.h ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Tests │ ├── AbstractTest01.cs │ ├── ArraysTest01.cs │ ├── BoolTest.cs │ ├── BoxingTest01.cs │ ├── BranchingTest01.cs │ ├── CallByReferenceTest.cs │ ├── CallTest01.cs │ ├── CastClassTest1.cs │ ├── CastClassTest2.cs │ ├── CastClassTest3.cs │ ├── ClassMethodTest1.cs │ ├── EnumTest1.cs │ ├── ExplicitInterfacesTest1.cs │ ├── GenericsTest1.cs │ ├── GenericsTest2.cs │ ├── GenericsTest3.cs │ ├── InterfacesTest1.cs │ ├── LinpackSimpleTest.cs │ ├── NewPropertyTest.cs │ ├── OperatorOverloadTest.cs │ ├── PlatformInvokeTest01.cs │ ├── StructTest01.cs │ ├── UnsafeTest.cs │ ├── VirtualMethodsTest1.cs │ ├── VirtualMethodsTest2.cs │ ├── VirtualMethodsTest3.cs │ ├── VirtualMethodsTest4.cs │ ├── VirtualMethodsTest5.cs │ ├── VirtualMethodsTest6.cs │ └── VirtualMethodsTest7.cs ├── Views │ └── Dialogs │ │ ├── CompilerOptionsViewModel.cs │ │ ├── CompilerOptionsWindow.xaml │ │ └── CompilerOptionsWindow.xaml.cs ├── VisualCompiler.csproj ├── VisualCompiler.csproj.DotSettings ├── VisualCompilerConstants.cs ├── bin │ └── Debug │ │ ├── ICSharpCode.AvalonEdit.dll │ │ ├── MahApps.Metro.dll │ │ ├── OpenRuntime │ │ ├── CodeRefactor.OpenRuntime.dll │ │ ├── CodeRefractor.RuntimeBase.dll │ │ ├── System_Console.h │ │ ├── System_Primitives.h │ │ ├── libCodeRefactorRuntime.a │ │ ├── runtime_base.hpp │ │ ├── runtime_base.partcpp │ │ ├── sample_delegates.cpp │ │ └── sloth.h │ │ ├── System.Windows.Interactivity.dll │ │ ├── VisualCompiler.exe.config │ │ ├── VisualCompiler.vshost.exe.config │ │ ├── de │ │ └── System.Windows.Interactivity.resources.dll │ │ ├── en │ │ └── System.Windows.Interactivity.resources.dll │ │ ├── es │ │ └── System.Windows.Interactivity.resources.dll │ │ ├── fr │ │ └── System.Windows.Interactivity.resources.dll │ │ ├── it │ │ └── System.Windows.Interactivity.resources.dll │ │ ├── ja │ │ └── System.Windows.Interactivity.resources.dll │ │ ├── ko │ │ └── System.Windows.Interactivity.resources.dll │ │ ├── zh-Hans │ │ └── System.Windows.Interactivity.resources.dll │ │ └── zh-Hant │ │ └── System.Windows.Interactivity.resources.dll └── packages.config ├── VmTests ├── MsilCodeCompiler.Tests │ ├── MsilCodeCompiler.Tests.csproj │ ├── OpenRuntime │ │ ├── MathRuntimeTests.cs │ │ └── StringRuntimeTests.cs │ ├── OptimizationsTests │ │ ├── TestConstantVariableOperatorPropagationTests.cs │ │ └── TestSmokeRunDoesNotInfiniteLoop.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Serializing │ │ ├── LocalOperationTests.cs │ │ └── TestCompactBinaryFromXml.cs │ ├── Shared │ │ └── CompilingProgramBase.cs │ ├── TestCompilingClasses.cs │ ├── TestCompilingProgram.cs │ ├── TestInfrastructure │ │ └── CodeTestingSampleWithGcc.cs │ └── packages.config └── Projects │ └── SimpleAdditions │ ├── App.cs │ ├── MainResources.Designer.cs │ ├── MainResources.resx │ ├── Program.cs │ ├── SimpleAdditions.csproj │ └── app.config └── packages ├── AvalonEdit.4.4.2.9744 ├── AvalonEdit.4.4.2.9744.nupkg ├── AvalonEdit.4.4.2.9744.nuspec └── lib │ ├── Net35 │ └── ICSharpCode.AvalonEdit.dll │ └── Net40 │ └── ICSharpCode.AvalonEdit.dll ├── AvalonEdit.Sample.4.4.2.9744 ├── AvalonEdit.Sample.4.4.2.9744.nupkg ├── AvalonEdit.Sample.4.4.2.9744.nuspec └── Content │ └── Samples │ └── AvalonEdit │ ├── BraceFoldingStrategy.cs.pp │ ├── ColorizeAvalonEdit.cs.pp │ ├── CustomHighlighting.xshd │ ├── ImageElementGenerator.cs.pp │ ├── MyCompletionData.cs.pp │ ├── Window1.xaml.cs.pp │ ├── Window1.xaml.pp │ ├── article.html │ ├── document.html │ └── rendering.html ├── Microsoft.Bcl.Immutable.1.1.20-beta ├── License-PreRelease.rtf ├── Microsoft.Bcl.Immutable.1.1.20-beta.nupkg └── lib │ └── portable-net45+win8 │ └── System.Collections.Immutable.dll ├── Microsoft.Bcl.Metadata.1.0.11-alpha ├── License-PreRelease.rtf ├── Microsoft.Bcl.Metadata.1.0.11-alpha.nupkg └── lib │ └── portable-net45+win8 │ └── System.Reflection.Metadata.dll ├── Microsoft.CodeAnalysis.0.7.4052301-beta ├── Microsoft.CodeAnalysis.0.7.4052301-beta.nupkg └── ThirdPartyNotices.rtf ├── Microsoft.CodeAnalysis.CSharp.0.7.4052301-beta ├── Microsoft.CodeAnalysis.CSharp.0.7.4052301-beta.nupkg ├── ThirdPartyNotices.rtf └── lib │ └── net45 │ └── Microsoft.CodeAnalysis.CSharp.dll ├── Microsoft.CodeAnalysis.CSharp.Workspaces.0.7.4052301-beta ├── Microsoft.CodeAnalysis.CSharp.Workspaces.0.7.4052301-beta.nupkg ├── ThirdPartyNotices.rtf └── lib │ └── net45 │ └── Microsoft.CodeAnalysis.CSharp.Workspaces.dll ├── Microsoft.CodeAnalysis.Common.0.7.4052301-beta ├── Microsoft.CodeAnalysis.Common.0.7.4052301-beta.nupkg ├── ThirdPartyNotices.rtf └── lib │ └── net45 │ └── Microsoft.CodeAnalysis.dll ├── Microsoft.CodeAnalysis.VisualBasic.0.7.4052301-beta ├── Microsoft.CodeAnalysis.VisualBasic.0.7.4052301-beta.nupkg ├── ThirdPartyNotices.rtf └── lib │ └── net45 │ └── Microsoft.CodeAnalysis.VisualBasic.dll ├── Microsoft.CodeAnalysis.VisualBasic.Workspaces.0.7.4052301-beta ├── Microsoft.CodeAnalysis.VisualBasic.Workspaces.0.7.4052301-beta.nupkg ├── ThirdPartyNotices.rtf └── lib │ └── net45 │ └── Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll ├── Microsoft.CodeAnalysis.Workspaces.Common.0.7.4052301-beta ├── Microsoft.CodeAnalysis.Workspaces.Common.0.7.4052301-beta.nupkg ├── ThirdPartyNotices.rtf └── lib │ └── net45 │ └── Microsoft.CodeAnalysis.Workspaces.dll ├── Roslyn.Compilers.CSharp.1.2.20906.2 ├── Roslyn.Compilers.CSharp.1.2.20906.2.nupkg ├── Roslyn.Compilers.CSharp.1.2.20906.2.nuspec └── lib │ └── net45 │ └── Roslyn.Compilers.CSharp.dll ├── Roslyn.Compilers.Common.1.2.20906.2 ├── Roslyn.Compilers.Common.1.2.20906.2.nupkg ├── Roslyn.Compilers.Common.1.2.20906.2.nuspec └── lib │ └── net45 │ └── Roslyn.Compilers.dll ├── Roslyn.Services.CSharp.1.2.20906.2 ├── Roslyn.Services.CSharp.1.2.20906.2.nupkg ├── Roslyn.Services.CSharp.1.2.20906.2.nuspec └── lib │ └── net45 │ └── Roslyn.Services.CSharp.dll ├── Roslyn.Services.Common.1.2.20906.2 ├── Roslyn.Services.Common.1.2.20906.2.nupkg ├── Roslyn.Services.Common.1.2.20906.2.nuspec └── lib │ └── net45 │ ├── Roslyn.Services.dll │ ├── Roslyn.Utilities.dll │ └── Roslyn.Utilities.xml └── repositories.config /.gitignore: -------------------------------------------------------------------------------- 1 | obj 2 | bin 3 | .idea 4 | /packages/ 5 | /TargetCppApp/cmake-build-debug 6 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/.hgignore -------------------------------------------------------------------------------- /Common/CodeRefactor.OpenRuntime/BoolImpl.cs: -------------------------------------------------------------------------------- 1 | using CodeRefractor.Runtime.Annotations; 2 | 3 | namespace CodeRefactor.OpenRuntime 4 | { 5 | [ExtensionsImplementation(typeof(bool))] 6 | public static class BoolImpl 7 | { 8 | [MapMethod(IsStatic = true)] 9 | [CppMethodBody( 10 | Header = "cwchar", 11 | Code = @" 12 | bool vOut = vIn && wcsicmp(text->Text->Items,L""True"")==0; 13 | return vOut;" 14 | )] 15 | public static int Parse(string text) 16 | { 17 | return 0; 18 | } 19 | 20 | [MapMethod(IsStatic = false)] 21 | public static string ToString(bool value) 22 | { 23 | if (value) 24 | return "True"; 25 | 26 | return "False"; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Common/CodeRefactor.OpenRuntime/CFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CodeRefractor.Runtime.Annotations; 3 | 4 | namespace CodeRefactor.OpenRuntime 5 | { 6 | public static class CFile 7 | { 8 | [CppLibMethod( 9 | Header = "stdio.h", 10 | Code = "return fopen(fileName, mode);", 11 | Library = "" 12 | )] 13 | public static IntPtr fopen(string fileName, string mode) 14 | { 15 | return IntPtr.Zero; 16 | } 17 | 18 | [CppLibMethod( 19 | Header = "stdio.h", 20 | Code = "return fclose(fileHandle);", 21 | Library = "" 22 | )] 23 | public static void fclose(IntPtr fileHandle) 24 | { 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Common/CodeRefactor.OpenRuntime/CharImpl.cs: -------------------------------------------------------------------------------- 1 | using CodeRefractor.Runtime.Annotations; 2 | 3 | namespace CodeRefactor.OpenRuntime 4 | { 5 | [ExtensionsImplementation(typeof(char))] 6 | public static class CharImpl 7 | { 8 | [MapMethod(IsStatic = true)] 9 | [CppMethodBody( 10 | Header = "cwchar", 11 | Code = @" 12 | wchar_t vOut = (wchar_t)wcstol(text->Text->Items,NULL,10); 13 | return vOut;" 14 | )] 15 | public static char Parse(string text) 16 | { 17 | return (char)0; 18 | } 19 | 20 | [MapMethod(IsStatic = false)] 21 | public static string ToString(char value) 22 | { 23 | return new string(new[]{value}); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Common/CodeRefactor.OpenRuntime/CrInt32.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CodeRefractor.Runtime.Annotations; 3 | 4 | namespace CodeRefactor.OpenRuntime 5 | { 6 | [MapType(typeof (Int32))] 7 | public class CrInt32 8 | { 9 | } 10 | } -------------------------------------------------------------------------------- /Common/CodeRefactor.OpenRuntime/CrRuntimeHelpers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | using CodeRefractor.Runtime.Annotations; 4 | 5 | namespace CodeRefactor.OpenRuntime 6 | { 7 | [MapType(typeof (RuntimeHelpers))] 8 | public class CrRuntimeHelpers 9 | { 10 | [CppMethodBody( 11 | Code = @" 12 | auto arrayDestRef = array.get(); 13 | memcpy(arrayDestRef->Items, data, bytesCount);" 14 | )] 15 | public static unsafe void InitializeArray(Array array, byte* data, int bytesCount) 16 | { 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Common/CodeRefactor.OpenRuntime/CrStartLib.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefactor.OpenRuntime 2 | { 3 | public class CrStartLib 4 | { 5 | public static unsafe CrString[] GetArguments(int argc, byte** argv) 6 | { 7 | var result = new CrString[argc]; 8 | for (int i = 0; i < argc; i++) 9 | { 10 | result[i] = new CrString(argv[i]); 11 | } 12 | return result; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Common/CodeRefactor.OpenRuntime/IntImpl.cs: -------------------------------------------------------------------------------- 1 | using CodeRefractor.Runtime.Annotations; 2 | 3 | namespace CodeRefactor.OpenRuntime 4 | { 5 | [ExtensionsImplementation(typeof(int))] 6 | public static class IntImpl 7 | { 8 | [MapMethod(IsStatic = true)] 9 | [CppMethodBody( 10 | Header = "cwchar", 11 | Code = @" 12 | return _wtoi(text->Text->Items);" 13 | )] 14 | public static int Parse(string text) 15 | { 16 | return 0; 17 | } 18 | 19 | [MapMethod(IsStatic=false)] 20 | [CppMethodBody( 21 | Header = "cwchar", 22 | Code = 23 | @" 24 | wchar_t buffer [15]; 25 | int cx; 26 | cx = swprintf ( buffer, L""%d\0"", value); // is passed as reference 27 | auto result = std::make_shared(); 28 | auto text = std::make_shared>(cx, buffer); 29 | result->Text = text; 30 | return result;" 31 | )] 32 | public static string ToString(int value) 33 | { 34 | return null; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Common/CodeRefactor.OpenRuntime/LongImpl.cs: -------------------------------------------------------------------------------- 1 | using CodeRefractor.Runtime.Annotations; 2 | 3 | namespace CodeRefactor.OpenRuntime 4 | { 5 | [ExtensionsImplementation(typeof(long))] 6 | public static class LongImpl 7 | { 8 | [MapMethod(IsStatic = true)] 9 | [CppMethodBody( 10 | Header = "cwchar", 11 | Code = @" 12 | return (long)wcstol(text->Text->Items,NULL,10);" 13 | )] 14 | public static long Parse(string text) 15 | { 16 | return 0; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Common/CodeRefactor.OpenRuntime/System/Object.cs: -------------------------------------------------------------------------------- 1 | using CodeRefractor.Runtime.Annotations; 2 | 3 | namespace CodeRefactor.OpenRuntime.System 4 | { 5 | 6 | [ExtensionsImplementation(typeof(global::System.Object))] 7 | public abstract class Object 8 | { 9 | 10 | [MapMethod(IsStatic = false)] 11 | public static string ToString(object value) 12 | { 13 | return ""; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Common/CodeRefactor.OpenRuntime/System/Reflection/MemberInfo.cs: -------------------------------------------------------------------------------- 1 | using CodeRefractor.Runtime.Annotations; 2 | 3 | namespace CodeRefactor.OpenRuntime.System.Reflection 4 | { 5 | [ExtensionsImplementation(typeof(MemberInfo))] 6 | public abstract class MemberInfo 7 | { 8 | [MapMethod(IsStatic = false)] 9 | protected MemberInfo() 10 | { 11 | } 12 | 13 | [MapMethod(IsStatic = false)] 14 | public abstract string Name { get; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/Analyze/FieldDescription.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | #endregion 4 | 5 | namespace CodeRefractor.Analyze 6 | { 7 | public class FieldDescription 8 | { 9 | public string Name { get; set; } 10 | public TypeDescription TypeDescription { get; set; } 11 | public bool IsStatic { get; set; } 12 | public int? Offset { get; set; } 13 | 14 | public override string ToString() 15 | { 16 | var result = $"{Name}: {TypeDescription}"; 17 | if (IsStatic) 18 | { 19 | result = result + " (static)"; 20 | } 21 | return result; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/Analyze/FieldNameTable.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.Analyze 9 | { 10 | public class FieldNameTable 11 | { 12 | private readonly Dictionary _invalidNames = new Dictionary(); 13 | private int _countedField; 14 | public static FieldNameTable Instance { get; } = new FieldNameTable(); 15 | 16 | public string GetFieldName(string name) 17 | { 18 | if (!ContainsInvalidCharacters(name)) 19 | return name; 20 | string result; 21 | if (_invalidNames.TryGetValue(name, out result)) 22 | return result; 23 | var formattedName = $"AutoNamed_{_countedField}"; 24 | _countedField++; 25 | _invalidNames[name] = formattedName; 26 | return formattedName; 27 | } 28 | 29 | public static bool ContainsInvalidCharacters(string text) 30 | { 31 | var notToFind = new[] {"<", ">"}; 32 | var count = notToFind.Count(text.Contains); 33 | return count != 0; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/Analyze/NamerUtils.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | #endregion 4 | 5 | namespace CodeRefractor.Analyze 6 | { 7 | public static class NamerUtils 8 | { 9 | public static string ValidName(this string name) 10 | { 11 | return FieldNameTable.Instance.GetFieldName(name); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/Analyze/UsedTypeListUtils.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.Analyze 8 | { 9 | public static class UsedTypeListUtils 10 | { 11 | public static Type ResolveTypeByResolvers(this Type type) 12 | { 13 | var resolvers = GlobalMethodPool.GetTypeResolvers(); 14 | foreach (var resolver in resolvers) 15 | { 16 | var newType = resolver.ResolveType(type); 17 | if (newType != null) 18 | { 19 | type = newType; 20 | break; 21 | } 22 | } 23 | return type; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/Backend/LinkerInterpretersTableUtils.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Reflection; 4 | using CodeRefractor.ClosureCompute; 5 | using CodeRefractor.CodeWriter.Linker; 6 | using CodeRefractor.MiddleEnd.Interpreters.Cil; 7 | using CodeRefractor.MiddleEnd.Optimizations.Purity; 8 | 9 | #endregion 10 | 11 | namespace CodeRefractor.Backend.Linker 12 | { 13 | public static class LinkerInterpretersTableUtils 14 | { 15 | public static bool ReadPurity(MethodBase methodBase, ClosureEntities crRuntime) 16 | { 17 | var method = methodBase.GetInterpreter(crRuntime); 18 | return AnalyzeFunctionPurity.ReadPurity(method as CilMethodInterpreter); 19 | } 20 | 21 | public static bool ReadNoStaticSideEffects(MethodBase methodBase, ClosureEntities crRuntime) 22 | { 23 | if (methodBase.GetInterpreter(crRuntime) is CilMethodInterpreter method && method.MidRepresentation != null) 24 | { 25 | return method.AnalyzeProperties.IsReadOnly; 26 | } 27 | return false; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/Backend/ProgramWideOptimizations/ProgramOptimizationBase.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.ClosureCompute; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.Backend.ProgramWideOptimizations 8 | { 9 | public abstract class ProgramOptimizationBase 10 | { 11 | public abstract bool Optimize(ClosureEntities closure); 12 | } 13 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/ClosureCompute/ClosureComputeBase.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Reflection; 4 | using CodeRefractor.MiddleEnd.Interpreters.Cil; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.ClosureCompute 9 | { 10 | /// 11 | /// Are various algorithms which find if new types 12 | /// or methods are added to the CR closure 13 | /// 14 | public abstract class ClosureComputeBase 15 | { 16 | public abstract bool UpdateClosure(ClosureEntities closureEntities); 17 | 18 | protected static void AddMethodToClosure(ClosureEntities closureEntities, MethodBase method) 19 | { 20 | var interpreter = closureEntities.ResolveMethod(method) ?? new CilMethodInterpreter(method); 21 | var intepreter = interpreter as CilMethodInterpreter; 22 | if (intepreter != null) 23 | { 24 | intepreter.Process(closureEntities); 25 | } 26 | closureEntities.UseMethod(method, interpreter); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/ClosureCompute/MethodBaseKeyComparer.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Collections.Generic; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.ClosureCompute 8 | { 9 | public class MethodBaseKeyComparer : IEqualityComparer 10 | { 11 | public bool Equals(MethodBaseKey x, MethodBaseKey y) 12 | { 13 | return CompareEquals(x, y); 14 | } 15 | 16 | public int GetHashCode(MethodBaseKey obj) 17 | { 18 | return obj.GetHashCode(); 19 | } 20 | 21 | public static bool CompareEquals(MethodBaseKey x, MethodBaseKey y) 22 | { 23 | var result = x.Method.MethodMatches(y.Method); 24 | return result; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/ClosureCompute/MethodResolverBase.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Reflection; 4 | using CodeRefractor.MiddleEnd.Interpreters; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.ClosureCompute 9 | { 10 | public abstract class MethodResolverBase 11 | { 12 | public abstract MethodInterpreter Resolve(MethodBase method); 13 | } 14 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/ClosureCompute/Resolvers/ResolvePlatformInvokeMethod.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Reflection; 4 | using CodeRefractor.MiddleEnd; 5 | using CodeRefractor.MiddleEnd.Interpreters; 6 | using CodeRefractor.MiddleEnd.Interpreters.NonCil; 7 | 8 | #endregion 9 | 10 | namespace CodeRefractor.ClosureCompute.Resolvers 11 | { 12 | public class ResolvePlatformInvokeMethod : MethodResolverBase 13 | { 14 | public override MethodInterpreter Resolve(MethodBase method) 15 | { 16 | if (!PlatformInvokeMethod.IsPlatformInvoke(method)) 17 | return null; 18 | return new PlatformInvokeMethod(method); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/ClosureCompute/Steps/AddEntryPointInterpretedMethod.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefractor.ClosureCompute.Steps 2 | { 3 | public class AddEntryPointInterpretedMethod : ClosureComputeBase 4 | { 5 | public override bool UpdateClosure(ClosureEntities closureEntities) 6 | { 7 | var resolveEntryPoint = closureEntities.ResolveMethod(closureEntities.EntryPoint); 8 | if (resolveEntryPoint != null) return false; 9 | AddMethodToClosure(closureEntities, closureEntities.EntryPoint); 10 | return true; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/ClosureCompute/Steps/AddTypes/AddStringTypeToClosure.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefractor.ClosureCompute.Steps.AddTypes 2 | { 3 | public class AddStringTypeToClosure : ClosureComputeBase 4 | { 5 | public override bool UpdateClosure(ClosureEntities closureEntities) 6 | { 7 | return closureEntities.AddType(typeof (string)) 8 | && closureEntities.AddType(typeof (object)) 9 | ; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/ClosureCompute/TypeResolverBase.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.ClosureCompute 8 | { 9 | public abstract class TypeResolverBase 10 | { 11 | public abstract Type Resolve(Type type); 12 | } 13 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/ClosureCompute/TypeSort/ClosureTypeSorter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace CodeRefractor.ClosureCompute.TypeSort 5 | { 6 | class ClosureTypeSorter 7 | { 8 | private readonly HashSet _types; 9 | 10 | public ClosureTypeSorter(Type[] types) 11 | { 12 | _types = new HashSet(); 13 | foreach (var type in types) 14 | { 15 | _types.Add(type); 16 | } 17 | } 18 | 19 | public List DoSort() 20 | { 21 | var result = new List(_types); 22 | result.Sort(new TypeComparer()); 23 | return result; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/ClosureCompute/TypeSorter/ClosureTypeSorter.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.ClosureCompute.TypeSorter 9 | { 10 | internal class ClosureTypeSorter 11 | { 12 | private readonly ClosureEntities _crRuntime; 13 | private readonly List _types; 14 | 15 | public ClosureTypeSorter(IEnumerable types, ClosureEntities crRuntime) 16 | { 17 | _types = new List(types); 18 | _crRuntime = crRuntime; 19 | } 20 | 21 | public List DoSort() 22 | { 23 | //Sorting types this way won't work especially when using virtuals and inheritance .. 24 | var types = new HashSet(); 25 | foreach (var type in _types) 26 | { 27 | var mappedType = type.GetMappedType(_crRuntime); 28 | types.Add(mappedType); 29 | } 30 | var result = new List(types); 31 | result.Sort(new TypeComparer(_crRuntime)); 32 | return result; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/CodeWriter/Linker/LinkingData.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Collections.Generic; 4 | using CodeRefractor.CodeWriter.Platform; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.CodeWriter.Linker 9 | { 10 | public class LinkingData 11 | { 12 | public static readonly List Libraries = new List(); 13 | public static int LibraryMethodCount; 14 | public GenerateTypeTableForIsInst IsInstTable = new GenerateTypeTableForIsInst(); 15 | public StringTable Strings = new StringTable(); 16 | 17 | public static bool SetInclude(string include) 18 | { 19 | if (string.IsNullOrWhiteSpace(include)) 20 | return false; 21 | if (Includes.Contains(include)) 22 | return false; 23 | Includes.Add(include); 24 | return true; 25 | } 26 | 27 | #region Singleton instance 28 | 29 | public static LinkingData Instance { get; } = new LinkingData(); 30 | 31 | public static readonly HashSet Includes = new HashSet(); 32 | 33 | #endregion 34 | } 35 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/CodeWriter/Output/StringBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 |  2 | using System.Text; 3 | using CodeRefractor.Util; 4 | 5 | 6 | namespace CodeRefractor.CodeWriter.Output 7 | { 8 | /** 9 | * Class that manages code output generation, indenting the text nicely in the 10 | * process. 11 | */ 12 | 13 | public static class StringBuilderExtensions 14 | { 15 | public static StringBuilder BracketOpen(this StringBuilder sb) 16 | { 17 | sb.Append(" {\n"); 18 | 19 | return sb; 20 | } 21 | 22 | public static StringBuilder BracketClose(this StringBuilder sb, bool assignedStatement = false) 23 | { 24 | sb.Append("\n}\n"); 25 | 26 | return sb; 27 | } 28 | 29 | public static StringBuilder BlankLine(this StringBuilder sb) 30 | { 31 | sb.Append("\n"); 32 | 33 | 34 | return sb; 35 | } 36 | 37 | } 38 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/CodeWriter/Platform/PlatformInvokeDllImports.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Collections.Generic; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.CodeWriter.Platform 8 | { 9 | public class PlatformInvokeDllImports 10 | { 11 | public readonly Dictionary Methods = 12 | new Dictionary(); 13 | 14 | public PlatformInvokeDllImports(string dllName) 15 | { 16 | DllName = dllName; 17 | } 18 | 19 | public string DllName { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/CodeWriter/Platform/PlatformInvokeDllMethod.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Runtime.InteropServices; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.CodeWriter.Platform 8 | { 9 | public class PlatformInvokeDllMethod 10 | { 11 | public PlatformInvokeDllMethod(string name, CallingConvention? callingConvention = null, string entryPoint = "") 12 | { 13 | Name = name; 14 | CallingConvention = callingConvention; 15 | EntryPoint = !string.IsNullOrEmpty(entryPoint) ? entryPoint : name; 16 | } 17 | 18 | public string Name { get; set; } 19 | public CallingConvention? CallingConvention { get; set; } 20 | public string EntryPoint { get; set; } 21 | public int Id { get; set; } 22 | 23 | public string FormattedName() 24 | { 25 | return $"dll_method_{Id}"; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/CodeWriter/Types/CallMarshallerFactory.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Reflection; 4 | using CodeRefractor.Util; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.CodeWriter.Types 9 | { 10 | /** 11 | * This class checks if marshalling between types should be done, and 12 | * dispatches to the right marshaller if that's the case. 13 | */ 14 | 15 | public class CallMarshallerFactory 16 | { 17 | public static CallParameterMarshaller CreateMarshaller(ParameterInfo parameterInfo) 18 | { 19 | var cppType = parameterInfo.ParameterType.ToCppName(isPInvoke: true); 20 | 21 | if ("System_Char*" == cppType) 22 | { 23 | return new CallParameterStringMarshaller(parameterInfo, cppType); 24 | } 25 | 26 | return new CallParameterMarshaller(parameterInfo, cppType); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/CodeWriter/Types/CallParameterMarshaller.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Reflection; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.CodeWriter.Types 8 | { 9 | /** 10 | * A call parameter is a parameter that will be used in calling a function. 11 | */ 12 | 13 | public class CallParameterMarshaller 14 | { 15 | protected ParameterInfo _parameterInfo; 16 | protected string _targetType; 17 | 18 | public CallParameterMarshaller(ParameterInfo parameterInfo, string targetType) 19 | { 20 | _parameterInfo = parameterInfo; 21 | _targetType = targetType; 22 | } 23 | 24 | /** 25 | * The transformation statements needed to get it to the required function type. 26 | */ 27 | 28 | public virtual string GetTransformationCode() 29 | { 30 | return ""; 31 | } 32 | 33 | /** 34 | * The code that is needed to get the parameter as the method call. 35 | */ 36 | 37 | public virtual string GetParameterString() 38 | { 39 | return _parameterInfo.Name; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/CodeWriter/Types/CallParameterStringMarshaller.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Reflection; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.CodeWriter.Types 8 | { 9 | /** 10 | * Transforms a string from one format to the other. 11 | */ 12 | 13 | public class CallParameterStringMarshaller : CallParameterMarshaller 14 | { 15 | public CallParameterStringMarshaller(ParameterInfo parameterInfo, string targetType) 16 | : base(parameterInfo, targetType) 17 | { 18 | } 19 | 20 | /** 21 | * The transformation statements needed to get it to the required function type. 22 | */ 23 | 24 | public override string GetTransformationCode() 25 | { 26 | return _targetType + " _" + _parameterInfo.Name + " = " + _parameterInfo.Name + "->Text->Items;\n"; 27 | } 28 | 29 | /** 30 | * The code that is needed to get the parameter as the method call. 31 | */ 32 | 33 | public override string GetParameterString() 34 | { 35 | return "_" + _parameterInfo.Name; 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/Config/CodeRefractorVersions.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefractor.Config 2 | { 3 | public static class CodeRefractorVersions 4 | { 5 | public const string Version = "0.0.3_pre"; 6 | } 7 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/DataNode/Dict.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Collections.Generic; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.DataNode 8 | { 9 | internal class Dict 10 | { 11 | private readonly Dictionary _words = new Dictionary(); 12 | 13 | public int Count => _words.Count; 14 | 15 | public bool HasWord(string word) 16 | { 17 | return _words.ContainsKey(word); 18 | } 19 | 20 | public int GetWordId(string word) 21 | { 22 | int id; 23 | if (_words.TryGetValue(word, out id)) 24 | return id; 25 | return -1; 26 | } 27 | 28 | internal void AddWord(string newText) 29 | { 30 | var id = Count; 31 | _words[newText] = id; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/DataNode/ExiLikeEvent.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefractor.DataNode 2 | { 3 | public enum ExiLikeEvent 4 | { 5 | None = 0, 6 | CreateElement, 7 | ExistingElement, 8 | CreateAttribute, 9 | ExistingAttribute, 10 | ExistingAttributeValue, 11 | CreateString, 12 | CreateExistingString, 13 | EndElement, 14 | CreateAttributeValue, 15 | CreateText, 16 | ExistingText 17 | } 18 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/Ensure.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor 8 | { 9 | public static class Ensure 10 | { 11 | public static void AreEqual(T expected, T actual, string message) 12 | { 13 | if (!expected.Equals(actual)) 14 | throw new InvalidOperationException(message); 15 | } 16 | 17 | public static void IsTrue(bool value, string message) 18 | { 19 | if (!value) 20 | throw new InvalidOperationException(message); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/AlwaysBranch.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | #endregion 4 | 5 | namespace CodeRefractor.FrontEnd.SimpleOperations 6 | { 7 | public class AlwaysBranch : LocalOperation 8 | { 9 | public AlwaysBranch() 10 | : base(OperationKind.AlwaysBranch) 11 | { 12 | } 13 | 14 | public int JumpTo { get; set; } 15 | 16 | public override string ToString() 17 | { 18 | return $"goto {JumpTo}:"; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Assignment.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.FrontEnd.SimpleOperations 8 | { 9 | public class Assignment : LocalOperation 10 | { 11 | public Assignment() 12 | : base(OperationKind.Assignment) 13 | { 14 | } 15 | 16 | public LocalVariable AssignedTo { get; set; } 17 | public IdentifierValue Right { get; set; } 18 | 19 | public override string ToString() 20 | { 21 | return $"{AssignedTo.Name} = {Right.Name}"; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Casts/Boxing.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.FrontEnd.SimpleOperations.Casts 8 | { 9 | public class Boxing : LocalOperation 10 | { 11 | public Boxing() 12 | : base(OperationKind.Box) 13 | { 14 | } 15 | 16 | public IdentifierValue Right { get; set; } 17 | public LocalVariable AssignedTo { get; set; } 18 | 19 | public static bool IsUsed { get; set; } 20 | 21 | public override string ToString() 22 | { 23 | return $"{Right.Name} = box({AssignedTo.Name})"; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Casts/ClassCasting.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.FrontEnd.SimpleOperations.Casts 8 | { 9 | public class ClassCasting : LocalOperation 10 | { 11 | public ClassCasting() 12 | : base(OperationKind.CastClass) 13 | { 14 | } 15 | 16 | public IdentifierValue Value { get; set; } 17 | public LocalVariable AssignedTo { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Casts/IsInstance.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.FrontEnd.SimpleOperations.Casts 9 | { 10 | public class IsInstance : LocalOperation 11 | { 12 | public IsInstance() 13 | : base(OperationKind.IsInstance) 14 | { 15 | } 16 | 17 | public LocalVariable AssignedTo { get; set; } 18 | public Type CastTo { get; set; } 19 | public IdentifierValue Right { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Comment.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | #endregion 4 | 5 | namespace CodeRefractor.FrontEnd.SimpleOperations 6 | { 7 | public class Comment : LocalOperation 8 | { 9 | public Comment() 10 | : base(OperationKind.Comment) 11 | { 12 | } 13 | 14 | public string Message { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/ConstTable/ConstByteArrayValue.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.Analyze; 4 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.FrontEnd.SimpleOperations.ConstTable 9 | { 10 | public class ConstByteArrayValue : ConstValue 11 | { 12 | public readonly int Id; 13 | 14 | public ConstByteArrayValue(int id) : base(id) 15 | { 16 | Id = id; 17 | FixedType = new TypeDescription(typeof (byte)); 18 | Value = ConstByteArrayList.Instance.ItemList[id]; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/DerefAssignment.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.FrontEnd.SimpleOperations 8 | { 9 | public class DerefAssignment : LocalOperation 10 | { 11 | public DerefAssignment() 12 | : base(OperationKind.DerefAssignment) 13 | { 14 | } 15 | 16 | public LocalVariable Left { get; set; } 17 | public LocalVariable Right { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/FieldRefAssignment.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Reflection; 4 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.FrontEnd.SimpleOperations 9 | { 10 | public class FieldRefAssignment : LocalOperation 11 | { 12 | public FieldInfo Field; 13 | public LocalVariable Left; 14 | public LocalVariable Right; 15 | 16 | public FieldRefAssignment() : base(OperationKind.FieldRefAssignment) 17 | { 18 | } 19 | 20 | public override string ToString() 21 | { 22 | return $"{Left.Name} = {Right}"; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/FunctionPointerStore.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Reflection; 4 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.FrontEnd.SimpleOperations 9 | { 10 | public class FunctionPointerStore : LocalOperation 11 | { 12 | public FunctionPointerStore() 13 | : base(OperationKind.LoadFunction) 14 | { 15 | } 16 | 17 | public IdentifierValue AssignedTo { get; set; } 18 | public MethodBase FunctionPointer { get; set; } 19 | public MethodInfo CustomData { get; set; } 20 | 21 | public override string ToString() 22 | { 23 | return $"{AssignedTo} = {FunctionPointer}"; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/GetField.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.FrontEnd.SimpleOperations 8 | { 9 | public class GetField : LocalOperation 10 | { 11 | public GetField() 12 | : base(OperationKind.GetField) 13 | { 14 | } 15 | 16 | public LocalVariable AssignedTo { get; set; } 17 | public LocalVariable Instance { get; set; } 18 | public string FieldName { get; set; } 19 | 20 | public override LocalOperation Clone() 21 | { 22 | return new GetField 23 | { 24 | AssignedTo = AssignedTo, 25 | Instance = Instance, 26 | FieldName = FieldName 27 | }; 28 | } 29 | 30 | public override string ToString() 31 | { 32 | return $"{AssignedTo.Name} = {Instance.Name}->{FieldName}"; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Identifiers/EscapingMode.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefractor.FrontEnd.SimpleOperations.Identifiers 2 | { 3 | /// 4 | /// For a speciffic variable it is said which is the way is states on stack 5 | /// 6 | public enum EscapingMode 7 | { 8 | /// 9 | /// The reference needs to be reference counted 10 | /// 11 | Smart, 12 | 13 | /// 14 | /// The reference doesn't need to be reference counted, all usages do increase and 15 | /// decrease the refcount by the same amount 16 | /// 17 | Pointer, 18 | 19 | /// 20 | /// The reference should not be refcounted. Is either a value type (like "int") 21 | /// or it can be declared just in function and it doesn't escape 22 | /// 23 | Stack, 24 | 25 | /// 26 | /// This variable is not used at all or it cannot be reached for the final output 27 | /// 28 | Unused 29 | } 30 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Identifiers/IdentifierValue.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | using CodeRefractor.Analyze; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.FrontEnd.SimpleOperations.Identifiers 9 | { 10 | public class IdentifierValue 11 | { 12 | public TypeDescription FixedType; 13 | 14 | public string Name => FormatVar(); 15 | 16 | public virtual TypeDescription ComputedType() 17 | { 18 | if (FixedType == null && FormatVar() == "unknown") 19 | FixedType = new TypeDescription(null); 20 | return FixedType; 21 | } 22 | 23 | public virtual string FormatVar() 24 | { 25 | return "unknown"; 26 | } 27 | 28 | public override string ToString() 29 | { 30 | return FormatVar(); 31 | } 32 | 33 | public virtual IdentifierValue Clone() 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Identifiers/SetArrayElement.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.FrontEnd.SimpleOperations.Identifiers 8 | { 9 | public class SetArrayElement : LocalOperation 10 | { 11 | public SetArrayElement() : base(OperationKind.SetArrayItem) 12 | { 13 | } 14 | 15 | public IdentifierValue Index { get; set; } 16 | public LocalVariable Instance { get; set; } 17 | public IdentifierValue Right { get; set; } 18 | 19 | public Type GetElementType() 20 | { 21 | var computedType = Instance.ComputedType(); 22 | var elementType = computedType.GetElementType(); 23 | return elementType; 24 | } 25 | 26 | public override string ToString() 27 | { 28 | return $"{Instance.Name}[{Index.Name}]={Right.Name}"; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Identifiers/VariableKind.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefractor.FrontEnd.SimpleOperations.Identifiers 2 | { 3 | public enum VariableKind 4 | { 5 | Vreg, 6 | Local, 7 | Argument 8 | } 9 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Label.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | #endregion 4 | 5 | namespace CodeRefractor.FrontEnd.SimpleOperations 6 | { 7 | public class Label : LocalOperation 8 | { 9 | public Label() 10 | : base(OperationKind.Label) 11 | { 12 | } 13 | 14 | public int JumpTo { get; set; } 15 | 16 | public override string ToString() 17 | { 18 | return $"label_{JumpTo}:"; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/LocalOperation.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.FrontEnd.SimpleOperations 8 | { 9 | public class LocalOperation 10 | { 11 | public LocalOperation(OperationKind kind) 12 | { 13 | Kind = kind; 14 | } 15 | 16 | public OperationKind Kind { get; internal set; } 17 | 18 | public virtual LocalOperation Clone() 19 | { 20 | var type = GetType(); 21 | var result = (LocalOperation) Activator.CreateInstance(type); 22 | OperationUtils.PopulateInstance(result, this, type); 23 | return result; 24 | } 25 | 26 | public override string ToString() 27 | { 28 | return OperationUtils.BuildString(this); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/LocalOperation.cs.BACKUP.6700.cs: -------------------------------------------------------------------------------- 1 | using CodeRefractor.RuntimeBase.MiddleEnd.SimpleOperations.Operators; 2 | 3 | namespace CodeRefractor.RuntimeBase.MiddleEnd.SimpleOperations 4 | { 5 | public class LocalOperation 6 | { 7 | <<<<<<< HEAD 8 | public OperationKind Kind{get { return Value.Kind; }} 9 | ======= 10 | public OperationKind Kind; 11 | >>>>>>> master 12 | public BaseOperation Value; 13 | 14 | public T Get() where T:BaseOperation 15 | { 16 | if (Value == null) 17 | return default(T); 18 | return (T) Value; 19 | } 20 | 21 | public override string ToString() 22 | { 23 | return string.Format("{0}: {1}", Kind, Value.ToString() ?? ""); 24 | } 25 | 26 | public LocalOperation Clone() 27 | { 28 | return new LocalOperation 29 | { 30 | <<<<<<< HEAD 31 | ======= 32 | Kind = Kind, 33 | >>>>>>> master 34 | Value = Value.Clone() 35 | }; 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/LocalOperation.cs.BASE.6700.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefractor.RuntimeBase.MiddleEnd.SimpleOperations 2 | { 3 | public class LocalOperation 4 | { 5 | public OperationKind Kind; 6 | public object Value; 7 | 8 | public T Get() 9 | { 10 | if (Value == null) 11 | return default(T); 12 | return (T) Value; 13 | } 14 | 15 | public override string ToString() 16 | { 17 | return string.Format("{0}: {1}", Kind, Value ?? ""); 18 | } 19 | 20 | public LocalOperation Clone() 21 | { 22 | var value = (IClonableOperation) Value; 23 | return new LocalOperation 24 | { 25 | Kind = Kind, 26 | Value = value.Clone() 27 | }; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/LocalOperation.cs.LOCAL.6700.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefractor.RuntimeBase.MiddleEnd.SimpleOperations 2 | { 3 | public class LocalOperation 4 | { 5 | public OperationKind Kind{get { return Value.Kind; }} 6 | public BaseOperation Value; 7 | 8 | public T Get() where T:BaseOperation 9 | { 10 | if (Value == null) 11 | return default(T); 12 | return (T) Value; 13 | } 14 | 15 | public override string ToString() 16 | { 17 | return string.Format("{0}: {1}", Kind, Value.ToString() ?? ""); 18 | } 19 | 20 | public LocalOperation Clone() 21 | { 22 | return new LocalOperation 23 | { 24 | Value = Value.Clone() 25 | }; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/LocalOperation.cs.REMOTE.6700.cs: -------------------------------------------------------------------------------- 1 | using CodeRefractor.RuntimeBase.MiddleEnd.SimpleOperations.Operators; 2 | 3 | namespace CodeRefractor.RuntimeBase.MiddleEnd.SimpleOperations 4 | { 5 | public class LocalOperation 6 | { 7 | public OperationKind Kind; 8 | public BaseOperation Value; 9 | 10 | public T Get() where T:BaseOperation 11 | { 12 | if (Value == null) 13 | return default(T); 14 | return (T) Value; 15 | } 16 | 17 | public override string ToString() 18 | { 19 | return string.Format("{0}: {1}", Kind, Value.ToString() ?? ""); 20 | } 21 | 22 | public LocalOperation Clone() 23 | { 24 | var value = (IClonableOperation) Value; 25 | return new LocalOperation 26 | { 27 | Kind = Kind, 28 | Value = Value.Clone() 29 | }; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/LocalOperation.cs.orig: -------------------------------------------------------------------------------- 1 | using CodeRefractor.RuntimeBase.MiddleEnd.SimpleOperations.Operators; 2 | 3 | namespace CodeRefractor.RuntimeBase.MiddleEnd.SimpleOperations 4 | { 5 | public class LocalOperation 6 | { 7 | <<<<<<< HEAD 8 | public OperationKind Kind{get { return Value.Kind; }} 9 | ======= 10 | public OperationKind Kind; 11 | >>>>>>> master 12 | public BaseOperation Value; 13 | 14 | public T Get() where T:BaseOperation 15 | { 16 | if (Value == null) 17 | return default(T); 18 | return (T) Value; 19 | } 20 | 21 | public override string ToString() 22 | { 23 | return string.Format("{0}: {1}", Kind, Value.ToString() ?? ""); 24 | } 25 | 26 | public LocalOperation Clone() 27 | { 28 | return new LocalOperation 29 | { 30 | <<<<<<< HEAD 31 | ======= 32 | Kind = Kind, 33 | >>>>>>> master 34 | Value = Value.Clone() 35 | }; 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Methods/CallMethodVirtual.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Collections.Generic; 4 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 5 | using CodeRefractor.MiddleEnd.Interpreters; 6 | 7 | #endregion 8 | 9 | namespace CodeRefractor.FrontEnd.SimpleOperations.Methods 10 | { 11 | public class CallMethodVirtual : CallMethodStatic 12 | { 13 | public CallMethodVirtual(MethodInterpreter interpreter) 14 | : base(interpreter) 15 | { 16 | Kind = OperationKind.CallVirtual; 17 | Parameters = new List(); 18 | 19 | Interpreter = interpreter; 20 | Info = interpreter.Method; 21 | } 22 | 23 | public override string ToString() 24 | { 25 | return $"{base.ToString()} (vcall)"; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Methods/MethodKind.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefractor.FrontEnd.SimpleOperations.Methods 2 | { 3 | public enum MethodKind 4 | { 5 | CilInstructions, 6 | RuntimeLibrary, 7 | PlatformInvoke, 8 | Delegate, 9 | RuntimeCppMethod, 10 | Abstract 11 | } 12 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/NewArrayObject.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.FrontEnd.SimpleOperations 9 | { 10 | public class NewArrayObject : LocalOperation 11 | { 12 | public NewArrayObject() 13 | : base(OperationKind.NewArray) 14 | { 15 | } 16 | 17 | public LocalVariable AssignedTo { get; set; } 18 | public Type TypeArray { get; set; } 19 | public IdentifierValue ArrayLength { get; set; } 20 | 21 | public override string ToString() 22 | { 23 | return string.Format("{2} = new {0}[{1}]", 24 | TypeArray.FullName, 25 | ArrayLength, 26 | AssignedTo.Name); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/NewConstructedObject.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Reflection; 4 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.FrontEnd.SimpleOperations 9 | { 10 | public class NewConstructedObject : LocalOperation 11 | { 12 | public NewConstructedObject() : base(OperationKind.NewObject) 13 | { 14 | } 15 | 16 | public MethodBase Info { get; set; } 17 | public LocalVariable AssignedTo { get; set; } 18 | 19 | public override string ToString() 20 | { 21 | return $"{AssignedTo.VarName} = new {Info.DeclaringType.Name}()"; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/OperationKind.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefractor.FrontEnd.SimpleOperations 2 | { 3 | public enum OperationKind 4 | { 5 | Call, 6 | CallVirtual, 7 | CallInterface, 8 | 9 | Return, 10 | BranchOperator, 11 | AlwaysBranch, 12 | Label, 13 | 14 | NewObject, 15 | CallRuntime, 16 | Switch, 17 | 18 | GetField, 19 | SetField, 20 | GetStaticField, 21 | SetStaticField, 22 | 23 | GetArrayItem, 24 | SetArrayItem, 25 | NewArray, 26 | CopyArrayInitializer, 27 | 28 | BinaryOperator, 29 | UnaryOperator, 30 | 31 | 32 | Assignment, 33 | 34 | RefAssignment, 35 | DerefAssignment, 36 | 37 | LoadFunction, 38 | FieldRefAssignment, 39 | SizeOf, 40 | AddressOfArrayItem, 41 | Box, 42 | Unbox, 43 | 44 | CastClass, 45 | 46 | Comment, 47 | IsInstance, 48 | StaticFieldRefAssignment 49 | } 50 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Operators/BinaryOperator.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.Analyze; 4 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.FrontEnd.SimpleOperations.Operators 9 | { 10 | public class BinaryOperator : OperatorBase 11 | { 12 | public BinaryOperator() : base("", OperationKind.BinaryOperator) 13 | { 14 | } 15 | 16 | public BinaryOperator(string name) 17 | : base(name, OperationKind.BinaryOperator) 18 | { 19 | } 20 | 21 | public IdentifierValue Left { get; set; } 22 | public IdentifierValue Right { get; set; } 23 | 24 | public TypeDescription ComputedType() 25 | { 26 | var leftType = Left.ComputedType(); 27 | var rightType = Right.ComputedType(); 28 | return leftType ?? rightType; 29 | } 30 | 31 | public override string ToString() 32 | { 33 | return string.Format("{3} = {0} {1} {2}", Left.Name, Name, Right.Name, AssignedTo.Name); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Operators/BranchOperator.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.Analyze; 4 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.FrontEnd.SimpleOperations.Operators 9 | { 10 | public class BranchOperator : OperatorBase 11 | { 12 | public BranchOperator() : base("", OperationKind.BranchOperator) 13 | { 14 | } 15 | 16 | public BranchOperator(string name) 17 | : base(name, OperationKind.BranchOperator) 18 | { 19 | } 20 | 21 | public int JumpTo { get; set; } 22 | public IdentifierValue CompareValue { get; set; } 23 | public IdentifierValue SecondValue { get; set; } 24 | 25 | public override string ToString() 26 | { 27 | return string.Format("Branch operator {0} {2} {1}? jump label_{3}", 28 | CompareValue, SecondValue, 29 | Name, 30 | JumpTo.ToHex()); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Operators/OperatorBase.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.FrontEnd.SimpleOperations.Operators 8 | { 9 | public class OperatorBase : LocalOperation 10 | { 11 | public OperatorBase(string name, OperationKind kind) : base(kind) 12 | { 13 | Name = name; 14 | } 15 | 16 | public LocalVariable AssignedTo { get; set; } 17 | public string Name { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Operators/UnaryOperator.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.FrontEnd.SimpleOperations.Operators 8 | { 9 | public class UnaryOperator : OperatorBase 10 | { 11 | public UnaryOperator() 12 | : base("", OperationKind.UnaryOperator) 13 | { 14 | } 15 | 16 | public UnaryOperator(string name) 17 | : base(name, OperationKind.UnaryOperator) 18 | { 19 | } 20 | 21 | public IdentifierValue Left { get; set; } 22 | 23 | public override string ToString() 24 | { 25 | return string.Format("{0} = ({2}){1}", AssignedTo, Left, Name); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/RefArrayItemAssignment.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.FrontEnd.SimpleOperations 8 | { 9 | public class RefArrayItemAssignment : LocalOperation 10 | { 11 | public RefArrayItemAssignment() 12 | : base(OperationKind.AddressOfArrayItem) 13 | { 14 | } 15 | 16 | public LocalVariable ArrayVar { get; set; } 17 | public IdentifierValue Index { get; set; } 18 | public LocalVariable Left { get; set; } 19 | 20 | public override string ToString() 21 | { 22 | return $"{ArrayVar.Name} = & ({ArrayVar}[{Index}])"; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/RefAssignment.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.FrontEnd.SimpleOperations 8 | { 9 | public class RefAssignment : LocalOperation 10 | { 11 | public LocalVariable Left; 12 | public LocalVariable Right; 13 | 14 | public RefAssignment() 15 | : base(OperationKind.RefAssignment) 16 | { 17 | } 18 | 19 | public override string ToString() 20 | { 21 | return $"{Left.Name} = {Right}"; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/SetField.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.Analyze; 4 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.FrontEnd.SimpleOperations 9 | { 10 | public class SetField : LocalOperation 11 | { 12 | public SetField() 13 | : base(OperationKind.SetField) 14 | { 15 | } 16 | 17 | public IdentifierValue Instance { get; set; } 18 | public string FieldName { get; set; } 19 | public IdentifierValue Right { get; set; } 20 | public TypeDescription FixedType { get; set; } 21 | 22 | public override string ToString() 23 | { 24 | return $"{Instance.Name}.{FieldName}= {Right.Name}"; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/SizeOfAssignment.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.FrontEnd.SimpleOperations 9 | { 10 | public class SizeOfAssignment : LocalOperation 11 | { 12 | public LocalVariable AssignedTo; 13 | public Type Right; 14 | 15 | public SizeOfAssignment() 16 | : base(OperationKind.SizeOf) 17 | { 18 | } 19 | 20 | public override string ToString() 21 | { 22 | return $"{AssignedTo.Name} = {Right}"; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/StaticFieldGetter.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.Analyze; 4 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.FrontEnd.SimpleOperations 9 | { 10 | public class StaticFieldGetter : IdentifierValue 11 | { 12 | public TypeDescription DeclaringType; 13 | public string FieldName; 14 | } 15 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/StaticFieldRefAssignment.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.Reflection; 4 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.FrontEnd.SimpleOperations 9 | { 10 | public class StaticFieldRefAssignment : LocalOperation 11 | { 12 | public FieldInfo Field; 13 | public LocalVariable Left; 14 | 15 | public StaticFieldRefAssignment() 16 | : base(OperationKind.StaticFieldRefAssignment) 17 | { 18 | } 19 | 20 | public override string ToString() 21 | { 22 | return string.Format("{0} = {1}", Left.Name); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/StaticFieldSetter.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.FrontEnd.SimpleOperations 9 | { 10 | public class StaticFieldSetter : LocalVariable 11 | { 12 | public Type DeclaringType; 13 | public string FieldName; 14 | 15 | public StaticFieldSetter() 16 | { 17 | Id = -1; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Switch.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | #endregion 4 | 5 | namespace CodeRefractor.FrontEnd.SimpleOperations 6 | { 7 | public class Switch : LocalOperation 8 | { 9 | public Switch() 10 | : base(OperationKind.Switch) 11 | { 12 | } 13 | 14 | public int[] Jumps { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/FrontEnd/SimpleOperations/Unboxing.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.FrontEnd.SimpleOperations 8 | { 9 | public class Unboxing : LocalOperation 10 | { 11 | public LocalVariable AssignedTo; 12 | public IdentifierValue Right; 13 | 14 | public Unboxing() 15 | : base(OperationKind.Unbox) 16 | { 17 | } 18 | 19 | public override string ToString() 20 | { 21 | return $"{Right.Name} = unbox( {AssignedTo.Name})"; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/MiddleEnd/CppLibMethodInvokeRepresentation.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefractor.MiddleEnd 2 | { 3 | public enum CppKinds 4 | { 5 | RuntimeLibrary, 6 | StaticLibrary 7 | } 8 | 9 | public class CppRepresentation 10 | { 11 | public CppKinds Kind { get; set; } 12 | public string Library { get; set; } 13 | public string EntryPoint { get; set; } 14 | public string Source { get; set; } 15 | public string Header { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/MiddleEnd/GlobalTable/GlobalFieldDefinition.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.MiddleEnd.GlobalTable 8 | { 9 | public class GlobalFieldDefinition 10 | { 11 | public string Name { get; set; } 12 | public Type ParentType { get; set; } 13 | public object ConstValue { get; set; } 14 | public bool Kind { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/MiddleEnd/GlobalTable/GlobalFieldKind.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefractor.MiddleEnd.GlobalTable 2 | { 3 | public enum GlobalFieldKind 4 | { 5 | None, 6 | Const, 7 | Static 8 | } 9 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/MiddleEnd/GlobalTable/GlobalTableManager.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.MiddleEnd.GlobalTable 9 | { 10 | public class GlobalTableManager 11 | { 12 | public Dictionary GlobalConstants { get; set; } 13 | 14 | public void DefineConstant(Type parentType, string fieldName, object value) 15 | { 16 | var constDefinition = new GlobalFieldDefinition 17 | { 18 | ParentType = parentType, 19 | Name = fieldName, 20 | ConstValue = value 21 | }; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/MiddleEnd/Interpreters/Cil/AbstractMethodInterpreter.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using CodeRefractor.FrontEnd.SimpleOperations.Methods; 3 | 4 | namespace CodeRefractor.MiddleEnd.Interpreters.Cil 5 | { 6 | public class AbstractMethodInterpreter : MethodInterpreter 7 | { 8 | public AbstractMethodInterpreter(MethodBase method) : base(method) 9 | { 10 | Kind = MethodKind.Abstract; 11 | 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/MiddleEnd/Optimizations/Common/OptimizationPassBase.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.ClosureCompute; 4 | using CodeRefractor.MiddleEnd.Interpreters.Cil; 5 | using CodeRefractor.Optimizations; 6 | 7 | #endregion 8 | 9 | namespace CodeRefractor.MiddleEnd.Optimizations.Common 10 | { 11 | public abstract class OptimizationPassBase 12 | { 13 | protected OptimizationPassBase(OptimizationKind kind) 14 | { 15 | Kind = kind; 16 | } 17 | 18 | public OptimizationKind Kind { get; set; } 19 | public abstract bool ApplyOptimization(CilMethodInterpreter interpreter, ClosureEntities closure); 20 | 21 | public virtual bool CheckPreconditions(CilMethodInterpreter midRepresentation, ClosureEntities closure) 22 | { 23 | return true; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/MiddleEnd/Optimizations/Common/ResultingGlobalOptimizationPass.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.Optimizations; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.MiddleEnd.Optimizations.Common 8 | { 9 | public abstract class ResultingGlobalOptimizationPass : ResultingOptimizationPass 10 | { 11 | public ResultingGlobalOptimizationPass() 12 | : base(OptimizationKind.Global) 13 | { 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/MiddleEnd/Optimizations/Common/ResultingInFunctionOptimizationPass.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.Optimizations; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.MiddleEnd.Optimizations.Common 8 | { 9 | public abstract class ResultingInFunctionOptimizationPass : ResultingOptimizationPass 10 | { 11 | public ResultingInFunctionOptimizationPass() 12 | : base(OptimizationKind.InFunction) 13 | { 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/MiddleEnd/Optimizations/Dfa/ConstantDfa/VariableState.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using CodeRefractor.FrontEnd.SimpleOperations.Identifiers; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.MiddleEnd.Optimizations.Dfa.ConstantDfa 8 | { 9 | internal class VariableState 10 | { 11 | #region ConstantState enum 12 | 13 | public enum ConstantState 14 | { 15 | NotDefined, 16 | Constant, 17 | NotConstant 18 | } 19 | 20 | #endregion 21 | 22 | public ConstValue Constant; 23 | public ConstantState State; //0 == not yet defined, 1 = constant, 2 = non constant 24 | 25 | public override string ToString() 26 | { 27 | return $"{State}: {Constant}"; 28 | } 29 | 30 | public bool Compare(VariableState value) 31 | { 32 | if (State != value.State) 33 | return false; 34 | if (State != ConstantState.Constant) 35 | return true; 36 | return Constant.Value.Equals(value.Constant.Value); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/Optimizations/OptimizationAttribute.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.Optimizations 8 | { 9 | public class OptimizationAttribute : Attribute 10 | { 11 | public string Category { get; set; } 12 | public string Name { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/Optimizations/OptimizationKind.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefractor.Optimizations 2 | { 3 | public enum OptimizationKind 4 | { 5 | InFunction, 6 | Global, 7 | InterProcedural 8 | } 9 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/PureMethodAttribute.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor 8 | { 9 | 10 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/Runtime/RuntimeLibraryUtils.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | using CodeRefractor.Analyze; 5 | using CodeRefractor.ClosureCompute; 6 | 7 | #endregion 8 | 9 | namespace CodeRefractor.Runtime 10 | { 11 | public static class RuntimeLibraryUtils 12 | { 13 | public static Type GetReversedType(this Type type, ClosureEntities crRuntime) 14 | { 15 | Type result; 16 | if (crRuntime.MappedTypes.TryGetValue(type, out result)) 17 | return result; 18 | var newType = type.ResolveTypeByResolvers(); 19 | newType = newType.ReduceType(); 20 | if (newType != type) 21 | { 22 | crRuntime.MappedTypes[type] = newType; 23 | return newType; 24 | } 25 | return type; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/Shared/OpcodeOperatorNames.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefractor.Shared 2 | { 3 | public static class OpcodeOperatorNames 4 | { 5 | public const string ConvU1 = "conv.u1"; 6 | public const string Neg = "neg"; 7 | public const string LoadArrayRef = "ldelem.ref"; 8 | public const string ConvI4 = "conv.i4"; 9 | public const string ConvI8 = "conv.i8"; 10 | public const string ConvR4 = "conv.r4"; 11 | public const string ConvR8 = "conv.r8"; 12 | public const string ConvI = "conv.i"; 13 | public const string LoadLen = "ldlen"; 14 | public const string Xor = "xor"; 15 | public const string Or = "or"; 16 | public const string And = "and"; 17 | public const string Clt = "clt"; 18 | public const string Cgt = "cgt"; 19 | public const string Ceq = "ceq"; 20 | public const string Rem = "rem"; 21 | public const string Mul = "mul"; 22 | public const string Div = "div"; 23 | public const string Sub = "sub"; 24 | public const string Add = "add"; 25 | public const string Not = "not"; 26 | } 27 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/Util/DotNetUtils.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System.IO; 4 | using System.Runtime.InteropServices; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.Util 9 | { 10 | public static class DotNetUtils 11 | { 12 | static DotNetUtils() 13 | { 14 | DotNetPath = RuntimeEnvironment.GetRuntimeDirectory(); 15 | } 16 | 17 | public static string DotNetPath { get; } 18 | 19 | public static string CallDotNetCommand(string program, string arguments, string outputDirectory = "") 20 | { 21 | var ngenApp = Path.Combine(DotNetPath, program); 22 | return ngenApp.ExecuteCommand(arguments, outputDirectory); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/Util/OnceMany.cs: -------------------------------------------------------------------------------- 1 | namespace CodeRefractor.Util 2 | { 3 | /** 4 | * A utility class that returns the once value once, and it will keep 5 | * returning the many value on subsequent calls. 6 | */ 7 | 8 | public class OnceMany 9 | { 10 | private readonly T _many; 11 | private readonly T _once; 12 | private bool _firstReturned; 13 | 14 | public OnceMany(T once, T many) 15 | { 16 | _once = once; 17 | _many = many; 18 | } 19 | 20 | /** 21 | * Returns the once value the once time the method is called, 22 | * and keeps returning the many value afterwards. 23 | */ 24 | 25 | public T next() 26 | { 27 | if (!_firstReturned) 28 | { 29 | _firstReturned = true; 30 | return _once; 31 | } 32 | 33 | return _many; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Common/CodeRefractor.RuntimeBase/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Documentation/compilation.md: -------------------------------------------------------------------------------- 1 | Compilation 2 | =========== 3 | 4 | In order to compile your generated source, the minimal GCC options you need to pass is just C++11. 5 | 6 | This assumes a platform that runs on bare metal, so it will disable many things not expected to be present there: 7 | 8 | ```sh 9 | g++ -DBARE_METAL -std=c++11 output.cpp -o main 10 | ``` 11 | 12 | For a regular application compilation simply run: 13 | ```sh 14 | g++ -Ofast -fomit-frame-pointer -ffast-math -std=c++11 -static-libgcc -fpermissive output.cpp -ldl -o main 15 | ``` 16 | 17 | This allows also dynamic loading of external libraries, and calls with PInvoke. 18 | 19 | -------------------------------------------------------------------------------- /Documentation/doc_Jul15_2014.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Documentation/doc_Jul15_2014.zip -------------------------------------------------------------------------------- /Lib/Disasemblers/IKVM.Reflection.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/Disasemblers/IKVM.Reflection.dll -------------------------------------------------------------------------------- /Lib/Disasemblers/Mono.Cecil.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/Disasemblers/Mono.Cecil.dll -------------------------------------------------------------------------------- /Lib/Disasm/ICSharpCode.AvalonEdit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/Disasm/ICSharpCode.AvalonEdit.dll -------------------------------------------------------------------------------- /Lib/Disasm/ICSharpCode.Decompiler.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/Disasm/ICSharpCode.Decompiler.dll -------------------------------------------------------------------------------- /Lib/Disasm/ICSharpCode.NRefactory.CSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/Disasm/ICSharpCode.NRefactory.CSharp.dll -------------------------------------------------------------------------------- /Lib/Disasm/ICSharpCode.NRefactory.VB.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/Disasm/ICSharpCode.NRefactory.VB.dll -------------------------------------------------------------------------------- /Lib/Disasm/ICSharpCode.NRefactory.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/Disasm/ICSharpCode.NRefactory.dll -------------------------------------------------------------------------------- /Lib/Disasm/ICSharpCode.TreeView.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/Disasm/ICSharpCode.TreeView.dll -------------------------------------------------------------------------------- /Lib/Disasm/ILSpy.BamlDecompiler.Plugin.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/Disasm/ILSpy.BamlDecompiler.Plugin.dll -------------------------------------------------------------------------------- /Lib/Disasm/ILSpy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/Disasm/ILSpy.exe -------------------------------------------------------------------------------- /Lib/Disasm/Mono.Cecil.Pdb.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/Disasm/Mono.Cecil.Pdb.dll -------------------------------------------------------------------------------- /Lib/Disasm/Mono.Cecil.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/Disasm/Mono.Cecil.dll -------------------------------------------------------------------------------- /Lib/IdeaProjects/NBody/.idea/.name: -------------------------------------------------------------------------------- 1 | untitled -------------------------------------------------------------------------------- /Lib/IdeaProjects/NBody/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Lib/IdeaProjects/NBody/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Lib/IdeaProjects/NBody/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Lib/IdeaProjects/NBody/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Lib/IdeaProjects/NBody/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Lib/IdeaProjects/NBody/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Lib/IdeaProjects/NBody/out/production/untitled/Body.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/IdeaProjects/NBody/out/production/untitled/Body.class -------------------------------------------------------------------------------- /Lib/IdeaProjects/NBody/out/production/untitled/NBody.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/IdeaProjects/NBody/out/production/untitled/NBody.class -------------------------------------------------------------------------------- /Lib/IdeaProjects/NBody/out/production/untitled/NBodySystem.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/IdeaProjects/NBody/out/production/untitled/NBodySystem.class -------------------------------------------------------------------------------- /Lib/IdeaProjects/NBody/out/production/untitled/Pair.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/IdeaProjects/NBody/out/production/untitled/Pair.class -------------------------------------------------------------------------------- /Lib/IdeaProjects/NBody/src/Body.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with IntelliJ IDEA. 3 | * User: BasicLaptop 4 | * Date: 9/23/13 5 | * Time: 8:20 PM 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | public class Body { 9 | public double x, y, z, vx, vy, vz, mass; 10 | } 11 | -------------------------------------------------------------------------------- /Lib/IdeaProjects/NBody/src/NBody.java: -------------------------------------------------------------------------------- 1 | import java.io.Console; 2 | 3 | /** 4 | * Created with IntelliJ IDEA. 5 | * User: BasicLaptop 6 | * Date: 9/23/13 7 | * Time: 8:18 PM 8 | * To change this template use File | Settings | File Templates. 9 | */ 10 | public class NBody { 11 | public static void main(String[] args) { 12 | int n = 5000000; 13 | NBodySystem bodies = new NBodySystem(); 14 | long start = System.currentTimeMillis(); 15 | System.out.println(bodies.Energy()); 16 | for (int i = 0; i < n; i++) bodies.Advance(0.01); 17 | System.out.println(bodies.Energy()); 18 | 19 | long end = System.currentTimeMillis(); 20 | System.out.println("Time: "+(end-start)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Lib/IdeaProjects/NBody/src/Pair.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with IntelliJ IDEA. 3 | * User: BasicLaptop 4 | * Date: 9/23/13 5 | * Time: 8:20 PM 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | public class Pair { 9 | public Body bi, bj; 10 | } 11 | -------------------------------------------------------------------------------- /Lib/IdeaProjects/NBody/untitled.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Lib/Ikvm.Reflection.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/Ikvm.Reflection.zip -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/.gitignore: -------------------------------------------------------------------------------- 1 | [Oo]bj 2 | [Bb]in 3 | *.user 4 | *.suo 5 | *.[Cc]ache 6 | *.bak 7 | *.ncb 8 | *.log 9 | *.DS_Store 10 | [Tt]humbs.db 11 | _ReSharper.* 12 | *.resharper 13 | Ankh.NoLoad -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Doc/Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Doc/Screenshot.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Doc/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Doc/Thumbs.db -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Doc/copyright.txt: -------------------------------------------------------------------------------- 1 | For the code copied from SharpDevelop & NRefactory 2 | 3 | Copyright 2002-2012 by 4 | 5 | AlphaSierraPapa, Christoph Wille 6 | Vordernberger Strasse 27/8 7 | A-8700 Leoben 8 | Austria 9 | 10 | email: office@alphasierrapapa.com 11 | court of jurisdiction: Landesgericht Leoben 12 | 13 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Doc/license.txt: -------------------------------------------------------------------------------- 1 | MIT License (MIT) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Lib/ICSharpCode.NRefactory.CSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Lib/ICSharpCode.NRefactory.CSharp.dll -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Lib/ICSharpCode.NRefactory.Cecil.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Lib/ICSharpCode.NRefactory.Cecil.dll -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Lib/ICSharpCode.NRefactory.IKVM.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Lib/ICSharpCode.NRefactory.IKVM.dll -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Lib/ICSharpCode.NRefactory.Xml.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Lib/ICSharpCode.NRefactory.Xml.dll -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Lib/ICSharpCode.NRefactory.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Lib/ICSharpCode.NRefactory.dll -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Lib/IKVM.Reflection.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Lib/IKVM.Reflection.dll -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Lib/Mono.Cecil.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Lib/Mono.Cecil.dll -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/SampleFiles/Sample1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | public class Sample1 5 | { 6 | public event EventHandler MyEvent; 7 | 8 | public Sample1() 9 | { 10 | var a = "Hello"; 11 | } 12 | 13 | /// 14 | /// This adds two nubers together. 15 | /// 16 | public virtual int Add(int number1, int number2) 17 | { 18 | number1 + number2; 19 | } 20 | } 21 | 22 | public class OtherClass 23 | { 24 | public void GetSample1() 25 | { 26 | var sample = new Sample1(); 27 | sample.Add(10,100); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/SampleFiles/SampleScript1.csx: -------------------------------------------------------------------------------- 1 | var a = "Hello"; 2 | a.IndexOf('o'); 3 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/CodeCompletion.gpState: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Class.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Constructor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Constructor.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Delegate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Delegate.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Enum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Enum.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/EnumValue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/EnumValue.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Event.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Event.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/ExtensionMethod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/ExtensionMethod.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Field.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/FieldReadOnly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/FieldReadOnly.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Indexer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Indexer.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Interface.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Literal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Literal.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Method.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Method.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/NameSpace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/NameSpace.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Operator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Operator.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/OverlayInternal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/OverlayInternal.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/OverlayPrivate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/OverlayPrivate.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/OverlayProtected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/OverlayProtected.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/OverlayProtectedInternal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/OverlayProtectedInternal.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/OverlayStatic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/OverlayStatic.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/PInvokeMethod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/PInvokeMethod.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Property.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Property.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/StaticClass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/StaticClass.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Struct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/Struct.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/VirtualMethod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/CodeCompletion/Images/VirtualMethod.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Document/IUndoableOperation.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | 6 | namespace ICSharpCode.AvalonEdit.Document 7 | { 8 | /// 9 | /// This Interface describes a the basic Undo/Redo operation 10 | /// all Undo Operations must implement this interface. 11 | /// 12 | public interface IUndoableOperation 13 | { 14 | /// 15 | /// Undo the last operation 16 | /// 17 | void Undo(); 18 | 19 | /// 20 | /// Redo the last operation 21 | /// 22 | void Redo(); 23 | } 24 | 25 | interface IUndoableOperationWithContext : IUndoableOperation 26 | { 27 | void Undo(UndoStack stack); 28 | void Redo(UndoStack stack); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Editing/CaretWeakEventHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using ICSharpCode.AvalonEdit.Utils; 5 | using System; 6 | 7 | namespace ICSharpCode.AvalonEdit.Editing 8 | { 9 | /// 10 | /// Contains classes for handling weak events on the Caret class. 11 | /// 12 | public static class CaretWeakEventManager 13 | { 14 | /// 15 | /// Handles the Caret.PositionChanged event. 16 | /// 17 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] 18 | public sealed class PositionChanged : WeakEventManagerBase 19 | { 20 | /// 21 | protected override void StartListening(Caret source) 22 | { 23 | source.PositionChanged += DeliverEvent; 24 | } 25 | 26 | /// 27 | protected override void StopListening(Caret source) 28 | { 29 | source.PositionChanged -= DeliverEvent; 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Highlighting/HighlightingRule.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | using System.Text.RegularExpressions; 6 | 7 | namespace ICSharpCode.AvalonEdit.Highlighting 8 | { 9 | /// 10 | /// A highlighting rule. 11 | /// 12 | [Serializable] 13 | public class HighlightingRule 14 | { 15 | /// 16 | /// Gets/Sets the regular expression for the rule. 17 | /// 18 | public Regex Regex { get; set; } 19 | 20 | /// 21 | /// Gets/Sets the highlighting color. 22 | /// 23 | public HighlightingColor Color { get; set; } 24 | 25 | /// 26 | public override string ToString() 27 | { 28 | return "[" + GetType().Name + " " + Regex + "]"; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Highlighting/IHighlightingDefinitionReferenceResolver.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | 6 | namespace ICSharpCode.AvalonEdit.Highlighting 7 | { 8 | /// 9 | /// Interface for resolvers that can solve cross-definition references. 10 | /// 11 | public interface IHighlightingDefinitionReferenceResolver 12 | { 13 | /// 14 | /// Gets the highlighting definition by name, or null if it is not found. 15 | /// 16 | IHighlightingDefinition GetDefinition(string name); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Highlighting/Resources/ASPX.xshd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <% 9 | %> 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Highlighting/Xshd/IXshdVisitor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | 6 | namespace ICSharpCode.AvalonEdit.Highlighting.Xshd 7 | { 8 | /// 9 | /// A visitor over the XSHD element tree. 10 | /// 11 | public interface IXshdVisitor 12 | { 13 | /// 14 | object VisitRuleSet(XshdRuleSet ruleSet); 15 | 16 | /// 17 | object VisitColor(XshdColor color); 18 | 19 | /// 20 | object VisitKeywords(XshdKeywords keywords); 21 | 22 | /// 23 | object VisitSpan(XshdSpan span); 24 | 25 | /// 26 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", Justification = "A VB programmer implementing a visitor?")] 27 | object VisitImport(XshdImport import); 28 | 29 | /// 30 | object VisitRule(XshdRule rule); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Highlighting/Xshd/XshdElement.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | 6 | namespace ICSharpCode.AvalonEdit.Highlighting.Xshd 7 | { 8 | /// 9 | /// An element in a XSHD rule set. 10 | /// 11 | [Serializable] 12 | public abstract class XshdElement 13 | { 14 | /// 15 | /// Gets the line number in the .xshd file. 16 | /// 17 | public int LineNumber { get; set; } 18 | 19 | /// 20 | /// Gets the column number in the .xshd file. 21 | /// 22 | public int ColumnNumber { get; set; } 23 | 24 | /// 25 | /// Applies the visitor to this element. 26 | /// 27 | public abstract object AcceptVisitor(IXshdVisitor visitor); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Highlighting/Xshd/XshdImport.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | 6 | namespace ICSharpCode.AvalonEdit.Highlighting.Xshd 7 | { 8 | /// 9 | /// <Import> element. 10 | /// 11 | [Serializable] 12 | public class XshdImport : XshdElement 13 | { 14 | /// 15 | /// Gets/sets the referenced rule set. 16 | /// 17 | public XshdReference RuleSetReference { get; set; } 18 | 19 | /// 20 | public override object AcceptVisitor(IXshdVisitor visitor) 21 | { 22 | return visitor.VisitImport(this); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Highlighting/Xshd/XshdKeywords.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using ICSharpCode.AvalonEdit.Utils; 7 | 8 | namespace ICSharpCode.AvalonEdit.Highlighting.Xshd 9 | { 10 | /// 11 | /// A list of keywords. 12 | /// 13 | [Serializable] 14 | public class XshdKeywords : XshdElement 15 | { 16 | /// 17 | /// The color. 18 | /// 19 | public XshdReference ColorReference { get; set; } 20 | 21 | readonly NullSafeCollection words = new NullSafeCollection(); 22 | 23 | /// 24 | /// Gets the list of key words. 25 | /// 26 | public IList Words { 27 | get { return words; } 28 | } 29 | 30 | /// 31 | public override object AcceptVisitor(IXshdVisitor visitor) 32 | { 33 | return visitor.VisitKeywords(this); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Highlighting/Xshd/XshdProperty.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | 6 | namespace ICSharpCode.AvalonEdit.Highlighting.Xshd 7 | { 8 | /// 9 | /// A property in an Xshd file. 10 | /// 11 | [Serializable] 12 | public class XshdProperty : XshdElement 13 | { 14 | /// 15 | /// Gets/sets the name. 16 | /// 17 | public string Name { get; set; } 18 | 19 | /// 20 | /// Gets/sets the value. 21 | /// 22 | public string Value { get; set; } 23 | 24 | /// 25 | /// Creates a new XshdColor instance. 26 | /// 27 | public XshdProperty() 28 | { 29 | } 30 | 31 | /// 32 | public override object AcceptVisitor(IXshdVisitor visitor) 33 | { 34 | return null; 35 | // return visitor.VisitProperty(this); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Highlighting/Xshd/XshdRule.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | 6 | namespace ICSharpCode.AvalonEdit.Highlighting.Xshd 7 | { 8 | /// 9 | /// <Rule> element. 10 | /// 11 | [Serializable] 12 | public class XshdRule : XshdElement 13 | { 14 | /// 15 | /// Gets/sets the rule regex. 16 | /// 17 | public string Regex { get; set; } 18 | 19 | /// 20 | /// Gets/sets the rule regex type. 21 | /// 22 | public XshdRegexType RegexType { get; set; } 23 | 24 | /// 25 | /// Gets/sets the color reference. 26 | /// 27 | public XshdReference ColorReference { get; set; } 28 | 29 | /// 30 | public override object AcceptVisitor(IXshdVisitor visitor) 31 | { 32 | return visitor.VisitRule(this); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.snk -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Indentation/IIndentationStrategy.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using ICSharpCode.AvalonEdit.Document; 5 | using System; 6 | 7 | namespace ICSharpCode.AvalonEdit.Indentation 8 | { 9 | /// 10 | /// Strategy how the text editor handles indentation when new lines are inserted. 11 | /// 12 | public interface IIndentationStrategy 13 | { 14 | /// 15 | /// Sets the indentation for the specified line. 16 | /// Usually this is constructed from the indentation of the previous line. 17 | /// 18 | void IndentLine(TextDocument document, DocumentLine line); 19 | 20 | /// 21 | /// Reindents a set of lines. 22 | /// 23 | void IndentLines(TextDocument document, int beginLine, int endLine); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Properties/CodeAnalysisDictionary.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uncollapse 7 | Foldings 8 | Xshd 9 | Utils 10 | Deque 11 | Colorizer 12 | Renderer 13 | Renderers 14 | Deletable 15 | 16 | y 17 | 18 | 19 | 20 | Lineup 21 | 22 | 23 | 24 | Bestest 25 | 26 | 27 | 28 | 29 | 30 | WiX 31 | 32 | 33 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Rendering/IBackgroundRenderer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | using System.Windows.Media; 6 | 7 | namespace ICSharpCode.AvalonEdit.Rendering 8 | { 9 | /// 10 | /// Background renderers draw in the background of a known layer. 11 | /// You can use background renderers to draw non-interactive elements on the TextView 12 | /// without introducing new UIElements. 13 | /// 14 | public interface IBackgroundRenderer 15 | { 16 | /// 17 | /// Gets the layer on which this background renderer should draw. 18 | /// 19 | KnownLayer Layer { get; } 20 | 21 | /// 22 | /// Causes the background renderer to draw. 23 | /// 24 | void Draw(TextView textView, DrawingContext drawingContext); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Rendering/ITextViewConnect.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | 6 | namespace ICSharpCode.AvalonEdit.Rendering 7 | { 8 | /// 9 | /// Allows s, s and 10 | /// s to be notified when they are added or removed from a text view. 11 | /// 12 | public interface ITextViewConnect 13 | { 14 | /// 15 | /// Called when added to a text view. 16 | /// 17 | void AddToTextView(TextView textView); 18 | 19 | /// 20 | /// Called when removed from a text view. 21 | /// 22 | void RemoveFromTextView(TextView textView); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Rendering/IVisualLineTransformer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | 7 | namespace ICSharpCode.AvalonEdit.Rendering 8 | { 9 | /// 10 | /// Allows transforming visual line elements. 11 | /// 12 | public interface IVisualLineTransformer 13 | { 14 | /// 15 | /// Applies the transformation to the specified list of visual line elements. 16 | /// 17 | void Transform(ITextRunConstructionContext context, IList elements); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Rendering/VisualLineConstructionStartEventArgs.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | using ICSharpCode.AvalonEdit.Document; 6 | 7 | namespace ICSharpCode.AvalonEdit.Rendering 8 | { 9 | /// 10 | /// EventArgs for the event. 11 | /// 12 | public class VisualLineConstructionStartEventArgs : EventArgs 13 | { 14 | /// 15 | /// Gets/Sets the first line that is visible in the TextView. 16 | /// 17 | public DocumentLine FirstLineInView { get; private set; } 18 | 19 | /// 20 | /// Creates a new VisualLineConstructionStartEventArgs instance. 21 | /// 22 | public VisualLineConstructionStartEventArgs(DocumentLine firstLineInView) 23 | { 24 | if (firstLineInView == null) 25 | throw new ArgumentNullException("firstLineInView"); 26 | this.FirstLineInView = firstLineInView; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Search/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Search/next.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Search/prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Search/prev.png -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Snippets/IActiveElement.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | using ICSharpCode.NRefactory.Editor; 6 | 7 | namespace ICSharpCode.AvalonEdit.Snippets 8 | { 9 | /// 10 | /// Represents an active element that allows the snippet to stay interactive after insertion. 11 | /// 12 | public interface IActiveElement 13 | { 14 | /// 15 | /// Called when the all snippet elements have been inserted. 16 | /// 17 | void OnInsertionCompleted(); 18 | 19 | /// 20 | /// Called when the interactive mode is deactivated. 21 | /// 22 | void Deactivate(SnippetEventArgs e); 23 | 24 | /// 25 | /// Gets whether this element is editable (the user will be able to select it with Tab). 26 | /// 27 | bool IsEditable { get; } 28 | 29 | /// 30 | /// Gets the segment associated with this element. May be null. 31 | /// 32 | ISegment Segment { get; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Snippets/SnippetElement.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | using System.Windows.Documents; 6 | 7 | namespace ICSharpCode.AvalonEdit.Snippets 8 | { 9 | /// 10 | /// An element inside a snippet. 11 | /// 12 | [Serializable] 13 | public abstract class SnippetElement 14 | { 15 | /// 16 | /// Performs insertion of the snippet. 17 | /// 18 | public abstract void Insert(InsertionContext context); 19 | 20 | /// 21 | /// Converts the snippet to text, with replaceable fields in italic. 22 | /// 23 | public virtual Inline ToTextRun() 24 | { 25 | return null; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Snippets/SnippetTextElement.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | using System.Windows.Documents; 6 | 7 | namespace ICSharpCode.AvalonEdit.Snippets 8 | { 9 | /// 10 | /// Represents a text element in a snippet. 11 | /// 12 | [Serializable] 13 | public class SnippetTextElement : SnippetElement 14 | { 15 | string text; 16 | 17 | /// 18 | /// The text to be inserted. 19 | /// 20 | public string Text { 21 | get { return text; } 22 | set { text = value; } 23 | } 24 | 25 | /// 26 | public override void Insert(InsertionContext context) 27 | { 28 | if (text != null) 29 | context.InsertText(text); 30 | } 31 | 32 | /// 33 | public override Inline ToTextRun() 34 | { 35 | return new Run(text ?? string.Empty); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Utils/Boxes.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | 6 | namespace ICSharpCode.AvalonEdit.Utils 7 | { 8 | /// 9 | /// Reuse the same instances for boxed booleans. 10 | /// 11 | static class Boxes 12 | { 13 | public static readonly object True = true; 14 | public static readonly object False = false; 15 | 16 | public static object Box(bool value) 17 | { 18 | return value ? True : False; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Utils/Constants.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | 6 | namespace ICSharpCode.AvalonEdit.Utils 7 | { 8 | static class Constants 9 | { 10 | /// 11 | /// Multiply with this constant to convert from points to device-independent pixels. 12 | /// 13 | public const double PixelPerPoint = 4 / 3.0; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Utils/Empty.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | using System.Collections.ObjectModel; 6 | 7 | namespace ICSharpCode.AvalonEdit.Utils 8 | { 9 | /// 10 | /// Provides immutable empty list instances. 11 | /// 12 | static class Empty 13 | { 14 | public static readonly T[] Array = new T[0]; 15 | //public static readonly ReadOnlyCollection ReadOnlyCollection = new ReadOnlyCollection(Array); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Utils/NullSafeCollection.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | using System.Collections.ObjectModel; 6 | 7 | namespace ICSharpCode.AvalonEdit.Utils 8 | { 9 | /// 10 | /// A collection that cannot contain null values. 11 | /// 12 | [Serializable] 13 | public class NullSafeCollection : Collection where T : class 14 | { 15 | /// 16 | protected override void InsertItem(int index, T item) 17 | { 18 | if (item == null) 19 | throw new ArgumentNullException("item"); 20 | base.InsertItem(index, item); 21 | } 22 | 23 | /// 24 | protected override void SetItem(int index, T item) 25 | { 26 | if (item == null) 27 | throw new ArgumentNullException("item"); 28 | base.SetItem(index, item); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/Utils/PropertyChangedWeakEventManager.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) 2 | // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) 3 | 4 | using System; 5 | using System.ComponentModel; 6 | 7 | namespace ICSharpCode.AvalonEdit.Utils 8 | { 9 | /// 10 | /// WeakEventManager for INotifyPropertyChanged.PropertyChanged. 11 | /// 12 | public sealed class PropertyChangedWeakEventManager : WeakEventManagerBase 13 | { 14 | /// 15 | protected override void StartListening(INotifyPropertyChanged source) 16 | { 17 | source.PropertyChanged += DeliverEvent; 18 | } 19 | 20 | /// 21 | protected override void StopListening(INotifyPropertyChanged source) 22 | { 23 | source.PropertyChanged -= DeliverEvent; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/themes/RightArrow.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/themes/RightArrow.cur -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.AvalonEdit/themes/generic.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.CodeCompletion.Sample/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.CodeCompletion.Sample/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Windows; 7 | 8 | namespace CompletionSample 9 | { 10 | /// 11 | /// Interaction logic for App.xaml 12 | /// 13 | public partial class App : Application 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.CodeCompletion.Sample/Dialogs/CompilerOptionsViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace ICSharpCode.CodeCompletion.Sample.Dialogs 4 | { 5 | public class CompilerOptionsViewModel : NotificationViewModel 6 | { 7 | public CompilerOptionsViewModel() 8 | { 9 | OptimizationList = new ObservableCollection(); 10 | } 11 | public ObservableCollection OptimizationList { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.CodeCompletion.Sample/Dialogs/NotificationViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Linq.Expressions; 4 | 5 | namespace ICSharpCode.CodeCompletion.Sample.Dialogs 6 | { 7 | public class NotificationViewModel : INotifyPropertyChanged 8 | { 9 | public event PropertyChangedEventHandler PropertyChanged; 10 | // Create the OnPropertyChanged method to raise the event 11 | void Changed(string name) 12 | { 13 | var handler = PropertyChanged; 14 | if (handler != null) 15 | handler(this, new PropertyChangedEventArgs(name)); 16 | } 17 | 18 | 19 | public void Changed(Expression> propertyName) 20 | { 21 | var body = propertyName.Body as MemberExpression; 22 | if (body == null) 23 | throw new ArgumentException("'propertyExpression' should be a member expression"); 24 | 25 | Changed(body.Member.Name); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.CodeCompletion.Sample/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.CodeCompletion.Sample/ScriptProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ICSharpCode.CodeCompletion.Sample 7 | { 8 | /// 9 | /// This is a simple script provider that adds a few using statements to the C# scripts (.csx files) 10 | /// 11 | class ScriptProvider : ICSharpScriptProvider 12 | { 13 | public string GetUsing() 14 | { 15 | return "" + 16 | "using System; " + 17 | "using System.Collections.Generic; " + 18 | "using System.Linq; " + 19 | "using System.Text; "; 20 | } 21 | 22 | 23 | public string GetVars() 24 | { 25 | return null; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.CodeCompletion.Sample/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Lib/NRefactory-Completion/Src/ICSharpCode.CodeCompletion/ICSharpScriptProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ICSharpCode.CodeCompletion 7 | { 8 | /// 9 | /// This interface allows to provide more information for scripts such as using statements, etc. 10 | /// 11 | public interface ICSharpScriptProvider 12 | { 13 | string GetUsing(); 14 | string GetVars(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Lib/NUnit/bin/framework/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/framework/nunit.framework.dll -------------------------------------------------------------------------------- /Lib/NUnit/bin/framework/nunit.mocks.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/framework/nunit.mocks.dll -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Circles/failure.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Circles/failure.jpg -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Circles/ignored.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Circles/ignored.jpg -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Circles/inconclusive.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Circles/inconclusive.jpg -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Circles/skipped.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Circles/skipped.jpg -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Circles/success.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Circles/success.jpg -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Classic/failure.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Classic/failure.jpg -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Classic/ignored.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Classic/ignored.jpg -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Classic/inconclusive.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Classic/inconclusive.jpg -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Classic/skipped.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Classic/skipped.jpg -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Classic/success.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Classic/success.jpg -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Default/failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Default/failure.png -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Default/ignored.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Default/ignored.png -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Default/inconclusive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Default/inconclusive.png -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Default/skipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Default/skipped.png -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Default/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Default/success.png -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Visual Studio/failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Visual Studio/failure.png -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Visual Studio/ignored.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Visual Studio/ignored.png -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Visual Studio/inconclusive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Visual Studio/inconclusive.png -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Visual Studio/skipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Visual Studio/skipped.png -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/Images/Tree/Visual Studio/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/Images/Tree/Visual Studio/success.png -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/nunit-console-runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/nunit-console-runner.dll -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/nunit-gui-runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/nunit-gui-runner.dll -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/nunit.core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/nunit.core.dll -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/nunit.core.interfaces.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/nunit.core.interfaces.dll -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/nunit.uiexception.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/nunit.uiexception.dll -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/nunit.uikit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/nunit.uikit.dll -------------------------------------------------------------------------------- /Lib/NUnit/bin/lib/nunit.util.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/lib/nunit.util.dll -------------------------------------------------------------------------------- /Lib/NUnit/bin/nunit-agent-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/nunit-agent-x86.exe -------------------------------------------------------------------------------- /Lib/NUnit/bin/nunit-agent.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/nunit-agent.exe -------------------------------------------------------------------------------- /Lib/NUnit/bin/nunit-console-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/nunit-console-x86.exe -------------------------------------------------------------------------------- /Lib/NUnit/bin/nunit-console-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Lib/NUnit/bin/nunit-console.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/nunit-console.exe -------------------------------------------------------------------------------- /Lib/NUnit/bin/nunit-console.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Lib/NUnit/bin/nunit-editor.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/nunit-editor.exe -------------------------------------------------------------------------------- /Lib/NUnit/bin/nunit-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/nunit-x86.exe -------------------------------------------------------------------------------- /Lib/NUnit/bin/nunit-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Lib/NUnit/bin/nunit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/bin/nunit.exe -------------------------------------------------------------------------------- /Lib/NUnit/bin/nunit.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Lib/NUnit/license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/NUnit/license.txt -------------------------------------------------------------------------------- /Lib/OpenClCppMinimal/CplusplusWrapper/CplusplusWrapper.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/OpenClCppMinimal/CplusplusWrapper/CplusplusWrapper.cpp -------------------------------------------------------------------------------- /Lib/OpenClCppMinimal/CplusplusWrapper/CplusplusWrapper_Kernels.cl: -------------------------------------------------------------------------------- 1 | 2 | 3 | float compute(float a, float b, const int toAdd) 4 | { 5 | int intA = (int) a; 6 | int intB= (int) b; 7 | 8 | 9 | 10 | float result = 0.0f; 11 | if(intA %2 == 0) 12 | goto label_else; 13 | 14 | result = intA + intB; 15 | goto label_final; 16 | 17 | label_else: 18 | result = intA+intB+toAdd; 19 | 20 | label_final: 21 | return result; 22 | } 23 | 24 | __kernel 25 | void vectorAdd(__global float *output, 26 | __global float *inputA, 27 | __global float *inputB, 28 | const int toAdd) 29 | 30 | { 31 | 32 | int gid = get_global_id(0); 33 | 34 | float a =inputA[gid]; 35 | float b =inputB[gid]; 36 | 37 | output[gid] = compute(a,b, toAdd); 38 | 39 | } -------------------------------------------------------------------------------- /Lib/OpenClCppMinimal/CplusplusWrapper/bin/x86/Debug/CplusplusWrapper_Kernels.cl: -------------------------------------------------------------------------------- 1 | 2 | 3 | float compute(float a, float b, const int toAdd) 4 | { 5 | int intA = (int) a; 6 | int intB= (int) b; 7 | 8 | 9 | 10 | float result = 0.0f; 11 | if(intA %2 == 0) 12 | goto label_else; 13 | 14 | result = intA + intB; 15 | goto label_final; 16 | 17 | label_else: 18 | result = intA+intB+toAdd; 19 | 20 | label_final: 21 | return result; 22 | } 23 | 24 | __kernel 25 | void vectorAdd(__global float *output, 26 | __global float *inputA, 27 | __global float *inputB, 28 | const int toAdd) 29 | 30 | { 31 | 32 | int gid = get_global_id(0); 33 | 34 | float a =inputA[gid]; 35 | float b =inputB[gid]; 36 | 37 | output[gid] = compute(a,b, toAdd); 38 | 39 | } -------------------------------------------------------------------------------- /Lib/OpenClCppMinimal/CplusplusWrapper/docs/CplusplusWrapper.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/OpenClCppMinimal/CplusplusWrapper/docs/CplusplusWrapper.pdf -------------------------------------------------------------------------------- /Lib/Qt5Examples/SimpleConsoleApp/SimpleConsoleApp.pro: -------------------------------------------------------------------------------- 1 | QT += core 2 | 3 | QT -= gui 4 | 5 | TARGET = SimpleConsoleApp 6 | CONFIG += console 7 | CONFIG -= app_bundle 8 | 9 | TEMPLATE = app 10 | 11 | CONFIG += c++11 12 | 13 | SOURCES += main.cpp 14 | -------------------------------------------------------------------------------- /Lib/Qt5Examples/SimpleConsoleApp/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | void ReadAllLines(){ 10 | QFile inputFile(":/input.txt"); 11 | if (inputFile.open(QIODevice::ReadOnly)) 12 | { 13 | QTextStream in(&inputFile); 14 | QVector lines; 15 | while ( !in.atEnd() ) 16 | { 17 | auto line = in.readLine(); 18 | lines.append(line); 19 | in.readAll() 20 | 21 | } 22 | inputFile.close(); 23 | } 24 | } 25 | 26 | int main(int argc, char *argv[]) 27 | { 28 | QCoreApplication a(argc, argv); 29 | 30 | QString text = "qt string is text"; 31 | auto wText = text.toStdWString(); 32 | 33 | std::cout << text.toStdString() << std::endl; 34 | 35 | return a.exec(); 36 | } 37 | -------------------------------------------------------------------------------- /Lib/TaoLibs.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/Lib/TaoLibs.zip -------------------------------------------------------------------------------- /MsilCodeCompiler/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /MsilCodeCompiler/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /OclHost/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /OclHost/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Source/CodeRefractor.Annotations/CppLibMethodAttribute.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.Runtime.Annotations 8 | { 9 | public class CppLibMethodAttribute : Attribute 10 | { 11 | public string Header { get; set; } 12 | public string Library { get; set; } 13 | public string Code { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /Source/CodeRefractor.Annotations/CppMethodBodyAttribute.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.Runtime.Annotations 8 | { 9 | public class CppMethodBodyAttribute : Attribute 10 | { 11 | public string Header { get; set; } 12 | public string Code { get; set; } 13 | public string Libraries { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /Source/CodeRefractor.Annotations/MapMethod.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.Runtime.Annotations 8 | { 9 | public class MapMethod : Attribute 10 | { 11 | public bool IsStatic { get; set; } 12 | public string Name { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /Source/CodeRefractor.Annotations/MapMethodAttribute.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.Runtime.Annotations 8 | { 9 | public class ExtensionsImplementation : Attribute 10 | { 11 | public ExtensionsImplementation(Type declaringType) 12 | { 13 | DeclaringType = declaringType; 14 | } 15 | 16 | public Type DeclaringType { get; private set; } 17 | } 18 | } -------------------------------------------------------------------------------- /Source/CodeRefractor.Annotations/MapTypeAttribute.cs: -------------------------------------------------------------------------------- 1 | #region Uses 2 | 3 | using System; 4 | 5 | #endregion 6 | 7 | namespace CodeRefractor.Runtime.Annotations 8 | { 9 | public class MapTypeAttribute : Attribute 10 | { 11 | public MapTypeAttribute(Type type) 12 | { 13 | MappedType = type; 14 | } 15 | 16 | public Type MappedType { get; } 17 | } 18 | } -------------------------------------------------------------------------------- /Source/CodeRefractor.Annotations/PureMethodAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeRefractor.Runtime.Annotations 4 | { 5 | public class PureMethodAttribute : Attribute 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /Source/CodeRefractor.CodeGen/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Source/Compiler/Compiler.CodeWriter/Linker/LinkingData.cs: -------------------------------------------------------------------------------- 1 | #region Usings 2 | 3 | using System.Collections.Generic; 4 | using Compiler.CodeWriter.Platform; 5 | 6 | #endregion 7 | 8 | namespace Compiler.CodeWriter.Linker 9 | { 10 | public class LinkingData 11 | { 12 | public static readonly List Libraries = new List(); 13 | public static int LibraryMethodCount; 14 | 15 | public StringTable Strings = new StringTable(); 16 | 17 | #region Singleton instance 18 | 19 | private static readonly LinkingData StaticInstance = new LinkingData(); 20 | 21 | public static LinkingData Instance 22 | { 23 | get { return StaticInstance; } 24 | } 25 | 26 | public static readonly HashSet Includes = new HashSet(); 27 | 28 | #endregion 29 | 30 | public static bool SetInclude(string include) 31 | { 32 | if (Includes.Contains(include)) 33 | return false; 34 | Includes.Add(include); 35 | return true; 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Source/Compiler/Compiler.CodeWriter/Platform/PlatformInvokeDllImports.cs: -------------------------------------------------------------------------------- 1 | #region Usings 2 | 3 | using System.Collections.Generic; 4 | 5 | #endregion 6 | 7 | namespace Compiler.CodeWriter.Platform 8 | { 9 | public class PlatformInvokeDllImports 10 | { 11 | public PlatformInvokeDllImports(string dllName) 12 | { 13 | DllName = dllName; 14 | } 15 | 16 | public string DllName { get; set; } 17 | 18 | public readonly Dictionary Methods = 19 | new Dictionary(); 20 | } 21 | } -------------------------------------------------------------------------------- /Source/Compiler/Compiler.CodeWriter/Platform/PlatformInvokeDllMethod.cs: -------------------------------------------------------------------------------- 1 | #region Usings 2 | 3 | using System; 4 | using System.Runtime.InteropServices; 5 | 6 | #endregion 7 | 8 | namespace Compiler.CodeWriter.Platform 9 | { 10 | public class PlatformInvokeDllMethod 11 | { 12 | public string Name { get; set; } 13 | public CallingConvention? CallingConvention { get; set; } 14 | public string EntryPoint { get; set; } 15 | 16 | public int Id { get; set; } 17 | 18 | public PlatformInvokeDllMethod(string name, CallingConvention? callingConvention = null, string entryPoint = "") 19 | { 20 | Name = name; 21 | CallingConvention = callingConvention; 22 | EntryPoint = !String.IsNullOrEmpty(entryPoint) ? entryPoint : name; 23 | } 24 | 25 | 26 | public string FormattedName() 27 | { 28 | return String.Format("dll_method_{0}", Id); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /TargetCppApp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.19) 2 | project(TargetCppApp) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(TargetCppApp output.cpp sloth.cpp) 7 | -------------------------------------------------------------------------------- /TargetCppApp/System_Console.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "System_Primitives.h" 4 | 5 | #include 6 | 7 | namespace System 8 | { 9 | struct String; 10 | std::shared_ptr> getArgumentsAsList(int argc, char**argv); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /TargetCppApp/output.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | struct System_Object; 3 | struct CodeRefactor_OpenRuntime_CrString; 4 | struct SimpleAdditions_TestShapes; 5 | struct CodeRefactor_OpenRuntime_CrConsole; 6 | struct SimpleAdditions_Shape; 7 | struct SimpleAdditions_Square; 8 | struct SimpleAdditions_Cube; 9 | struct CodeRefactor_OpenRuntime_CrMath; 10 | struct System_Object { 11 | int _typeId; 12 | 13 | } 14 | ; 15 | 16 | struct System_String : public System_Object { 17 | System_String() { 18 | _typeId = 11; 19 | 20 | } 21 | 22 | std::shared_ptr< Array < System_Char > > Text; 23 | 24 | } 25 | ; 26 | 27 | struct SimpleAdditions_TestShapes : public System_Object { 28 | 29 | } 30 | ; 31 | 32 | struct System_Console : public System_Object { 33 | 34 | } 35 | ; 36 | 37 | struct SimpleAdditions_Shape : public System_Object { 38 | 39 | } 40 | ; 41 | 42 | struct SimpleAdditions_Square : public SimpleAdditions_Shape { 43 | System_Double side; 44 | 45 | } 46 | ; 47 | 48 | struct SimpleAdditions_Cube : public SimpleAdditions_Shape { 49 | System_Double side; 50 | 51 | } 52 | ; 53 | 54 | struct System_Math : public System_Object { 55 | 56 | } 57 | ; 58 | 59 | -------------------------------------------------------------------------------- /TargetCppApp/sloth.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by cipri on 7/12/2021. 3 | // 4 | 5 | 6 | #include 7 | #include 8 | 9 | #include "System_Primitives.h" 10 | #include "output.hpp" 11 | #include "sloth.h" 12 | 13 | struct System_String; 14 | 15 | namespace { 16 | std::vector > _stringJumps; 17 | static std::vector _constTables; 18 | } 19 | 20 | std::shared_ptr _str(int index) 21 | { 22 | return _stringJumps[index]; 23 | } 24 | 25 | void _AddJumpAndLength(int jump, int length) 26 | { 27 | auto resultData = &(_stringTable[jump]); 28 | 29 | auto result = std::make_shared(); 30 | auto value = std::make_shared>(length+1, resultData); 31 | result->Text = value; 32 | _stringJumps.push_back(result); 33 | } 34 | System_Boolean System_IntPtr_op_Equality( 35 | const System_IntPtr&src, 36 | const System_IntPtr&dest) 37 | { 38 | return src == dest; 39 | } 40 | 41 | 42 | System_Byte* RuntimeHelpers_GetBytes(int id) 43 | { 44 | return _constTables[id]; 45 | } 46 | 47 | void AddConstantByteArray(System_Byte* data) 48 | { 49 | _constTables.push_back(data); 50 | } -------------------------------------------------------------------------------- /TargetCppApp/sloth.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define _CRT_SECURE_NO_WARNINGS 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "./System_Console.h" 11 | 12 | extern const wchar_t _stringTable[]; 13 | -------------------------------------------------------------------------------- /TargetCppApp/sloth_platform.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by cipri on 7/12/2021. 3 | // 4 | 5 | #pragma once 6 | 7 | 8 | std::shared_ptr _str(int index); 9 | void _AddJumpAndLength(int jump, int length); 10 | -------------------------------------------------------------------------------- /Views/CodeRefractor.Launcher/Program.cs: -------------------------------------------------------------------------------- 1 | #region Usings 2 | 3 | using System; 4 | using System.Windows.Forms; 5 | 6 | #endregion 7 | 8 | namespace CodeRefractor.Launcher 9 | { 10 | internal static class Program 11 | { 12 | /// 13 | /// The main entry point for the application. 14 | /// 15 | [STAThread] 16 | private static void Main() 17 | { 18 | Application.EnableVisualStyles(); 19 | Application.SetCompatibleTextRenderingDefault(false); 20 | Application.Run(new MainForm()); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Views/CodeRefractor.Launcher/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.17929 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CodeRefractor.Launcher.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Views/CodeRefractor.Launcher/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /VisualCompiler/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /VisualCompiler/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /VisualCompiler/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | 8 | namespace VisualCompiler 9 | { 10 | /// 11 | /// Interaction logic for App.xaml 12 | /// 13 | public partial class App : Application 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /VisualCompiler/CompilerUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace VisualCompiler 5 | { 6 | public static class CompilerUtils 7 | { 8 | public static void DeleteFilesByWildcards(string pattern, string path = "./") 9 | { 10 | var files = Directory.GetFiles(path, pattern); 11 | foreach (var file in files) 12 | { 13 | try 14 | { 15 | File.Delete(file); 16 | } 17 | catch(Exception ex) 18 | { 19 | Console.WriteLine("Exception: "+ex); 20 | } 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /VisualCompiler/CustomizedBrush.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Media; 2 | using ICSharpCode.AvalonEdit.Highlighting; 3 | using ICSharpCode.AvalonEdit.Rendering; 4 | 5 | namespace VisualCompiler 6 | { 7 | internal sealed class CustomizedBrush : HighlightingBrush 8 | { 9 | private readonly SolidColorBrush brush; 10 | public CustomizedBrush(Color color) 11 | { 12 | brush = CreateFrozenBrush(color); 13 | } 14 | 15 | public CustomizedBrush(System.Drawing.Color c) 16 | { 17 | var c2 = System.Windows.Media.Color.FromArgb(c.A, c.R, c.G, c.B); 18 | brush = CreateFrozenBrush(c2); 19 | } 20 | 21 | public override Brush GetBrush(ITextRunConstructionContext context) 22 | { 23 | return brush; 24 | } 25 | 26 | public override string ToString() 27 | { 28 | return brush.ToString(); 29 | } 30 | 31 | private static SolidColorBrush CreateFrozenBrush(Color color) 32 | { 33 | SolidColorBrush brush = new SolidColorBrush(color); 34 | brush.Freeze(); 35 | return brush; 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /VisualCompiler/Icons/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/Icons/run.png -------------------------------------------------------------------------------- /VisualCompiler/MahApps.Metro.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/MahApps.Metro.dll -------------------------------------------------------------------------------- /VisualCompiler/NotificationViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Linq.Expressions; 4 | 5 | namespace VisualCompiler 6 | { 7 | public class NotificationViewModel : INotifyPropertyChanged 8 | { 9 | public event PropertyChangedEventHandler PropertyChanged; 10 | // Create the OnPropertyChanged method to raise the event 11 | void Changed(string name) 12 | { 13 | var handler = PropertyChanged; 14 | if (handler != null) 15 | handler(this, new PropertyChangedEventArgs(name)); 16 | } 17 | 18 | 19 | public void Changed(Expression> propertyName) 20 | { 21 | var body = propertyName.Body as MemberExpression; 22 | if (body == null) 23 | throw new ArgumentException("'propertyExpression' should be a member expression"); 24 | 25 | Changed(body.Member.Name); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /VisualCompiler/OpenRuntime/System_Console.h: -------------------------------------------------------------------------------- 1 | #ifndef SystemConsole_H 2 | #define SystemConsole_H 3 | 4 | #include "System_Primitives.h" 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | namespace System 11 | { 12 | struct String; 13 | std::shared_ptr< Array < System::String> > getArgumentsAsList(int argc, char**argv); 14 | 15 | } 16 | 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /VisualCompiler/OpenRuntime/libCodeRefactorRuntime.a: -------------------------------------------------------------------------------- 1 | ! 2 | -------------------------------------------------------------------------------- /VisualCompiler/OpenRuntime/sloth.h: -------------------------------------------------------------------------------- 1 | #ifndef SLOTH_H 2 | #define SLOTH_H 3 | #undef __STRICT_ANSI__ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "System_Primitives.h" 11 | #include "System_Console.h" 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /VisualCompiler/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.33440 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace VisualCompiler.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /VisualCompiler/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /VisualCompiler/Tests/ArraysTest01.cs: -------------------------------------------------------------------------------- 1 | public static class Program 2 | { 3 | public static void Main() 4 | { 5 | var testArray = new[] { "a", "b" }; 6 | 7 | System.Console.WriteLine(testArray.Length); 8 | System.Console.WriteLine(testArray[0]); 9 | System.Console.WriteLine(testArray[1]); 10 | 11 | testArray[1] = "c"; 12 | System.Console.WriteLine(testArray[1]); 13 | } 14 | } -------------------------------------------------------------------------------- /VisualCompiler/Tests/BoolTest.cs: -------------------------------------------------------------------------------- 1 | public static class Program 2 | { 3 | 4 | 5 | public static void Main() 6 | { 7 | //This works 8 | bool result = (1 == 2); 9 | 10 | if (result) 11 | System.Console.WriteLine("True"); 12 | else 13 | System.Console.WriteLine("False"); 14 | 15 | //This doesn't, now works added Console.WriteLine(bool) 16 | System.Console.WriteLine(1 == 2); 17 | } 18 | } -------------------------------------------------------------------------------- /VisualCompiler/Tests/CallByReferenceTest.cs: -------------------------------------------------------------------------------- 1 | public static class Program 2 | { 3 | public static void Method1(ref int i, ref string str) 4 | { 5 | System.Console.WriteLine(i); 6 | System.Console.WriteLine(str); 7 | 8 | i += 32; 9 | str = "Test2"; 10 | } 11 | 12 | public static void Main() 13 | { 14 | int i = 8; 15 | string str = "Test1"; 16 | 17 | System.Console.WriteLine(i); 18 | System.Console.WriteLine(str); 19 | Method1(ref i, ref str); 20 | System.Console.WriteLine(i); 21 | System.Console.WriteLine(str); 22 | } 23 | } -------------------------------------------------------------------------------- /VisualCompiler/Tests/CallTest01.cs: -------------------------------------------------------------------------------- 1 | //From SharpLang, tests calling and branching 2 | public static class Program 3 | { 4 | public static void Method1(bool flag) 5 | { 6 | if (flag) 7 | System.Console.WriteLine("True"); 8 | else 9 | System.Console.WriteLine("False"); 10 | } 11 | 12 | public static void Main() 13 | { 14 | Method1(true); 15 | Method1(false); 16 | } 17 | } -------------------------------------------------------------------------------- /VisualCompiler/Tests/CastClassTest2.cs: -------------------------------------------------------------------------------- 1 | //CastClass Test 2 - Passes, but interface support are not yet written, so fails 2 | 3 | using System; 4 | 5 | namespace Obj 6 | { 7 | interface Bah 8 | { 9 | int H(); 10 | } 11 | class A : Bah 12 | { 13 | public int F() { return 1; } 14 | public virtual int G() { return 2; } 15 | public int H() { return 10; } 16 | } 17 | class B : A 18 | { 19 | public new int F() { return 3; } 20 | public override int G() { return 4; } 21 | public new int H() { return 11; } 22 | } 23 | class Test 24 | { 25 | static public void Main() 26 | { 27 | int result = 0; 28 | B b = new B(); 29 | A a = b; 30 | 31 | Console.WriteLine(a.H()); 32 | Console.WriteLine(((A)b).H()); 33 | Console.WriteLine(((B)a).H()); 34 | 35 | Console.WriteLine(result); 36 | } 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /VisualCompiler/Tests/ClassMethodTest1.cs: -------------------------------------------------------------------------------- 1 | //Class Method Test 1 - base class calls working 2 | using System; 3 | 4 | class A 5 | { 6 | public virtual void Test() 7 | { 8 | Console.WriteLine("A.Test"); 9 | } 10 | } 11 | 12 | class B : A 13 | { 14 | public override void Test() 15 | { 16 | Console.WriteLine("B.Test"); 17 | base.Test(); 18 | } 19 | } 20 | 21 | //If we add C order of definitions becomes a problem 22 | 23 | class Program 24 | { 25 | static void Main() 26 | { 27 | 28 | 29 | // Compile-time type is A. 30 | // Runtime type is B. 31 | A ref2 = new B(); 32 | ref2.Test(); 33 | 34 | 35 | } 36 | } -------------------------------------------------------------------------------- /VisualCompiler/Tests/GenericsTest1.cs: -------------------------------------------------------------------------------- 1 | //SharpLang 2 | //This works 3 | public static class Program 4 | { 5 | public class Test 6 | { 7 | public T A; 8 | public T B { get; set; } 9 | } 10 | 11 | public static void Main() 12 | { 13 | var test1 = new Test { A = 32, B = 64 }; 14 | var test2 = new Test { A = "Test1", B = "Test2" }; 15 | 16 | System.Console.WriteLine(test1.A); 17 | System.Console.WriteLine(test1.B); 18 | System.Console.WriteLine(test2.A); 19 | System.Console.WriteLine(test2.B); 20 | } 21 | } -------------------------------------------------------------------------------- /VisualCompiler/Tests/GenericsTest2.cs: -------------------------------------------------------------------------------- 1 | //SharpLang 2 | //Needs Fixes 3 | public static class Program 4 | { 5 | public class Test1 6 | { 7 | public T Value { get; set; } 8 | 9 | public T Test() 10 | { 11 | return Value; 12 | } 13 | } 14 | 15 | public class Test2 16 | { 17 | public Test1 Item; 18 | 19 | public T Test() 20 | { 21 | return Item.Test(); 22 | } 23 | } 24 | 25 | public static void Main() 26 | { 27 | var test2 = new Test2 { Item = new Test1 { Value = 32 } }; 28 | 29 | System.Console.WriteLine(test2.Test()); 30 | } 31 | } -------------------------------------------------------------------------------- /VisualCompiler/Tests/GenericsTest3.cs: -------------------------------------------------------------------------------- 1 | //SharpLang 2 | //Works 3 | //Simple Generic Function 4 | using System; 5 | 6 | public static class Program 7 | { 8 | public static T Test(T test) 9 | { 10 | return test; 11 | } 12 | 13 | public static void Main() 14 | { 15 | System.Console.WriteLine(Test(32)); 16 | System.Console.WriteLine(Test("Test1")); 17 | } 18 | } -------------------------------------------------------------------------------- /VisualCompiler/Tests/NewPropertyTest.cs: -------------------------------------------------------------------------------- 1 | //Multiple issues with this test, TODO: Ciprian can you have a look at this ? 2 | public class Employee 3 | { 4 | private string name; 5 | public string Name 6 | { 7 | get { return name; } 8 | set { name = value; } 9 | } 10 | } 11 | 12 | public class Manager : Employee 13 | { 14 | private string name; 15 | 16 | // Notice the use of the new modifier: 17 | public new string Name 18 | { 19 | get { return name; } 20 | set { name = ", Manager"; } //This is very problematic 21 | } 22 | } 23 | 24 | class TestHiding 25 | { 26 | static void Main() 27 | { 28 | Manager m1 = new Manager(); 29 | 30 | // Derived class property. 31 | m1.Name = "John"; 32 | 33 | // Base class property. 34 | ((Employee)m1).Name = "Mary"; 35 | 36 | System.Console.Write("Name in the derived class is: {0}"); 37 | System.Console.WriteLine(m1.Name); 38 | System.Console.Write("Name in the base class is: {0}"); 39 | System.Console.WriteLine(((Employee)m1).Name); 40 | } 41 | } -------------------------------------------------------------------------------- /VisualCompiler/Tests/PlatformInvokeTest01.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | class PlatformInvokeTest01 { 4 | 5 | [DllImport("user32.dll")] 6 | private static extern int MessageBoxW(System.IntPtr hWnd, string lpText, string lpCaption, System.UInt32 uType); 7 | //We use wide chars only 8 | static void Main() { 9 | MessageBoxW(System.IntPtr.Zero, "Hello, world!", "Test", 64); 10 | } 11 | } -------------------------------------------------------------------------------- /VisualCompiler/Tests/StructTest01.cs: -------------------------------------------------------------------------------- 1 | //Structs work but there is an issue with structs in arrays 2 | //Also Array code is too verbose and alot of unneccesary code is generated, can we partially decompile such 3 | //code using some kind of instrinsic probably from ILSPY ? 4 | public static class Program 5 | { 6 | struct Test 7 | { 8 | public int A; 9 | } 10 | 11 | public static void Main() 12 | { 13 | 14 | var struct1 = new Test { A = 32 }; 15 | var struct2 = new Test { A = 16 }; 16 | 17 | System.Console.WriteLine(struct1.A); 18 | System.Console.WriteLine(struct2.A); 19 | 20 | /* 21 | * The Following doesn't work ... 22 | var testArray = new Test[] 23 | { 24 | new Test { A = 32 }, 25 | new Test { A = 16 }, 26 | }; 27 | 28 | System.Console.WriteLine(testArray[1].A); 29 | 30 | var test = testArray[0]; 31 | System.Console.WriteLine(test.A);*/ 32 | } 33 | } -------------------------------------------------------------------------------- /VisualCompiler/Tests/VirtualMethodsTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class A 4 | { 5 | public virtual void Test() 6 | { 7 | Console.WriteLine("A.Test"); 8 | } 9 | } 10 | 11 | class B : A 12 | { 13 | public override void Test() 14 | { 15 | Console.WriteLine("B.Test"); 16 | } 17 | } 18 | 19 | class C : B 20 | { 21 | public override void Test() 22 | { 23 | Console.WriteLine("C.Test"); 24 | } 25 | } 26 | 27 | 28 | //If we add C order of definitions becomes a problem 29 | 30 | class Program 31 | { 32 | static void Main() 33 | { 34 | // Compile-time type is A. 35 | // Runtime type is A as well. 36 | A ref1 = new A(); 37 | ref1.Test(); 38 | 39 | // Compile-time type is A. 40 | // Runtime type is B. 41 | A ref2 = new B(); 42 | ref2.Test(); 43 | 44 | // Compile-time type is A. 45 | // Runtime type is B. 46 | A ref3 = new C(); 47 | ref3.Test(); 48 | 49 | } 50 | } -------------------------------------------------------------------------------- /VisualCompiler/Tests/VirtualMethodsTest2.cs: -------------------------------------------------------------------------------- 1 | //Taken From Microsoft Documentation on Virtual Methods 2 | using System; 3 | class A 4 | { 5 | public void F() { Console.WriteLine("A.F"); } 6 | public virtual void G() { Console.WriteLine("A.G"); } 7 | } 8 | class B : A 9 | { 10 | new public void F() { Console.WriteLine("B.F"); } 11 | public override void G() { Console.WriteLine("B.G"); } 12 | } 13 | class Test 14 | { 15 | static void Main() 16 | { 17 | B b = new B(); 18 | A a = b; 19 | a.F(); 20 | b.F(); 21 | a.G(); 22 | b.G(); 23 | } 24 | } -------------------------------------------------------------------------------- /VisualCompiler/Tests/VirtualMethodsTest3.cs: -------------------------------------------------------------------------------- 1 | //Was hanging compiler on multiple trampolines ... now fixed 2 | using System; 3 | class A 4 | { 5 | public void F() { Console.WriteLine("A.F"); } 6 | public virtual void G() { Console.WriteLine("A.G"); } 7 | } 8 | class B : A 9 | { 10 | new public void F() { Console.WriteLine("B.F"); } 11 | public override void G() { Console.WriteLine("B.G"); } 12 | } 13 | class C : B 14 | { 15 | new public void F() { Console.WriteLine("C.F"); } 16 | public override void G() { Console.WriteLine("C.G"); } 17 | } 18 | class Test 19 | { 20 | static void Main() 21 | { 22 | C c = new C(); 23 | B b = c; 24 | A a = b; 25 | a.F(); 26 | b.F(); 27 | c.F(); 28 | a.G(); 29 | b.G(); 30 | c.G(); // - causes crash ... resolution issue ? Fixed 31 | } 32 | } -------------------------------------------------------------------------------- /VisualCompiler/Tests/VirtualMethodsTest7.cs: -------------------------------------------------------------------------------- 1 | //Borrowed from SharpLang Tests 2 | public static class Program 3 | { 4 | public interface ITest 5 | { 6 | string A(); 7 | } 8 | 9 | public class Test1 : ITest 10 | { 11 | public virtual string A() 12 | { 13 | return "Test1"; 14 | } 15 | } 16 | 17 | public class Test2 : Test1 18 | { 19 | } 20 | 21 | public class Test3 : Test1 22 | { 23 | public override string A() 24 | { 25 | return "Test3"; 26 | } 27 | } 28 | 29 | public class Test4 : Test1, ITest 30 | { 31 | string ITest.A() 32 | { 33 | return "Test4"; 34 | } 35 | } 36 | 37 | public static void Main() 38 | { 39 | ITest test1 = new Test1(); 40 | ITest test2 = new Test2(); 41 | ITest test3 = new Test3(); 42 | ITest test4 = new Test4(); 43 | 44 | System.Console.WriteLine(test1.A()); 45 | System.Console.WriteLine(test2.A()); 46 | System.Console.WriteLine(test3.A()); 47 | System.Console.WriteLine(test4.A()); 48 | } 49 | } -------------------------------------------------------------------------------- /VisualCompiler/VisualCompiler.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | True -------------------------------------------------------------------------------- /VisualCompiler/VisualCompilerConstants.cs: -------------------------------------------------------------------------------- 1 | namespace VisualCompiler 2 | { 3 | static class VisualCompilerConstants 4 | { 5 | public static string InitialCode = @"using System; 6 | 7 | class Primes 8 | { 9 | 10 | 11 | 12 | public static void Main() 13 | { 14 | Console.WriteLine(""Prime numbers: "".Length); 15 | var len = 1000000; 16 | var primes = AddPrimes(len); 17 | Console.Write(primes); 18 | 19 | } 20 | 21 | private static int AddPrimes(int len) 22 | { 23 | var primes = 0; 24 | for (var i = 2; i < len; i++) 25 | { 26 | if (i%2 == 0) 27 | continue; 28 | var isPrime = true; 29 | for (var j = 2; j*j <= i; j++) 30 | { 31 | if (i%j == 0) 32 | { 33 | isPrime = false; 34 | break; 35 | } 36 | } 37 | if (isPrime) 38 | primes++; 39 | } 40 | return primes; 41 | } 42 | 43 | }"; 44 | } 45 | } -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/ICSharpCode.AvalonEdit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/bin/Debug/ICSharpCode.AvalonEdit.dll -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/MahApps.Metro.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/bin/Debug/MahApps.Metro.dll -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/OpenRuntime/CodeRefactor.OpenRuntime.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/bin/Debug/OpenRuntime/CodeRefactor.OpenRuntime.dll -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/OpenRuntime/CodeRefractor.RuntimeBase.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/bin/Debug/OpenRuntime/CodeRefractor.RuntimeBase.dll -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/OpenRuntime/System_Console.h: -------------------------------------------------------------------------------- 1 | #ifndef SystemConsole_H 2 | #define SystemConsole_H 3 | 4 | #include "System_Primitives.h" 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | namespace System 11 | { 12 | struct String; 13 | std::shared_ptr< Array < System::String> > getArgumentsAsList(int argc, char**argv); 14 | 15 | } 16 | #endif 17 | -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/OpenRuntime/libCodeRefactorRuntime.a: -------------------------------------------------------------------------------- 1 | ! 2 | -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/OpenRuntime/sloth.h: -------------------------------------------------------------------------------- 1 | #ifndef SLOTH_H 2 | #define SLOTH_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "System_Primitives.h" 10 | #include "System_Console.h" 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/System.Windows.Interactivity.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/bin/Debug/System.Windows.Interactivity.dll -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/VisualCompiler.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/VisualCompiler.vshost.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/de/System.Windows.Interactivity.resources.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/bin/Debug/de/System.Windows.Interactivity.resources.dll -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/en/System.Windows.Interactivity.resources.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/bin/Debug/en/System.Windows.Interactivity.resources.dll -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/es/System.Windows.Interactivity.resources.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/bin/Debug/es/System.Windows.Interactivity.resources.dll -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/fr/System.Windows.Interactivity.resources.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/bin/Debug/fr/System.Windows.Interactivity.resources.dll -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/it/System.Windows.Interactivity.resources.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/bin/Debug/it/System.Windows.Interactivity.resources.dll -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/ja/System.Windows.Interactivity.resources.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/bin/Debug/ja/System.Windows.Interactivity.resources.dll -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/ko/System.Windows.Interactivity.resources.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/bin/Debug/ko/System.Windows.Interactivity.resources.dll -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/zh-Hans/System.Windows.Interactivity.resources.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/bin/Debug/zh-Hans/System.Windows.Interactivity.resources.dll -------------------------------------------------------------------------------- /VisualCompiler/bin/Debug/zh-Hant/System.Windows.Interactivity.resources.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/VisualCompiler/bin/Debug/zh-Hant/System.Windows.Interactivity.resources.dll -------------------------------------------------------------------------------- /VisualCompiler/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /VmTests/MsilCodeCompiler.Tests/OpenRuntime/MathRuntimeTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CodeRefactor.OpenRuntime; 3 | using NUnit.Framework; 4 | 5 | namespace MsilCodeCompiler.Tests.OpenRuntime 6 | { 7 | [TestFixture] 8 | public class MathRuntimeTests 9 | { 10 | [Test] 11 | public void MathAbsInt16Test() 12 | { 13 | var v1 = (Int16)(-3); 14 | var v2 = Math.Abs(v1); 15 | var v3 = MathImpl.Abs(v1); 16 | Assert.AreEqual(v2, v3); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /VmTests/MsilCodeCompiler.Tests/OptimizationsTests/TestConstantVariableOperatorPropagationTests.cs: -------------------------------------------------------------------------------- 1 | #region Usings 2 | 3 | using System.Collections.Generic; 4 | using CodeRefractor.MiddleEnd.Optimizations.Common; 5 | using CodeRefractor.MiddleEnd.Optimizations.ConstantFoldingAndPropagation; 6 | using MsilCodeCompiler.Tests.Shared; 7 | using NUnit.Framework; 8 | 9 | #endregion 10 | 11 | namespace MsilCodeCompiler.Tests.OptimizationsTests 12 | { 13 | /// 14 | /// Test with specified body :) 15 | /// and with one optimization 16 | /// 17 | [TestFixture] 18 | public class TestConstantVariableOperatorPropagationTests : CompilingProgramBase 19 | { 20 | [Test] 21 | public void TestSimple() 22 | { 23 | var optimizations = new List 24 | { 25 | new ConstantVariableOperatorPropagation() 26 | }; 27 | var mainBody = 28 | @"var a = 30.0; 29 | var b = 9.0 - (int)a / 5; 30 | 31 | Console.WriteLine(b);"; 32 | TryCSharpMain(mainBody, optimizations); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /VmTests/MsilCodeCompiler.Tests/Serializing/LocalOperationTests.cs: -------------------------------------------------------------------------------- 1 | using CodeRefractor.FrontEnd.SimpleOperations; 2 | using NUnit.Framework; 3 | 4 | namespace MsilCodeCompiler.Tests.Serializing 5 | { 6 | [TestFixture] 7 | internal class LocalOperationTests 8 | { 9 | [Test] 10 | public void CloneInstructions() 11 | { 12 | var label = new Label {JumpTo = 245}; 13 | var clonedLabel = (Label)label.Clone(); 14 | Assert.AreEqual(label.JumpTo, clonedLabel.JumpTo); 15 | } 16 | 17 | [Test] 18 | public void BuildToString() 19 | { 20 | var label = new Label { JumpTo = 245 }; 21 | var aString = label.ToString(); 22 | Assert.IsNotEmpty(aString); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /VmTests/MsilCodeCompiler.Tests/Serializing/TestCompactBinaryFromXml.cs: -------------------------------------------------------------------------------- 1 | using CodeRefractor.DataNode; 2 | using NUnit.Framework; 3 | 4 | namespace MsilCodeCompiler.Tests.Serializing 5 | { 6 | [TestFixture] 7 | internal class TestCompactBinaryFromXml 8 | { 9 | [Test] 10 | public void TestCompactingXmlWithAttribute() 11 | { 12 | var dynNode = new DynNode("Type") 13 | { 14 | {"Name", "Int32"}, 15 | {"Namespace", "System"} 16 | }; 17 | var fieldsNode = dynNode.Add("Fields"); 18 | fieldsNode.Add("X", "1"); //TypeId of int 19 | var offsets = dynNode.Add("OffsetFields"); 20 | offsets.Add("X", "0"); 21 | var minimizer = new MinimizeTransformer(); 22 | var compressedReflectionData = minimizer.Minimize(dynNode, false); 23 | 24 | var expander = new ExpanderTransformer(); 25 | var restoredNode = expander.Expand(compressedReflectionData, false); 26 | 27 | Assert.AreEqual(dynNode.Children.Count, restoredNode.Children.Count); 28 | Assert.AreEqual(dynNode.Attributes.Count, restoredNode.Attributes.Count); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /VmTests/MsilCodeCompiler.Tests/TestCompilingClasses.cs: -------------------------------------------------------------------------------- 1 | #region Usings 2 | 3 | using MsilCodeCompiler.Tests.Shared; 4 | using NUnit.Framework; 5 | 6 | #endregion 7 | 8 | namespace MsilCodeCompiler.Tests 9 | { 10 | [TestFixture] 11 | public class TestCompilingClasses : CompilingProgramBase 12 | { 13 | [Test] 14 | public void TestCompilation() 15 | { 16 | var bodyOfProgram = @" 17 | using System; 18 | 19 | class Point { 20 | public int X; 21 | public int Y; 22 | } 23 | 24 | class Program { 25 | public static void Main() { 26 | var p = new Point() { 27 | X = 2, 28 | Y = 4 29 | }; 30 | Console.Write(p.X); 31 | } 32 | } 33 | "; 34 | 35 | Assert.IsTrue(TryCompileCSharp(bodyOfProgram)); 36 | } 37 | 38 | [Test] 39 | public void TestCallCompilation() 40 | { 41 | var bodyOfProgram = @" 42 | using System; 43 | class Program { 44 | public static void Main() { 45 | var dx = 1.0; 46 | var squareRoot = Math.Sqrt(dx); 47 | Console.Write(squareRoot); 48 | } 49 | } 50 | "; 51 | 52 | Assert.IsTrue(TryCompileCSharp(bodyOfProgram)); 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /VmTests/MsilCodeCompiler.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /VmTests/Projects/SimpleAdditions/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/AvalonEdit.4.4.2.9744/AvalonEdit.4.4.2.9744.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/AvalonEdit.4.4.2.9744/AvalonEdit.4.4.2.9744.nupkg -------------------------------------------------------------------------------- /packages/AvalonEdit.4.4.2.9744/lib/Net35/ICSharpCode.AvalonEdit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/AvalonEdit.4.4.2.9744/lib/Net35/ICSharpCode.AvalonEdit.dll -------------------------------------------------------------------------------- /packages/AvalonEdit.4.4.2.9744/lib/Net40/ICSharpCode.AvalonEdit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/AvalonEdit.4.4.2.9744/lib/Net40/ICSharpCode.AvalonEdit.dll -------------------------------------------------------------------------------- /packages/AvalonEdit.Sample.4.4.2.9744/AvalonEdit.Sample.4.4.2.9744.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/AvalonEdit.Sample.4.4.2.9744/AvalonEdit.Sample.4.4.2.9744.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.Bcl.Immutable.1.1.20-beta/Microsoft.Bcl.Immutable.1.1.20-beta.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.Bcl.Immutable.1.1.20-beta/Microsoft.Bcl.Immutable.1.1.20-beta.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.Bcl.Immutable.1.1.20-beta/lib/portable-net45+win8/System.Collections.Immutable.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.Bcl.Immutable.1.1.20-beta/lib/portable-net45+win8/System.Collections.Immutable.dll -------------------------------------------------------------------------------- /packages/Microsoft.Bcl.Metadata.1.0.11-alpha/Microsoft.Bcl.Metadata.1.0.11-alpha.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.Bcl.Metadata.1.0.11-alpha/Microsoft.Bcl.Metadata.1.0.11-alpha.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.Bcl.Metadata.1.0.11-alpha/lib/portable-net45+win8/System.Reflection.Metadata.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.Bcl.Metadata.1.0.11-alpha/lib/portable-net45+win8/System.Reflection.Metadata.dll -------------------------------------------------------------------------------- /packages/Microsoft.CodeAnalysis.0.7.4052301-beta/Microsoft.CodeAnalysis.0.7.4052301-beta.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.CodeAnalysis.0.7.4052301-beta/Microsoft.CodeAnalysis.0.7.4052301-beta.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.CodeAnalysis.CSharp.0.7.4052301-beta/Microsoft.CodeAnalysis.CSharp.0.7.4052301-beta.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.CodeAnalysis.CSharp.0.7.4052301-beta/Microsoft.CodeAnalysis.CSharp.0.7.4052301-beta.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.CodeAnalysis.CSharp.0.7.4052301-beta/lib/net45/Microsoft.CodeAnalysis.CSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.CodeAnalysis.CSharp.0.7.4052301-beta/lib/net45/Microsoft.CodeAnalysis.CSharp.dll -------------------------------------------------------------------------------- /packages/Microsoft.CodeAnalysis.CSharp.Workspaces.0.7.4052301-beta/Microsoft.CodeAnalysis.CSharp.Workspaces.0.7.4052301-beta.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.CodeAnalysis.CSharp.Workspaces.0.7.4052301-beta/Microsoft.CodeAnalysis.CSharp.Workspaces.0.7.4052301-beta.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.CodeAnalysis.CSharp.Workspaces.0.7.4052301-beta/lib/net45/Microsoft.CodeAnalysis.CSharp.Workspaces.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.CodeAnalysis.CSharp.Workspaces.0.7.4052301-beta/lib/net45/Microsoft.CodeAnalysis.CSharp.Workspaces.dll -------------------------------------------------------------------------------- /packages/Microsoft.CodeAnalysis.Common.0.7.4052301-beta/Microsoft.CodeAnalysis.Common.0.7.4052301-beta.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.CodeAnalysis.Common.0.7.4052301-beta/Microsoft.CodeAnalysis.Common.0.7.4052301-beta.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.CodeAnalysis.Common.0.7.4052301-beta/lib/net45/Microsoft.CodeAnalysis.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.CodeAnalysis.Common.0.7.4052301-beta/lib/net45/Microsoft.CodeAnalysis.dll -------------------------------------------------------------------------------- /packages/Microsoft.CodeAnalysis.VisualBasic.0.7.4052301-beta/Microsoft.CodeAnalysis.VisualBasic.0.7.4052301-beta.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.CodeAnalysis.VisualBasic.0.7.4052301-beta/Microsoft.CodeAnalysis.VisualBasic.0.7.4052301-beta.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.CodeAnalysis.VisualBasic.0.7.4052301-beta/lib/net45/Microsoft.CodeAnalysis.VisualBasic.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.CodeAnalysis.VisualBasic.0.7.4052301-beta/lib/net45/Microsoft.CodeAnalysis.VisualBasic.dll -------------------------------------------------------------------------------- /packages/Microsoft.CodeAnalysis.VisualBasic.Workspaces.0.7.4052301-beta/Microsoft.CodeAnalysis.VisualBasic.Workspaces.0.7.4052301-beta.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.CodeAnalysis.VisualBasic.Workspaces.0.7.4052301-beta/Microsoft.CodeAnalysis.VisualBasic.Workspaces.0.7.4052301-beta.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.CodeAnalysis.VisualBasic.Workspaces.0.7.4052301-beta/lib/net45/Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.CodeAnalysis.VisualBasic.Workspaces.0.7.4052301-beta/lib/net45/Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll -------------------------------------------------------------------------------- /packages/Microsoft.CodeAnalysis.Workspaces.Common.0.7.4052301-beta/Microsoft.CodeAnalysis.Workspaces.Common.0.7.4052301-beta.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.CodeAnalysis.Workspaces.Common.0.7.4052301-beta/Microsoft.CodeAnalysis.Workspaces.Common.0.7.4052301-beta.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.CodeAnalysis.Workspaces.Common.0.7.4052301-beta/lib/net45/Microsoft.CodeAnalysis.Workspaces.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Microsoft.CodeAnalysis.Workspaces.Common.0.7.4052301-beta/lib/net45/Microsoft.CodeAnalysis.Workspaces.dll -------------------------------------------------------------------------------- /packages/Roslyn.Compilers.CSharp.1.2.20906.2/Roslyn.Compilers.CSharp.1.2.20906.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Roslyn.Compilers.CSharp.1.2.20906.2/Roslyn.Compilers.CSharp.1.2.20906.2.nupkg -------------------------------------------------------------------------------- /packages/Roslyn.Compilers.CSharp.1.2.20906.2/lib/net45/Roslyn.Compilers.CSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Roslyn.Compilers.CSharp.1.2.20906.2/lib/net45/Roslyn.Compilers.CSharp.dll -------------------------------------------------------------------------------- /packages/Roslyn.Compilers.Common.1.2.20906.2/Roslyn.Compilers.Common.1.2.20906.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Roslyn.Compilers.Common.1.2.20906.2/Roslyn.Compilers.Common.1.2.20906.2.nupkg -------------------------------------------------------------------------------- /packages/Roslyn.Compilers.Common.1.2.20906.2/lib/net45/Roslyn.Compilers.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Roslyn.Compilers.Common.1.2.20906.2/lib/net45/Roslyn.Compilers.dll -------------------------------------------------------------------------------- /packages/Roslyn.Services.CSharp.1.2.20906.2/Roslyn.Services.CSharp.1.2.20906.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Roslyn.Services.CSharp.1.2.20906.2/Roslyn.Services.CSharp.1.2.20906.2.nupkg -------------------------------------------------------------------------------- /packages/Roslyn.Services.CSharp.1.2.20906.2/lib/net45/Roslyn.Services.CSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Roslyn.Services.CSharp.1.2.20906.2/lib/net45/Roslyn.Services.CSharp.dll -------------------------------------------------------------------------------- /packages/Roslyn.Services.Common.1.2.20906.2/Roslyn.Services.Common.1.2.20906.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Roslyn.Services.Common.1.2.20906.2/Roslyn.Services.Common.1.2.20906.2.nupkg -------------------------------------------------------------------------------- /packages/Roslyn.Services.Common.1.2.20906.2/lib/net45/Roslyn.Services.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Roslyn.Services.Common.1.2.20906.2/lib/net45/Roslyn.Services.dll -------------------------------------------------------------------------------- /packages/Roslyn.Services.Common.1.2.20906.2/lib/net45/Roslyn.Utilities.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ciplogic/CodeRefractor/b34c5e10148bdb8256429c35688f944c8da1d75f/packages/Roslyn.Services.Common.1.2.20906.2/lib/net45/Roslyn.Utilities.dll -------------------------------------------------------------------------------- /packages/Roslyn.Services.Common.1.2.20906.2/lib/net45/Roslyn.Utilities.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Roslyn.Utilities 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /packages/repositories.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | --------------------------------------------------------------------------------