Beispiel #1
0
 public void Visit(SelectStatementExpression selectStatementExpression)
 {
     if (_innerVisitor != null)
     {
         selectStatementExpression.Accept(_innerVisitor);
     }
     selectStatementExpression.Statement.Accept(this);
 }
Beispiel #2
0
 public void Visit(SelectStatementExpression expression)
 {
     Write("(");
     WriteLine();
     using (Indent(2))
         expression.Statement.Accept(this);
     WriteLine();
     Write(")");
 }
Beispiel #3
0
        private IExpression PrimaryExpression()
        {
            var token = Current;

            if (IsConstant())
            {
                return(Constant());
            }
            else if (IsUnaryOp())
            {
                return(UnaryOp());
            }
            else if (CurrentTypeIs(TokenType.K_NULL))
            {
                return(NullExpression());
            }
            else if (IsReference())
            {
                var reference = ReferenceExpression();
                if (CurrentTypeIs(TokenType.OpenBracket))
                {
                    return(FunctionCall(reference));
                }
                else
                {
                    return(reference);
                }
            }
            else if (Consume(TokenType.OpenBracket))
            {
                IExpression expression;
                if (CurrentTypeIs(TokenType.K_SELECT))
                {
                    expression = new SelectStatementExpression {
                        Token = token, Statement = Select()
                    }
                }
                ;
                else
                {
                    expression = new GroupedExpression {
                        Token = token, Group = Expression()
                    }
                };

                Match(TokenType.CloseBracket);
                return(expression);
            }
            else
            {
                throw Unexpected();
            }
        }
Beispiel #4
0
 public void Visit(SelectStatementExpression selectStatementExpression)
 {
 }