Package org.h2.command
Class ParserBase
java.lang.Object
org.h2.command.ParserBase
- Direct Known Subclasses:
Parser
The base class for the parser.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatNonKeywords(BitSet nonKeywords) Formats a comma-separated list of keywords.final intReturns the last parse index.parseColumnList(String sql, int offset) Parses a list of column names or numbers in parentheses.static BitSetparseNonKeywords(String[] nonKeywords) Parses the specified collection of non-keywords.static StringquoteIdentifier(String s, int sqlFlags) Add double quotes around an identifier if required.final voidsetLiteralsChecked(boolean literalsChecked) final voidsetSuppliedParameters(ArrayList<Parameter> suppliedParameters) final StringtoString()
-
Constructor Details
-
ParserBase
public ParserBase()Creates a new instance of parser for special use cases.
-
-
Method Details
-
quoteIdentifier
Add double quotes around an identifier if required.- Parameters:
s- the identifiersqlFlags- formatting flags- Returns:
- the quoted identifier
-
parseNonKeywords
Parses the specified collection of non-keywords.- Parameters:
nonKeywords- array of non-keywords in upper case- Returns:
- bit set of non-keywords, or
null
-
formatNonKeywords
Formats a comma-separated list of keywords.- Parameters:
nonKeywords- bit set of non-keywords, ornull- Returns:
- comma-separated list of non-keywords
-
setLiteralsChecked
public final void setLiteralsChecked(boolean literalsChecked) -
setSuppliedParameters
-
parseColumnList
Parses a list of column names or numbers in parentheses.- Parameters:
sql- the source SQLoffset- the initial offset- Returns:
- the array of column names (
String[]) or numbers (int[]) - Throws:
DbException- on syntax error
-
getLastParseIndex
public final int getLastParseIndex()Returns the last parse index.- Returns:
- the last parse index
-
toString
-