コード例 #1
0
        public void SetupPasses(ILibrary library)
        {
            TranslationUnitPasses.AddPass(new CleanUnitPass(Options));
            TranslationUnitPasses.AddPass(new SortDeclarationsPass());
            TranslationUnitPasses.AddPass(new ResolveIncompleteDeclsPass());
            TranslationUnitPasses.AddPass(new CleanInvalidDeclNamesPass());
            TranslationUnitPasses.AddPass(new CheckIgnoredDeclsPass());
            TranslationUnitPasses.AddPass(new FindSymbolsPass());
            TranslationUnitPasses.AddPass(new MoveOperatorToClassPass());
            TranslationUnitPasses.AddPass(new CheckOperatorsOverloadsPass());
            TranslationUnitPasses.AddPass(new CheckVirtualOverrideReturnCovariance());
            TranslationUnitPasses.AddPass(new CheckAmbiguousFunctions());

            library.SetupPasses(this);

            Generator.SetupPasses();

            TranslationUnitPasses.AddPass(new FieldToPropertyPass());
            TranslationUnitPasses.AddPass(new CleanInvalidDeclNamesPass());
            TranslationUnitPasses.AddPass(new CheckIgnoredDeclsPass());
            TranslationUnitPasses.AddPass(new CheckFlagEnumsPass());
            TranslationUnitPasses.AddPass(new CheckDuplicatedNamesPass());
            if (Options.GenerateAbstractImpls)
            {
                TranslationUnitPasses.AddPass(new GenerateAbstractImplementationsPass());
            }
        }
コード例 #2
0
        public void SetupPasses(ILibrary library)
        {
            TranslationUnitPasses.AddPass(new CleanUnitPass(Options));
            TranslationUnitPasses.AddPass(new SortDeclarationsPass());
            TranslationUnitPasses.AddPass(new ResolveIncompleteDeclsPass());
            TranslationUnitPasses.AddPass(new CheckIgnoredDeclsPass());

            if (Options.IsCSharpGenerator && Options.GenerateInlines)
            {
                TranslationUnitPasses.AddPass(new GenerateInlinesCodePass());
            }

            library.SetupPasses(this);

            TranslationUnitPasses.AddPass(new FindSymbolsPass());
            TranslationUnitPasses.AddPass(new CheckStaticClass());
            TranslationUnitPasses.AddPass(new MoveOperatorToClassPass());
            TranslationUnitPasses.AddPass(new MoveFunctionToClassPass());
            TranslationUnitPasses.AddPass(new CheckAmbiguousFunctions());
            TranslationUnitPasses.AddPass(new CheckOperatorsOverloadsPass());
            TranslationUnitPasses.AddPass(new CheckVirtualOverrideReturnCovariance());

            Generator.SetupPasses();

            TranslationUnitPasses.AddPass(new FieldToPropertyPass());
            TranslationUnitPasses.AddPass(new CleanInvalidDeclNamesPass());
            TranslationUnitPasses.AddPass(new CheckIgnoredDeclsPass());
            TranslationUnitPasses.AddPass(new CheckFlagEnumsPass());
            TranslationUnitPasses.AddPass(new CheckDuplicatedNamesPass());

            if (Options.GenerateAbstractImpls)
            {
                TranslationUnitPasses.AddPass(new GenerateAbstractImplementationsPass());
            }

            if (Options.GenerateInterfacesForMultipleInheritance)
            {
                TranslationUnitPasses.AddPass(new MultipleInheritancePass());
                TranslationUnitPasses.AddPass(new ParamTypeToInterfacePass());
            }

            if (Options.GenerateVirtualTables)
            {
                TranslationUnitPasses.AddPass(new CheckVTableComponentsPass());
            }

            if (Options.GenerateProperties)
            {
                TranslationUnitPasses.AddPass(new GetterSetterToPropertyPass());
            }

            if (Options.GeneratePropertiesAdvanced)
            {
                TranslationUnitPasses.AddPass(new GetterSetterToPropertyAdvancedPass());
            }
        }
