private static void CompileGenerator(string fileName, string outputFileName) { string source; using (StreamReader reader = new StreamReader(fileName)) { source = reader.ReadToEnd(); } MetaGeneratorCompiler compiler = new MetaGeneratorCompiler(source, fileName); compiler.Compile(); using (StreamWriter writer = new StreamWriter(outputFileName)) { MetaGeneratorGenerator generator = new MetaGeneratorGenerator(compiler.ParseTree); writer.WriteLine(generator.GeneratedSource); } using (StreamWriter writer = new StreamWriter("messages_gen.txt")) { foreach (var msg in compiler.Diagnostics.GetMessages(true)) { writer.WriteLine(msg); Console.WriteLine(msg); } } }
protected override void DoCompile() { this.generator = new MetaGeneratorGenerator(this.ParseTree); }