public void Write(string name, string output) { try { html.Open(output + ".html"); js.Open(output + ".js"); html.Put(html.body); html.Put(name); js.Put(js.header); WriteBody(it); WriteLayout(it); html.Close(); js.Close(); } catch (Exception exception) { html.Delete(); js.Delete(); Console.Out.WriteLine(exception.Message + "\nStack Trace:\n" + exception.StackTrace); } finally { html.Dispose(); js.Dispose(); } }
public void Write(string name, string output, ast.Line root, ast.NameDict nameDict) { this.nameDict = nameDict; try { html.Open(output + ".html"); js.Open(output + ".js"); html.Put(html.body); html.Put(name); js.Write(js.require); foreach (var line in root.childList) { CreateBody(line); } html.Close(); js.Close(); } catch (Exception exception) { html.Delete(); js.Delete(); parser.SemErr(exception.Message + "\nStack Trace:\n" + exception.StackTrace); } finally { html.Dispose(); js.Dispose(); } }