public static bool Compile(IErrorPrinter errorPrinter, IEnumerable <string> program, string outputType, string fileName) { TokenizerOutput to; try { to = NBTokenizer.Tokenize(errorPrinter, program); } catch (TokenizerException te) { Console.WriteLine("Compilation error!"); Console.WriteLine(te.Line.OriginalLine.OriginalLine); Console.WriteLine(te.Message); to = null; } if (to == null) { return(false); } CompilerContext context = CreateCompilerContext(outputType, fileName); CreateProgramType(context, to); CreateMainTypeAndSave(context); return(true); }
public bool Load(IEnumerable <string> program) { Reset(); TokenizerOutput to = NBTokenizer.Tokenize(this, program); return(LoadProgram(to)); }