Ejemplo n.º 1
0
        /// <summary>
        /// Visit a parse tree produced by <see cref="Z80TestParser.memAssignment"/>.
        /// <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 VisitMemAssignment(Z80TestParser.MemAssignmentContext context)
        {
            if (IsInvalidContext(context))
            {
                return(null);
            }
            var node = new MemoryAssignmentNode(context);

            if (context.expr().Length > 0)
            {
                node.Address = (ExpressionNode)VisitExpr(context.expr()[0]);
            }
            if (context.expr().Length > 1)
            {
                node.Value = (ExpressionNode)VisitExpr(context.expr()[1]);
            }
            if (context.expr().Length > 2)
            {
                node.Length = (ExpressionNode)VisitExpr(context.expr()[2]);
            }
            return(node);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a clause with the span defined by the passed context
 /// </summary>
 /// <param name="context">Parser rule context</param>
 public MemoryAssignmentNode(Z80TestParser.MemAssignmentContext context) : base(context)
 {
 }
 /// <summary>
 /// Exit a parse tree produced by <see cref="Z80TestParser.memAssignment"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitMemAssignment([NotNull] Z80TestParser.MemAssignmentContext context)
 {
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="Z80TestParser.memAssignment"/>.
 /// <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 VisitMemAssignment([NotNull] Z80TestParser.MemAssignmentContext context)
 {
     return(VisitChildren(context));
 }