Example #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 = "_";
        }
Example #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));
            };
        }
Example #3
0
 public void Setup()
 {
     ValidateOptions();
     ParserOptions.SetupIncludes();
     Context = new BindingContext(Diagnostics, Options, ParserOptions);
     Generator = CreateGeneratorFromKind(Options.GeneratorKind);
 }
Example #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();
        }
Example #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 = "_";
        }
Example #6
0
 protected Generator(BindingContext context)
 {
     Context = context;
     CppSharp.AST.Type.TypePrinterDelegate += TypePrinterDelegate;
 }
Example #7
0
 protected Template(BindingContext context, IEnumerable<TranslationUnit> units)
 {
     Context = context;
     TranslationUnits = new List<TranslationUnit>(units);
     RootBlock = new Block();
     ActiveBlock = RootBlock;
 }
Example #8
0
 protected CodeGenerator(BindingContext context, IEnumerable <TranslationUnit> units)
 {
     Context          = context;
     TranslationUnits = new List <TranslationUnit>(units);
 }
Example #9
0
 protected CodeGenerator(BindingContext context, TranslationUnit unit)
     : this(context, new List <TranslationUnit> {
     unit
 })
 {
 }
Example #10
0
 protected CodeGenerator(BindingContext context)
 {
     Context = context;
 }
Example #11
0
 protected Generator(BindingContext context)
 {
     Context = context;
     CppSharp.AST.Type.TypePrinterDelegate += TypePrinterDelegate;
 }