public abstract class SqlAbstractParserImpl extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SqlAbstractParserImpl.ExprContext
Type-safe enum for context of acceptable expressions.
|
static interface |
SqlAbstractParserImpl.Metadata
Metadata about the parser.
|
static class |
SqlAbstractParserImpl.MetadataImpl
Default implementation of the
SqlAbstractParserImpl.Metadata interface. |
| Modifier and Type | Field and Description |
|---|---|
protected int |
nDynamicParams |
protected SqlStdOperatorTable |
opTab
Operator table containing the standard SQL operators and functions.
|
protected String |
originalSql |
private static com.google.common.collect.ImmutableSet<String> |
SQL_92_RESERVED_WORD_SET |
| Constructor and Description |
|---|
SqlAbstractParserImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected SqlCall |
createCall(SqlIdentifier funName,
SqlParserPos pos,
SqlFunctionCategory funcType,
SqlLiteral functionQualifier,
Iterable<? extends SqlNode> operands)
Creates a call.
|
protected SqlCall |
createCall(SqlIdentifier funName,
SqlParserPos pos,
SqlFunctionCategory funcType,
SqlLiteral functionQualifier,
SqlNode[] operands)
Creates a call.
|
abstract SqlAbstractParserImpl.Metadata |
getMetadata()
Returns metadata about this parser: keywords, etc.
|
String |
getOriginalSql()
Returns the SQL text.
|
protected abstract SqlParserPos |
getPos() |
static Set<String> |
getSql92ReservedWords()
Returns immutable set of all reserved words defined by SQL-92.
|
abstract SqlParseException |
normalizeException(Throwable ex)
Removes or transforms misleading information from a parse exception or
error, and converts to
SqlParseException. |
abstract SqlNode |
parseSqlExpressionEof()
Parses a SQL expression ending with EOF and constructs a
parse tree.
|
abstract SqlNode |
parseSqlStmtEof()
Parses a SQL statement ending with EOF and constructs a
parse tree.
|
abstract void |
ReInit(Reader reader)
Reinitializes parser with new input.
|
abstract void |
setConformance(SqlConformance conformance)
Sets the SQL language conformance level.
|
abstract void |
setIdentifierMaxLength(int identifierMaxLength)
Sets the maximum length for sql identifier.
|
void |
setOriginalSql(String originalSql)
Sets the SQL text that is being parsed.
|
abstract void |
setQuotedCasing(org.apache.calcite.avatica.util.Casing quotedCasing)
Sets the casing policy for quoted identifiers.
|
abstract void |
setTabSize(int tabSize)
Sets the tab stop size.
|
abstract void |
setUnquotedCasing(org.apache.calcite.avatica.util.Casing unquotedCasing)
Sets the casing policy for unquoted identifiers.
|
abstract void |
switchTo(String stateName)
Change parser state.
|
private static final com.google.common.collect.ImmutableSet<String> SQL_92_RESERVED_WORD_SET
protected final SqlStdOperatorTable opTab
protected int nDynamicParams
protected String originalSql
public static Set<String> getSql92ReservedWords()
SQL-92 Section 5.2protected SqlCall createCall(SqlIdentifier funName, SqlParserPos pos, SqlFunctionCategory funcType, SqlLiteral functionQualifier, Iterable<? extends SqlNode> operands)
funName - Name of functionpos - Position in source codefuncType - Type of functionfunctionQualifier - Qualifieroperands - Operands to callprotected SqlCall createCall(SqlIdentifier funName, SqlParserPos pos, SqlFunctionCategory funcType, SqlLiteral functionQualifier, SqlNode[] operands)
funName - Name of functionpos - Position in source codefuncType - Type of functionfunctionQualifier - Qualifieroperands - Operands to callpublic abstract SqlAbstractParserImpl.Metadata getMetadata()
public abstract SqlParseException normalizeException(Throwable ex)
SqlParseException.ex - dirty excnprotected abstract SqlParserPos getPos() throws Exception
Exceptionpublic abstract void ReInit(Reader reader)
reader - provides new inputpublic abstract SqlNode parseSqlExpressionEof() throws Exception
Exceptionpublic abstract SqlNode parseSqlStmtEof() throws Exception
Exceptionpublic abstract void setTabSize(int tabSize)
tabSize - Tab stop sizepublic abstract void setQuotedCasing(org.apache.calcite.avatica.util.Casing quotedCasing)
quotedCasing - Casing to set.public abstract void setUnquotedCasing(org.apache.calcite.avatica.util.Casing unquotedCasing)
unquotedCasing - Casing to set.public abstract void setIdentifierMaxLength(int identifierMaxLength)
public abstract void setConformance(SqlConformance conformance)
public void setOriginalSql(String originalSql)
public String getOriginalSql()
public abstract void switchTo(String stateName)
stateName - new state.Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.