protected internal virtual GeneratorResults GenerateCodeCore(ITextDocument input, string className, string rootNamespace, string sourceFileName, CancellationToken?cancelToken) { className = (className ?? Host.DefaultClassName) ?? DefaultClassName; rootNamespace = (rootNamespace ?? Host.DefaultNamespace) ?? DefaultNamespace; // Run the parser RazorParser parser = CreateParser(); Debug.Assert(parser != null); ParserResults results = parser.Parse(input); // Generate code RazorCodeGenerator generator = CreateCodeGenerator(className, rootNamespace, sourceFileName); generator.DesignTimeMode = Host.DesignTimeMode; generator.Visit(results); var builder = CreateCodeBuilder(generator.Context); var builderResult = builder.Build(); // Collect results and return return(new GeneratorResults(results, builderResult)); }
public GeneratorResults(ParserResults parserResults, CodeBuilderResult codeBuilderResult) : this(parserResults.Document, parserResults.ParserErrors, codeBuilderResult) { }
public GeneratorResults(ParserResults parserResults, CodeCompileUnit generatedCode, IDictionary<int, GeneratedCodeMapping> designTimeLineMappings) : this(parserResults.Document, parserResults.ParserErrors, generatedCode, designTimeLineMappings) { }