コード例 #3
0
ファイル: Driver.cs プロジェクト: randyammar/CppSharp
        public void SetupPasses(ILibrary library)
        {
            var TranslationUnitPasses = Context.TranslationUnitPasses;

            TranslationUnitPasses.AddPass(new SortDeclarationsPass());
            TranslationUnitPasses.AddPass(new ResolveIncompleteDeclsPass());
            if (Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.AddPass(new MarkSupportedSpecializationsPass());
            }
            TranslationUnitPasses.AddPass(new IgnoreSystemDeclarationsPass());
            TranslationUnitPasses.AddPass(new CheckIgnoredDeclsPass());

            if (Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.AddPass(new GenerateSymbolsPass());
                TranslationUnitPasses.AddPass(new TrimSpecializationsPass());
            }

            library.SetupPasses(this);

            TranslationUnitPasses.AddPass(new FindSymbolsPass());
            TranslationUnitPasses.AddPass(new CheckMacroPass());
            TranslationUnitPasses.AddPass(new CheckStaticClass());
            TranslationUnitPasses.AddPass(new MoveOperatorToClassPass());
            TranslationUnitPasses.AddPass(new MoveFunctionToClassPass());
            TranslationUnitPasses.AddPass(new GenerateAnonymousDelegatesPass());
            TranslationUnitPasses.AddPass(new ConstructorToConversionOperatorPass());
            TranslationUnitPasses.AddPass(new MarshalPrimitivePointersAsRefTypePass());
            TranslationUnitPasses.AddPass(new IgnoreMoveConstructorsPass());
            TranslationUnitPasses.AddPass(new CheckAmbiguousFunctions());
            TranslationUnitPasses.AddPass(new CheckOperatorsOverloadsPass());
            TranslationUnitPasses.AddPass(new CheckVirtualOverrideReturnCovariance());

            Generator.SetupPasses();

            TranslationUnitPasses.AddPass(new FieldToPropertyPass());
            TranslationUnitPasses.AddPass(new CleanInvalidDeclNamesPass());
            TranslationUnitPasses.AddPass(new CheckIgnoredDeclsPass());
            TranslationUnitPasses.AddPass(new CheckFlagEnumsPass());
            TranslationUnitPasses.AddPass(new CheckDuplicatedNamesPass());
            if (Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.AddPass(new GenerateAbstractImplementationsPass());
                if (Options.GenerateDefaultValuesForArguments)
                {
                    TranslationUnitPasses.AddPass(new FixDefaultParamValuesOfOverridesPass());
                    TranslationUnitPasses.AddPass(new HandleDefaultParamValuesPass());
                }
            }

            if (Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.AddPass(new MultipleInheritancePass());
                TranslationUnitPasses.AddPass(new ParamTypeToInterfacePass());
            }

            if (Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.AddPass(new DelegatesPass());
            }

            TranslationUnitPasses.AddPass(new GetterSetterToPropertyPass());
            TranslationUnitPasses.AddPass(new StripUnusedSystemTypesPass());

            if (Options.GeneratorKind == GeneratorKind.CLI ||
                Options.GeneratorKind == GeneratorKind.CSharp)
            {
                TranslationUnitPasses.RenameDeclsUpperCase(RenameTargets.Any & ~RenameTargets.Parameter);
            }
        }
コード例 #4
0
ファイル: Driver.cs プロジェクト: embtest/CppSharp
        public void SetupPasses(ILibrary library)
        {
            var TranslationUnitPasses = Context.TranslationUnitPasses;

            TranslationUnitPasses.AddPass(new ResolveIncompleteDeclsPass());
            TranslationUnitPasses.AddPass(new IgnoreSystemDeclarationsPass());

            if (Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.AddPass(new EqualiseAccessOfOverrideAndBasePass());
            }

            TranslationUnitPasses.AddPass(new CheckIgnoredDeclsPass());

            if (Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.AddPass(new TrimSpecializationsPass());
                TranslationUnitPasses.AddPass(new CheckAmbiguousFunctions());
                TranslationUnitPasses.AddPass(new GenerateSymbolsPass());
                TranslationUnitPasses.AddPass(new CheckIgnoredDeclsPass());
            }

            if (Options.IsCLIGenerator || Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.AddPass(new MoveFunctionToClassPass());
                TranslationUnitPasses.AddPass(new ValidateOperatorsPass());
            }

            library.SetupPasses(this);

            TranslationUnitPasses.AddPass(new FindSymbolsPass());
            TranslationUnitPasses.AddPass(new CheckMacroPass());
            TranslationUnitPasses.AddPass(new CheckStaticClass());

            TranslationUnitPasses.AddPass(new CheckAmbiguousFunctions());
            TranslationUnitPasses.AddPass(new ConstructorToConversionOperatorPass());
            TranslationUnitPasses.AddPass(new MarshalPrimitivePointersAsRefTypePass());

            if (Options.IsCLIGenerator || Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.AddPass(new CheckOperatorsOverloadsPass());
            }

            TranslationUnitPasses.AddPass(new CheckVirtualOverrideReturnCovariance());
            TranslationUnitPasses.AddPass(new CleanCommentsPass());

            Generator.SetupPasses();

            TranslationUnitPasses.AddPass(new FlattenAnonymousTypesToFields());
            TranslationUnitPasses.AddPass(new CleanInvalidDeclNamesPass());
            TranslationUnitPasses.AddPass(new FieldToPropertyPass());
            TranslationUnitPasses.AddPass(new CheckIgnoredDeclsPass());
            TranslationUnitPasses.AddPass(new CheckFlagEnumsPass());
            TranslationUnitPasses.AddPass(new MakeProtectedNestedTypesPublicPass());

            if (Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.AddPass(new GenerateAbstractImplementationsPass());
                TranslationUnitPasses.AddPass(new MultipleInheritancePass());
            }

            if (Options.IsCLIGenerator || Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.AddPass(new DelegatesPass());
                TranslationUnitPasses.AddPass(new GetterSetterToPropertyPass());
            }

            TranslationUnitPasses.AddPass(new StripUnusedSystemTypesPass());

            if (Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.AddPass(new SpecializationMethodsWithDependentPointersPass());
                TranslationUnitPasses.AddPass(new ParamTypeToInterfacePass());
            }

            TranslationUnitPasses.AddPass(new CheckDuplicatedNamesPass());

            TranslationUnitPasses.AddPass(new MarkUsedClassInternalsPass());

            if (Options.IsCLIGenerator || Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.RenameDeclsUpperCase(RenameTargets.Any & ~RenameTargets.Parameter);
                TranslationUnitPasses.AddPass(new CheckKeywordNamesPass());
            }

            Context.TranslationUnitPasses.AddPass(new HandleVariableInitializerPass());
        }
