Inheritance: BaseHRONEntity, IHRONEntity2
コード例 #1
0
        static void VisitDynamic(
            HRONObject hronObject,
            IScannerVisitor visitor
            )
        {
            if (hronObject == null)
            {
                return;
            }

            hronObject.Visit(visitor);
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        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
                );
        }
コード例 #4
0
        public static void VisitDynamic(
            HRONObject hronObject,
            IHRONVisitor visitor
            )
        {
            if (hronObject == null)
            {
                return;
            }

            hronObject.Visit(new TranslatingVisitor(visitor));
        }
コード例 #5
0
        public static string DynamicAsString(
            HRONObject hronObject
            )
        {
            if (hronObject == null)
            {
                return "";
            }

            var v = new WritingVisitor();
            VisitDynamic(hronObject, v);
            return v.StringBuilder.ToString();
        }