/// <summary> /// Convert the parse tree to executable code then save it to the /// filename specified in the options. /// </summary> public void Save() { try { CodeGenerator codegen = new CodeGenerator(_opts); MarkExecutable(); codegen.GenerateCode(_programDef); codegen.Save(); } catch (CodeGeneratorException e) { _messages.Error(e.Filename, MessageCode.CODEGEN, e.Linenumber, e.Message); } }
/// <summary> /// Convert the parse tree to executable code and then execute the /// resulting code. The return value from the specified entry point function /// is returned as an object. /// </summary> /// <param name="entryPointName">The name of the method to be called</param> /// <returns>An ExecutionResult object representing the result of the execution</returns> public ExecutionResult Execute(string entryPointName) { CodeGenerator codegen = new CodeGenerator(_opts); MarkExecutable(); codegen.GenerateCode(_programDef); return codegen.Run(entryPointName); }