public override object VisitDirWord([NotNull] StdAssemblerParser.DirWordContext context)
        {
            string   value;
            StdToken token;

            if (context.children.Count != 2)
            {
                throw new Exception("Error de sintáxis: Instrucción no válida");
            }
            else
            {
                value = context.VAL().GetText();
                if (Regex.IsMatch(value, @"(H|h)"))
                {
                    if (!Regex.IsMatch(value, @"^[0-9A-F]+(H|h)$"))
                    {
                        throw new Exception("Error de sintáxis: ingrese una dirección hexadecimal");
                    }

                    token = new StdToken()
                    {
                        Address       = count,
                        IsDirective   = true,
                        IsHex         = true,
                        Mode          = false,
                        OperationCode = "WORD",
                        Value         = value
                    };
                    count += 3;
                    return(token);
                }
                else
                {
                    if (Regex.IsMatch(value, "^[0-9]+$"))
                    {
                        value = int.Parse(value).ToString("X");
                        token = new StdToken()
                        {
                            Address       = count,
                            IsDirective   = true,
                            IsHex         = false,
                            Mode          = false,
                            OperationCode = "WORD",
                            Value         = value
                        };
                        count += 3;
                        return(token);
                    }
                    else
                    {
                        throw new Exception("Error de sintáxis: Instrucción no válida");
                    }
                }
            }
        }
 /// <summary>
 /// Exit a parse tree produced by the <c>DirWord</c>
 /// labeled alternative in <see cref="StdAssemblerParser.directiva"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitDirWord([NotNull] StdAssemblerParser.DirWordContext context)
 {
 }
 /// <summary>
 /// Visit a parse tree produced by the <c>DirWord</c>
 /// labeled alternative in <see cref="StdAssemblerParser.directiva"/>.
 /// <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 VisitDirWord([NotNull] StdAssemblerParser.DirWordContext context)
 {
     return(VisitChildren(context));
 }