예제 #1
0
        public Driver(Project project, Options options)
        {
            Project = project;
            Options = options;

            Options.GenerateSupportFiles =
                Options.GeneratorKind == GeneratorKind.C ||
                Options.GeneratorKind == GeneratorKind.CPlusPlus ||
                Options.GeneratorKind == GeneratorKind.ObjectiveC;

            Assemblies = new List <IKVM.Reflection.Assembly>();

            Context            = new BindingContext(options);
            Context.ASTContext = new ASTContext();

            if (Options.Verbose)
            {
                Diagnostics.Level = DiagnosticKind.Debug;
            }

            if (!Options.Compilation.Platform.HasValue)
            {
                Options.Compilation.Platform = Platform.Host;
            }

            Declaration.QualifiedNameSeparator = "_";
        }
예제 #2
0
        public Driver(Options options, IDiagnostics diagnostics = null)
        {
            Options     = options;
            Diagnostics = diagnostics;

            if (Diagnostics == null)
            {
                Diagnostics = new TextDiagnosticPrinter();
            }

            if (Options.OutputDir == null)
            {
                Options.OutputDir = Directory.GetCurrentDirectory();
            }

            Assemblies = new List <IKVM.Reflection.Assembly>();

            Context            = new BindingContext(Diagnostics, new DriverOptions());
            Context.ASTContext = new ASTContext();

            Declaration.QualifiedNameSeparator = "_";

            CppSharp.AST.Type.TypePrinterDelegate = type =>
            {
                var typePrinter = new CppTypePrinter();
                return(type.Visit(typePrinter));
            };
        }
예제 #3
0
파일: Driver.cs 프로젝트: ddobrev/CppSharp
 public void Setup()
 {
     ValidateOptions();
     ParserOptions.SetupIncludes();
     Context = new BindingContext(Diagnostics, Options, ParserOptions);
     Generator = CreateGeneratorFromKind(Options.GeneratorKind);
 }
예제 #4
0
        public Driver(Project project, Options options)
        {
            Project = project;
            Options = options;

            Assemblies = new List <IKVM.Reflection.Assembly>();

            Context            = new BindingContext(options);
            Context.ASTContext = new ASTContext();

            if (Options.Verbose)
            {
                Diagnostics.Level = DiagnosticKind.Debug;
            }

            Declaration.QualifiedNameSeparator = "_";

            SetupTypePrinter();
        }
예제 #5
0
        public Driver(Project project, Options options)
        {
            Project = project;
            Options = options;

            Options.MainModule.LibraryName = null;

            Options.GenerateSupportFiles =
                Options.GeneratorKind == GeneratorKind.C ||
                Options.GeneratorKind == GeneratorKind.CPlusPlus ||
                Options.GeneratorKind == GeneratorKind.ObjectiveC;

            Assemblies = new List <IKVM.Reflection.Assembly>();

            Context            = new BindingContext(options);
            Context.ASTContext = new ASTContext();

            if (Options.Verbose)
            {
                Diagnostics.Level = DiagnosticKind.Debug;
            }

            Declaration.QualifiedNameSeparator = "_";
        }
예제 #6
0
 protected Generator(BindingContext context)
 {
     Context = context;
     CppSharp.AST.Type.TypePrinterDelegate += TypePrinterDelegate;
 }
예제 #7
0
 protected Template(BindingContext context, IEnumerable<TranslationUnit> units)
 {
     Context = context;
     TranslationUnits = new List<TranslationUnit>(units);
     RootBlock = new Block();
     ActiveBlock = RootBlock;
 }
예제 #8
0
 protected CodeGenerator(BindingContext context, IEnumerable <TranslationUnit> units)
 {
     Context          = context;
     TranslationUnits = new List <TranslationUnit>(units);
 }
예제 #9
0
 protected CodeGenerator(BindingContext context, TranslationUnit unit)
     : this(context, new List <TranslationUnit> {
     unit
 })
 {
 }
예제 #10
0
 protected CodeGenerator(BindingContext context)
 {
     Context = context;
 }
예제 #11
0
 protected Generator(BindingContext context)
 {
     Context = context;
     CppSharp.AST.Type.TypePrinterDelegate += TypePrinterDelegate;
 }