Class OracleParser
- java.lang.Object
-
- migratedb.v1.core.internal.parser.BaseParser
-
- migratedb.v1.core.internal.database.oracle.OracleParser
-
- All Implemented Interfaces:
Parser
public class OracleParser extends BaseParser
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class migratedb.v1.core.internal.parser.BaseParser
BaseParser.ParserSqlStatementIterator
-
-
Field Summary
-
Fields inherited from class migratedb.v1.core.internal.parser.BaseParser
LOG
-
-
Constructor Summary
Constructors Constructor Description OracleParser(Configuration configuration, ParsingContext parsingContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadjustBlockDepth(ParserContext context, List<Token> tokens, Token keyword, PeekingReader reader)protected voidadjustDelimiter(ParserContext context, StatementType statementType)Adjusts the delimiter if necessary for this statement type.protected ParsedSqlStatementcreateStatement(PeekingReader reader, Recorder recorder, int statementPos, int statementLine, int statementCol, int nonCommentPartPos, int nonCommentPartLine, int nonCommentPartCol, StatementType statementType, boolean canExecuteInTransaction, Delimiter delimiter, String sql)protected StatementTypedetectStatementType(String simplifiedStatement, ParserContext context, PeekingReader reader)protected booleandoTokensMatchPattern(List<Token> previousTokens, Token current, Pattern regex)protected TokenhandleAlternativeStringLiteral(PeekingReader reader, ParserContext context, int pos, int line, int col)protected booleanisAlternativeStringLiteral(String peek)protected booleanisDelimiter(String peek, ParserContext context, int col, int colIgnoringWhitespace)protected booleanshouldAdjustBlockDepth(ParserContext context, List<Token> tokens, Token token)protected booleanshouldDiscard(Token token, boolean nonCommentPartSeen)Whether the current set of tokens should be discarded.-
Methods inherited from class migratedb.v1.core.internal.parser.BaseParser
closeAndAddSuppressed, detectCanExecuteInTransaction, getAlternativeIdentifierQuote, getAlternativeStringLiteralQuote, getClosingIdentifierSymbol, getConfiguration, getDefaultDelimiter, getIdentifierQuote, getLastKeywordIndex, getLastKeywordIndex, getNextStatement, getOpeningIdentifierSymbol, getParsingContext, getPreviousToken, getTransactionalDetectionCutoff, getValidKeywords, handleCommentDirective, handleDelimiter, handleKeyword, handleStringLiteral, isCommentDirective, isKeyword, isLetter, isSingleLineComment, lastTokenIs, lastTokenIsOnLine, parse, parse, readIdentifier, readKeyword, replacePlaceholders, resetDelimiter, supportsPeekingMultipleLines, tokenAtIndexIs
-
-
-
-
Constructor Detail
-
OracleParser
public OracleParser(Configuration configuration, ParsingContext parsingContext)
-
-
Method Detail
-
createStatement
protected ParsedSqlStatement createStatement(PeekingReader reader, Recorder recorder, int statementPos, int statementLine, int statementCol, int nonCommentPartPos, int nonCommentPartLine, int nonCommentPartCol, StatementType statementType, boolean canExecuteInTransaction, Delimiter delimiter, String sql) throws IOException
- Overrides:
createStatementin classBaseParser- Throws:
IOException
-
detectStatementType
protected StatementType detectStatementType(String simplifiedStatement, ParserContext context, PeekingReader reader)
- Overrides:
detectStatementTypein classBaseParser
-
shouldDiscard
protected boolean shouldDiscard(Token token, boolean nonCommentPartSeen)
Description copied from class:BaseParserWhether the current set of tokens should be discarded.- Overrides:
shouldDiscardin classBaseParser- Parameters:
token- The latest token.nonCommentPartSeen- Whether a non-comment part has already been seen.- Returns:
trueif it should,falseif not.
-
adjustDelimiter
protected void adjustDelimiter(ParserContext context, StatementType statementType)
Description copied from class:BaseParserAdjusts the delimiter if necessary for this statement type.- Overrides:
adjustDelimiterin classBaseParserstatementType- The statement type.
-
shouldAdjustBlockDepth
protected boolean shouldAdjustBlockDepth(ParserContext context, List<Token> tokens, Token token)
- Overrides:
shouldAdjustBlockDepthin classBaseParser
-
adjustBlockDepth
protected void adjustBlockDepth(ParserContext context, List<Token> tokens, Token keyword, PeekingReader reader)
- Overrides:
adjustBlockDepthin classBaseParser
-
doTokensMatchPattern
protected boolean doTokensMatchPattern(List<Token> previousTokens, Token current, Pattern regex)
- Overrides:
doTokensMatchPatternin classBaseParser
-
isDelimiter
protected boolean isDelimiter(String peek, ParserContext context, int col, int colIgnoringWhitespace)
- Overrides:
isDelimiterin classBaseParser
-
isAlternativeStringLiteral
protected boolean isAlternativeStringLiteral(String peek)
- Overrides:
isAlternativeStringLiteralin classBaseParser
-
handleAlternativeStringLiteral
protected Token handleAlternativeStringLiteral(PeekingReader reader, ParserContext context, int pos, int line, int col) throws IOException
- Overrides:
handleAlternativeStringLiteralin classBaseParser- Throws:
IOException
-
-