public abstract class SqlAbstractParserImpl
extends java.lang.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 java.lang.String |
originalSql |
private static com.google.common.collect.ImmutableSet<java.lang.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,
java.lang.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.
|
java.lang.String |
getOriginalSql()
Returns the SQL text.
|
protected abstract SqlParserPos |
getPos() |
static java.util.Set<java.lang.String> |
getSql92ReservedWords()
Returns immutable set of all reserved words defined by SQL-92.
|
abstract SqlParseException |
normalizeException(java.lang.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 SqlNodeList |
parseSqlStmtList()
Parses a list of SQL statements separated by semicolon and constructs a
parse tree.
|
abstract void |
ReInit(java.io.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(java.lang.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(java.lang.String stateName)
Change parser state.
|
private static final com.google.common.collect.ImmutableSet<java.lang.String> SQL_92_RESERVED_WORD_SET
protected int nDynamicParams
protected java.lang.String originalSql
public static java.util.Set<java.lang.String> getSql92ReservedWords()
SQL-92 Section 5.2
protected SqlCall createCall(SqlIdentifier funName, SqlParserPos pos, SqlFunctionCategory funcType, SqlLiteral functionQualifier, java.lang.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(java.lang.Throwable ex)
SqlParseException
.ex
- dirty excnprotected abstract SqlParserPos getPos() throws java.lang.Exception
java.lang.Exception
public abstract void ReInit(java.io.Reader reader)
reader
- provides new inputpublic abstract SqlNode parseSqlExpressionEof() throws java.lang.Exception
java.lang.Exception
public abstract SqlNode parseSqlStmtEof() throws java.lang.Exception
java.lang.Exception
public abstract SqlNodeList parseSqlStmtList() throws java.lang.Exception
java.lang.Exception
public 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(java.lang.String originalSql)
public java.lang.String getOriginalSql()
public abstract void switchTo(java.lang.String stateName)
stateName
- new state.Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.