@InternalApi public final class SqlParser extends java.lang.Object implements VisitorRegistrar
This parser is not thread-safe.
Modifier and Type | Class and Description |
---|---|
static class |
SqlParser.Builder |
Modifier and Type | Method and Description |
---|---|
SqlParser |
add(TokenVisitor tokenVisitor)
Fluent variant of
addVisitor(TokenVisitor) . |
void |
addVisitor(TokenVisitor tokenVisitor)
Adds a visitor.
|
boolean |
isCompleted() |
boolean |
isParsing() |
boolean |
isStarted() |
void |
parse()
Starts parsing of the statement text.
|
void |
removeVisitor(TokenVisitor tokenVisitor)
Removes a visitor - if already registered.
|
void |
resumeParsing()
Start or resume parsing of the statement text.
|
static SqlParser.Builder |
withReservedWords(ReservedWords reservedWords)
Creates a builder for a SQL parser with a supplier of reserved words.
|
public static SqlParser.Builder withReservedWords(ReservedWords reservedWords)
reservedWords
- Reserved wordspublic void parse()
java.lang.IllegalStateException
- When parse()
has already been parsed, or there are no registered visitors.resumeParsing()
public void resumeParsing()
If the parsing process previously stalled because there were no more visitors, this continues parsing at the
point the parser previously stopped. If parsing was not yet started (e.g. using parse()
), it will
start.
java.lang.IllegalStateException
- When parsing was already completed, parsing is already in progress, or there are no registered visitorsparse()
public boolean isStarted()
public boolean isParsing()
public boolean isCompleted()
public SqlParser add(TokenVisitor tokenVisitor)
addVisitor(TokenVisitor)
.tokenVisitor
- token visitor to addpublic void addVisitor(TokenVisitor tokenVisitor)
VisitorRegistrar
addVisitor
in interface VisitorRegistrar
tokenVisitor
- Token visitorpublic void removeVisitor(TokenVisitor tokenVisitor)
VisitorRegistrar
removeVisitor
in interface VisitorRegistrar
tokenVisitor
- Token visitorCopyright © 2001-2024 Jaybird (Firebird JDBC) team. All rights reserved.