public HtmGenerator(ElaProgram prog, Doc doc, ElaIncrementalLinker lnk, ElaMachine vm) { this.prog = prog; this.doc = doc; this.vm = vm; this.lnk = lnk; }
public Doc Parse(string[] lines) { var d = new Doc(); for (var i = 0; i < lines.Length; i++) { var lt = lines[i].TrimStart(); var pragma = String.Empty; if ((pragma = ReadPragma("#file", lt)) != null) d.File = pragma.Trim(); else if ((pragma = ReadPragma("#title", lt)) != null) d.Title = pragma.Trim(); else if ((pragma = ReadPragma("#category", lt)) != null) d.Category = pragma.Trim(); else if (lt.Length > 0) d.Lines.Add(ReadLine(lt)); } return d; }
private void ReadMembers(Doc d, string[] lines, int idx) { var item = default(DocItem); for (var i = idx; i < lines.Length; i++) { var lt = lines[i].TrimStart(); if (lt.Length == 0) { if (item != null) d.Items.Add(item); item = null; } else { if (item == null) { item = new DocItem(); item.Header = lt; } else item.Lines.Add(ReadLine(lt)); } } if (item != null) d.Items.Add(item); }