Esempio n. 1
0
        static void Main(string[] args)
        {
            Stream input;

            if (args.Length > 0)
            {
                input = new FileStream(args[0], FileMode.Open, FileAccess.Read);
            }
            else
            {
                input = Console.OpenStandardInput();
            }

            WireFrame segments;

            using (input)
            {
                segments = Framing.ReadSegments(input);
            }

            var dec     = DeserializerState.CreateRoot(segments);
            var reader  = Schema.CodeGeneratorRequest.Reader.Create(dec);
            var model   = Model.SchemaModel.Create(reader);
            var codeGen = new Generator.CodeGenerator(model, new Generator.GeneratorOptions());

            codeGen.Generate();
        }
Esempio n. 2
0
        internal static void GenerateFromStream(Stream input)
        {
            WireFrame segments;

            using (input)
            {
                segments = Framing.ReadSegments(input);
            }

            var dec     = DeserializerState.CreateRoot(segments);
            var reader  = Schema.CodeGeneratorRequest.Reader.Create(dec);
            var model   = Model.SchemaModel.Create(reader);
            var codeGen = new Generator.CodeGenerator(model, new Generator.GeneratorOptions());

            codeGen.Generate();
        }