}
public SQLStatement parseIf() {
accept(Token.IF);
OracleIfStatement stmt = new OracleIfStatement();
stmt.setCondition(this.exprParser.expr());
accept(Token.THEN);
this.parseStatementList(stmt.getStatements());
while (lexer.token() == Token.ELSE) {
lexer.nextToken();
if (lexer.token() == Token.IF) {
lexer.nextToken();
OracleIfStatement.ElseIf elseIf = new OracleIfStatement.ElseIf();
elseIf.setCondition(this.exprParser.expr());
accept(Token.THEN);
this.parseStatementList(elseIf.getStatements());
stmt.getElseIfList().add(elseIf);
} else {
OracleIfStatement.Else elseItem = new OracleIfStatement.Else();
this.parseStatementList(elseItem.getStatements());
stmt.setElseItem(elseItem);
break;
}
}
accept(Token.END);