Esempio n. 1
0
        public override Element VisitLineContent(ScriberParser.LineContentContext context)
        {
            var environment = context.environment();
            var quotation   = context.quotation();
            var text        = context.text();

            var element = new Element(null, ElementType.Paragraph);

            for (int i = 0; i < environment.Length; i++)
            {
                var environmentElement = Visit(environment[i]);
                element.Children.AddLast(environmentElement);
            }

            for (int i = 0; i < quotation.Length; i++)
            {
                var quotationElement = Visit(quotation[i]);
                element.Children.AddLast(quotationElement);
            }

            for (int i = 0; i < text.Length; i++)
            {
                var textElement = new Element(element, ElementType.Text);
                element.Content = text[i].GetText();
            }

            return(element);
        }
Esempio n. 2
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="ScriberParser.lineContent"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitLineContent([NotNull] ScriberParser.LineContentContext context)
 {
     return(VisitChildren(context));
 }