protected override void ProcessOutput(CodeDocument doc) { Output = "Compile\r\n"; // Compile expression Program program; Dictionary <string, Function> functions = Program.AddFunction(null, "Write", WriteLine, "str"); Dictionary <string, ValueBase> parameters = null; try { program = ProgramBuilder.CreateProgram(doc, functions, parameters); } catch (Exception e) { Output += "Program does not compile.\r\n(Compiling the parser output fails)\r\n" + e.Message; return; } // execute program try { Output = "Run\r\n"; program.RunProgram(parameters); } catch (Exception e) { Output += "Program failed: " + e.Message; return; } Output += "Program has executed!"; }