static void VisitDynamic( HRONObject hronObject, IScannerVisitor visitor ) { if (hronObject == null) { return; } hronObject.Visit(visitor); }
internal static bool TryParseAsDynamic( IEnumerable<SubString> lines, out HRONObject hronObject, out HRONDynamicParseError[] errors ) { hronObject = null; var visitor = new HRONDynamicBuilderVisitor(); Parse(lines, visitor, (l, v) => { foreach (var line in l) { v.AcceptLine(line); } }); errors = visitor.Errors.ToArray(); if (errors.Length > 0) { return false; } hronObject = new HRONObject(visitor.Top.Pairs.ToArray()); return true; }
public static bool TryParseAsDynamic( IEnumerable<string> lines, out HRONObject hronObject, out HRONDynamicParseError[] errors ) { lines = lines ?? Array<string>.Empty; return TryParseAsDynamic( lines.Select(l => l.ToSubString()), out hronObject, out errors ); }
public static void VisitDynamic( HRONObject hronObject, IHRONVisitor visitor ) { if (hronObject == null) { return; } hronObject.Visit(new TranslatingVisitor(visitor)); }
public static string DynamicAsString( HRONObject hronObject ) { if (hronObject == null) { return ""; } var v = new WritingVisitor(); VisitDynamic(hronObject, v); return v.StringBuilder.ToString(); }