Пример #1
0
        public SqlStatement ParseDropTableStatement()
        {
            DropTableStatement StatementDrop = new DropTableStatement();
            Token token = lexer.Get_Token();
            Error error = new Error();

            if (!(token.TokenType == TokenType.Keyword && token.Lexem == "DROP"))
            {
                error.expected = "DROP";
                error.str      = "Drop value expected";
                error.type     = "Keyword";
                result.Errors.Add(error);
            }
            token = lexer.Get_Token();
            if (!(token.TokenType == TokenType.Keyword && token.Lexem == "TABLE"))
            {
                error.expected = "TABLE";
                error.str      = "Table value expected";
                error.type     = "Keyword";
                result.Errors.Add(error);
            }
            token = lexer.Get_Token();
            if (token.TokenType != TokenType.ID)
            {
                error.expected = "Table name";
                error.str      = "Table title expected";
                error.type     = "ID";
                result.Errors.Add(error);
            }
            StatementDrop.TableName = token.Lexem;
            token = lexer.Get_Token();
            if (token.TokenType != TokenType.Semicolon)
            {
                error.expected = ";";
                error.str      = "Expected ;";
                error.type     = "Semicolon";
                result.Errors.Add(error);
            }
            return(StatementDrop);
        }
Пример #2
0
        public override void Accept(ref ExecuteVisitor visitor)
        {
            DropTableStatement DropTableStatement = this;

            visitor.visit(ref DropTableStatement);
        }
Пример #3
0
 public override void visit(ref DropTableStatement DropStatement)
 {
     DropStatement.write_data();
 }
Пример #4
0
 public abstract void visit(ref DropTableStatement DropStatement);