示例#1
0
        void Generate()
        {
            Output = new ProjectOutput();

            Generator generator = null;

            switch (Options.GeneratorKind)
            {
            case GeneratorKind.C:
                generator = new CGenerator(Context);
                break;

            case GeneratorKind.ObjectiveC:
                generator = new ObjCGenerator(Context);
                break;

            case GeneratorKind.Java:
                generator = new JavaGenerator(Context);
                break;

            default:
                throw new NotImplementedException();
            }

            generator.SetupPasses();

            foreach (var unit in Context.ASTContext.TranslationUnits)
            {
                var outputs = generator.Generate(new[] { unit });

                foreach (var output in outputs)
                {
                    output.Process();
                    var text = output.Generate();

                    Output.WriteOutput(output.FilePath, text);
                }
            }

            if (Options.GenerateSupportFiles)
            {
                GenerateSupportFiles();
            }
        }
示例#2
0
        void Generate()
        {
            Output = new ProjectOutput();

            foreach (var unit in Context.ASTContext.TranslationUnits)
            {
                var outputs = Generator.Generate(new[] { unit });

                foreach (var output in outputs)
                {
                    output.Process();
                    var text = output.Generate();

                    Output.WriteOutput(output.FilePath, text);
                }
            }

            if (Options.GenerateSupportFiles)
            {
                GenerateSupportFiles();
            }
        }