コード例 #1
0
        /// <summary>
        /// Visit a parse tree produced by <see cref="Z80TestParser.wordSet"/>.
        /// <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 override object VisitWordSet(Z80TestParser.WordSetContext context)
        {
            if (IsInvalidContext(context))
            {
                return(null);
            }
            var node = new WordPatternNode(context);

            foreach (var expr in context.expr())
            {
                node.Words.Add((ExpressionNode)VisitExpr(expr));
            }
            return(node);
        }
コード例 #2
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="Z80TestParser.wordSet"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitWordSet([NotNull] Z80TestParser.WordSetContext context)
 {
 }
コード例 #3
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="Z80TestParser.wordSet"/>.
 /// <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 VisitWordSet([NotNull] Z80TestParser.WordSetContext context)
 {
     return(VisitChildren(context));
 }
コード例 #4
0
 /// <summary>
 /// Creates a clause with the span defined by the passed context
 /// </summary>
 /// <param name="context">Parser rule context</param>
 public WordPatternNode(Z80TestParser.WordSetContext context) : base(context)
 {
     WordKeywordSpan = new TextSpan(context.WORD());
     Words           = new List <ExpressionNode>();
 }