} else if (tokens.matches(STMT_ALTER_DATABASE)) {
// could encounter: ALTER DATABASE RENAME FILE 'diskc:log3.log' TO 'diskb:log3.log';
// So need to parse up past the RENAME check
markStartOfStatement(tokens);
tokens.consume(STMT_ALTER_DATABASE);
AstNode result = nodeFactory().node("database", parentNode, TYPE_ALTER_DATABASE_STATEMENT);
tokens.canConsume("RENAME");
parseUntilTerminator(tokens);
markEndOfStatement(tokens, result);
return result;
} else if (tokens.matches(STMT_ALTER_DIMENSION)) {
return parseStatement(tokens, STMT_ALTER_DIMENSION, parentNode, TYPE_ALTER_DIMENSION_STATEMENT);
} else if (tokens.matches(STMT_ALTER_DISKGROUP)) {
return parseStatement(tokens, STMT_ALTER_DISKGROUP, parentNode, TYPE_ALTER_DISKGROUP_STATEMENT);
} else if (tokens.matches(STMT_ALTER_FUNCTION)) {
return parseStatement(tokens, STMT_ALTER_FUNCTION, parentNode, TYPE_ALTER_FUNCTION_STATEMENT);
} else if (tokens.matches(STMT_ALTER_INDEX)) {
// could encounter: ALTER INDEX upper_ix RENAME TO xxxxxx
// So need to parse up past the RENAME check
markStartOfStatement(tokens);
tokens.consume(ALTER, INDEX);
String indexName = parseName(tokens);
AstNode result = nodeFactory().node(indexName, parentNode, TYPE_ALTER_INDEX_STATEMENT);
tokens.canConsume("RENAME");
parseUntilTerminator(tokens);
markEndOfStatement(tokens, result);
return result;
} else if (tokens.matches(STMT_ALTER_INDEXTYPE)) {
return parseStatement(tokens, STMT_ALTER_INDEXTYPE, parentNode, TYPE_ALTER_INDEXTYPE_STATEMENT);
} else if (tokens.matches(STMT_ALTER_JAVA)) {
return parseStatement(tokens, STMT_ALTER_JAVA, parentNode, TYPE_ALTER_JAVA_STATEMENT);
} else if (tokens.matches(STMT_ALTER_MATERIALIZED)) {
return parseStatement(tokens, STMT_ALTER_MATERIALIZED, parentNode, TYPE_ALTER_MATERIALIZED_STATEMENT);
} else if (tokens.matches(STMT_ALTER_OPERATOR)) {
return parseStatement(tokens, STMT_ALTER_OPERATOR, parentNode, TYPE_ALTER_OPERATOR_STATEMENT);
} else if (tokens.matches(STMT_ALTER_OUTLINE)) {
return parseStatement(tokens, STMT_ALTER_OUTLINE, parentNode, TYPE_ALTER_OUTLINE_STATEMENT);
} else if (tokens.matches(STMT_ALTER_PACKAGE)) {
return parseStatement(tokens, STMT_ALTER_PACKAGE, parentNode, TYPE_ALTER_PACKAGE_STATEMENT);
} else if (tokens.matches(STMT_ALTER_PROCEDURE)) {
return parseStatement(tokens, STMT_ALTER_PROCEDURE, parentNode, TYPE_ALTER_PROCEDURE_STATEMENT);
} else if (tokens.matches(STMT_ALTER_PROFILE)) {
return parseStatement(tokens, STMT_ALTER_PROFILE, parentNode, TYPE_ALTER_PROFILE_STATEMENT);
} else if (tokens.matches(STMT_ALTER_RESOURCE)) {
return parseStatement(tokens, STMT_ALTER_RESOURCE, parentNode, TYPE_ALTER_RESOURCE_STATEMENT);
} else if (tokens.matches(STMT_ALTER_ROLE)) {
return parseStatement(tokens, STMT_ALTER_ROLE, parentNode, TYPE_ALTER_ROLE_STATEMENT);
} else if (tokens.matches(STMT_ALTER_ROLLBACK)) {
return parseStatement(tokens, STMT_ALTER_ROLLBACK, parentNode, TYPE_ALTER_ROLLBACK_STATEMENT);
} else if (tokens.matches(STMT_ALTER_SEQUENCE)) {
return parseStatement(tokens, STMT_ALTER_SEQUENCE, parentNode, TYPE_ALTER_SEQUENCE_STATEMENT);
} else if (tokens.matches(STMT_ALTER_SESSION)) {
return parseStatement(tokens, STMT_ALTER_SESSION, parentNode, TYPE_ALTER_SESSION_STATEMENT);
} else if (tokens.matches(STMT_ALTER_SYSTEM)) {
return parseStatement(tokens, STMT_ALTER_SYSTEM, parentNode, TYPE_ALTER_SYSTEM_STATEMENT);
} else if (tokens.matches(STMT_ALTER_TABLESPACE)) {
return parseStatement(tokens, STMT_ALTER_TABLESPACE, parentNode, TYPE_ALTER_TABLESPACE_STATEMENT);
} else if (tokens.matches(STMT_ALTER_TRIGGER)) {
return parseStatement(tokens, STMT_ALTER_TRIGGER, parentNode, TYPE_ALTER_TRIGGER_STATEMENT);
} else if (tokens.matches(STMT_ALTER_TYPE)) {
return parseStatement(tokens, STMT_ALTER_TYPE, parentNode, TYPE_ALTER_TYPE_STATEMENT);
} else if (tokens.matches(STMT_ALTER_USER)) {
// could encounter: ALTER USER app_user1 GRANT .....
// So need to parse up past the GRANT check
markStartOfStatement(tokens);
tokens.consume(STMT_ALTER_USER);
String name = parseName(tokens);
AstNode result = nodeFactory().node(name, parentNode, TYPE_ALTER_USER_STATEMENT);
tokens.canConsume("GRANT");
parseUntilTerminator(tokens);
markEndOfStatement(tokens, result);
return result;
} else if (tokens.matches(STMT_ALTER_VIEW)) {