Class MySQLParser
- java.lang.Object
-
- migratedb.v1.core.internal.parser.BaseParser
-
- migratedb.v1.core.internal.database.mysql.MySQLParser
-
- All Implemented Interfaces:
Parser
- Direct Known Subclasses:
MariaDBParser
public class MySQLParser 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 MySQLParser(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 StatementTypedetectStatementType(String simplifiedStatement, ParserContext context, PeekingReader reader)protected chargetAlternativeStringLiteralQuote()protected chargetIdentifierQuote()protected TokenhandleAlternativeStringLiteral(PeekingReader reader, ParserContext context, int pos, int line, int col)protected TokenhandleCommentDirective(PeekingReader reader, ParserContext context, int pos, int line, int col)protected TokenhandleKeyword(PeekingReader reader, ParserContext context, int pos, int line, int col, String keyword)protected TokenhandleStringLiteral(PeekingReader reader, ParserContext context, int pos, int line, int col)protected booleanisCommentDirective(String text)protected booleanisSingleLineComment(String peek, ParserContext context, int col)protected voidresetDelimiter(ParserContext context)Resets the delimiter to its default value before parsing a new statement.protected booleanshouldAdjustBlockDepth(ParserContext context, List<Token> tokens, Token token)-
Methods inherited from class migratedb.v1.core.internal.parser.BaseParser
adjustDelimiter, closeAndAddSuppressed, createStatement, detectCanExecuteInTransaction, doTokensMatchPattern, getAlternativeIdentifierQuote, getClosingIdentifierSymbol, getConfiguration, getDefaultDelimiter, getLastKeywordIndex, getLastKeywordIndex, getNextStatement, getOpeningIdentifierSymbol, getParsingContext, getPreviousToken, getTransactionalDetectionCutoff, getValidKeywords, handleDelimiter, isAlternativeStringLiteral, isDelimiter, isKeyword, isLetter, lastTokenIs, lastTokenIsOnLine, parse, parse, readIdentifier, readKeyword, replacePlaceholders, shouldDiscard, supportsPeekingMultipleLines, tokenAtIndexIs
-
-
-
-
Constructor Detail
-
MySQLParser
public MySQLParser(Configuration configuration, ParsingContext parsingContext)
-
-
Method Detail
-
resetDelimiter
protected void resetDelimiter(ParserContext context)
Description copied from class:BaseParserResets the delimiter to its default value before parsing a new statement.- Overrides:
resetDelimiterin classBaseParser
-
handleKeyword
protected Token handleKeyword(PeekingReader reader, ParserContext context, int pos, int line, int col, String keyword) throws IOException
- Overrides:
handleKeywordin classBaseParser- Throws:
IOException
-
getIdentifierQuote
protected char getIdentifierQuote()
- Overrides:
getIdentifierQuotein classBaseParser
-
getAlternativeStringLiteralQuote
protected char getAlternativeStringLiteralQuote()
- Overrides:
getAlternativeStringLiteralQuotein classBaseParser
-
isSingleLineComment
protected boolean isSingleLineComment(String peek, ParserContext context, int col)
- Overrides:
isSingleLineCommentin classBaseParser
-
handleStringLiteral
protected Token handleStringLiteral(PeekingReader reader, ParserContext context, int pos, int line, int col) throws IOException
- Overrides:
handleStringLiteralin classBaseParser- Throws:
IOException
-
handleAlternativeStringLiteral
protected Token handleAlternativeStringLiteral(PeekingReader reader, ParserContext context, int pos, int line, int col) throws IOException
- Overrides:
handleAlternativeStringLiteralin classBaseParser- Throws:
IOException
-
handleCommentDirective
protected Token handleCommentDirective(PeekingReader reader, ParserContext context, int pos, int line, int col) throws IOException
- Overrides:
handleCommentDirectivein classBaseParser- Throws:
IOException
-
isCommentDirective
protected boolean isCommentDirective(String text)
- Overrides:
isCommentDirectivein classBaseParser
-
detectStatementType
protected StatementType detectStatementType(String simplifiedStatement, ParserContext context, PeekingReader reader)
- Overrides:
detectStatementTypein classBaseParser
-
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
-
-