コード例 #5
0
ファイル: Driver.cs プロジェクト: eithday/CppSharp
        public void SetupPasses(ILibrary library)
        {
            var TranslationUnitPasses = Context.TranslationUnitPasses;

            TranslationUnitPasses.AddPass(new SortDeclarationsPass());
            TranslationUnitPasses.AddPass(new ResolveIncompleteDeclsPass());
            if (Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.AddPass(new MarkSupportedSpecializationsPass());
            }
            TranslationUnitPasses.AddPass(new IgnoreSystemDeclarationsPass());
            TranslationUnitPasses.AddPass(new CheckIgnoredDeclsPass());

            if (Options.IsCSharpGenerator)
            {
                if (Options.GenerateInlines)
                {
                    TranslationUnitPasses.AddPass(new GenerateInlinesCodePass());
                }
                TranslationUnitPasses.AddPass(new TrimSpecializationsPass());
                TranslationUnitPasses.AddPass(new GenerateTemplatesCodePass());
            }

            library.SetupPasses(this);

            TranslationUnitPasses.AddPass(new FindSymbolsPass());
            TranslationUnitPasses.AddPass(new CheckStaticClass());
            TranslationUnitPasses.AddPass(new MoveOperatorToClassPass());
            TranslationUnitPasses.AddPass(new MoveFunctionToClassPass());
            TranslationUnitPasses.AddPass(new GenerateAnonymousDelegatesPass());

            if (Options.GenerateConversionOperators)
            {
                TranslationUnitPasses.AddPass(new ConstructorToConversionOperatorPass());
            }

            TranslationUnitPasses.AddPass(new MarshalPrimitivePointersAsRefTypePass());
            TranslationUnitPasses.AddPass(new CheckAmbiguousFunctions());
            TranslationUnitPasses.AddPass(new CheckOperatorsOverloadsPass());
            TranslationUnitPasses.AddPass(new CheckVirtualOverrideReturnCovariance());

            Generator.SetupPasses();

            TranslationUnitPasses.AddPass(new FieldToPropertyPass());
            TranslationUnitPasses.AddPass(new CleanInvalidDeclNamesPass());
            TranslationUnitPasses.AddPass(new CheckIgnoredDeclsPass());
            TranslationUnitPasses.AddPass(new CheckFlagEnumsPass());
            TranslationUnitPasses.AddPass(new CheckDuplicatedNamesPass());
            if (Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.AddPass(new GenerateAbstractImplementationsPass());
                if (Options.GenerateDefaultValuesForArguments)
                {
                    TranslationUnitPasses.AddPass(new FixDefaultParamValuesOfOverridesPass());
                    TranslationUnitPasses.AddPass(new HandleDefaultParamValuesPass());
                }
            }

            if (Options.GenerateInterfacesForMultipleInheritance)
            {
                TranslationUnitPasses.AddPass(new MultipleInheritancePass());
                TranslationUnitPasses.AddPass(new ParamTypeToInterfacePass());
            }

            TranslationUnitPasses.AddPass(new CheckVTableComponentsPass());

            if (Options.IsCSharpGenerator)
            {
                TranslationUnitPasses.AddPass(new DelegatesPass());
            }

            if (Options.GenerateProperties)
            {
                TranslationUnitPasses.AddPass(new GetterSetterToPropertyPass());
            }

            if (Options.GeneratePropertiesAdvanced)
            {
                TranslationUnitPasses.AddPass(new GetterSetterToPropertyAdvancedPass());
            }
        }