public object VisitRule(KpLinguaParser.RuleContext context)
        {
            var rule = context.ruleRightHandSide().Accept(this) as ConsumerRule;

            var guardContexet   = context.guard();
            var multisetContext = context.nonEmptyMultiset();

            if (guardContexet != null)
            {
                rule.Guard = guardContexet.Accept(this) as IGuard;
            }

            rule.Lhs.Add(multisetContext.Accept(this) as Multiset);

            return(rule);
        }
Example #2
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="KpLinguaParser.rule"/>.
 /// <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 VisitRule([NotNull] KpLinguaParser.RuleContext context)
 {
     return(VisitChildren(context));
 }