Beispiel #1
0
        public override void ExitSignedNumberExpr(MiniSqlParserParser.SignedNumberExprContext context)
        {
            Sign sign = Sign.Plus;

            if (context.op.Type == MiniSqlParserLexer.MINUS)
            {
                sign = Sign.Minus;
            }
            else
            {
                sign = Sign.Plus;
            }

            INode node = null;

            if (context.UINTEGER_LITERAL() != null)
            {
                var comments = this.GetComments(context.UINTEGER_LITERAL());
                var value    = new UNumericLiteral(context.UINTEGER_LITERAL().GetText(), comments);
                node = new SignedNumberExpr(sign, value, this.GetComments(context.op));
            }
            else
            {
                var comments = this.GetComments(context.UNUMERIC_LITERAL());
                var value    = new UNumericLiteral(context.UNUMERIC_LITERAL().GetText(), comments);
                node = new SignedNumberExpr(sign, value, this.GetComments(context.op));
            }

            _stack.Push(node);
        }
Beispiel #2
0
 virtual public void Visit(UNumericLiteral literal)
 {
 }
 public override void Visit(UNumericLiteral literal)
 {
     _stack.Push(literal);
 }
 public void Visit(UNumericLiteral literal)
 {
     _visitor.Visit(literal);
 }