Class SqlAbstractParserImpl


  • public abstract class SqlAbstractParserImpl
    extends java.lang.Object
    Abstract base for parsers generated from CommonParser.jj.
    • Field Detail

      • SQL_92_RESERVED_WORD_SET

        private static final com.google.common.collect.ImmutableSet<java.lang.String> SQL_92_RESERVED_WORD_SET
      • opTab

        protected final SqlStdOperatorTable opTab
        Operator table containing the standard SQL operators and functions.
      • nDynamicParams

        protected int nDynamicParams
      • originalSql

        protected java.lang.String originalSql
    • Constructor Detail

      • SqlAbstractParserImpl

        public SqlAbstractParserImpl()
    • Method Detail

      • getSql92ReservedWords

        public static java.util.Set<java.lang.String> getSql92ReservedWords()
        Returns immutable set of all reserved words defined by SQL-92.
        See Also:
        SQL-92 Section 5.2
      • createCall

        protected SqlCall createCall​(SqlIdentifier funName,
                                     SqlParserPos pos,
                                     SqlFunctionCategory funcType,
                                     SqlLiteral functionQualifier,
                                     java.lang.Iterable<? extends SqlNode> operands)
        Creates a call.
        Parameters:
        funName - Name of function
        pos - Position in source code
        funcType - Type of function
        functionQualifier - Qualifier
        operands - Operands to call
        Returns:
        Call
      • createCall

        protected SqlCall createCall​(SqlIdentifier funName,
                                     SqlParserPos pos,
                                     SqlFunctionCategory funcType,
                                     SqlLiteral functionQualifier,
                                     SqlNode[] operands)
        Creates a call.
        Parameters:
        funName - Name of function
        pos - Position in source code
        funcType - Type of function
        functionQualifier - Qualifier
        operands - Operands to call
        Returns:
        Call
      • normalizeException

        public abstract SqlParseException normalizeException​(java.lang.Throwable ex)
        Removes or transforms misleading information from a parse exception or error, and converts to SqlParseException.
        Parameters:
        ex - dirty excn
        Returns:
        clean excn
      • getPos

        protected abstract SqlParserPos getPos()
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • ReInit

        public abstract void ReInit​(java.io.Reader reader)
        Reinitializes parser with new input.
        Parameters:
        reader - provides new input
      • parseSqlExpressionEof

        public abstract SqlNode parseSqlExpressionEof()
                                               throws java.lang.Exception
        Parses a SQL expression ending with EOF and constructs a parse tree.
        Returns:
        constructed parse tree.
        Throws:
        java.lang.Exception
      • parseSqlStmtEof

        public abstract SqlNode parseSqlStmtEof()
                                         throws java.lang.Exception
        Parses a SQL statement ending with EOF and constructs a parse tree.
        Returns:
        constructed parse tree.
        Throws:
        java.lang.Exception
      • setTabSize

        public abstract void setTabSize​(int tabSize)
        Sets the tab stop size.
        Parameters:
        tabSize - Tab stop size
      • setQuotedCasing

        public abstract void setQuotedCasing​(org.apache.calcite.avatica.util.Casing quotedCasing)
        Sets the casing policy for quoted identifiers.
        Parameters:
        quotedCasing - Casing to set.
      • setUnquotedCasing

        public abstract void setUnquotedCasing​(org.apache.calcite.avatica.util.Casing unquotedCasing)
        Sets the casing policy for unquoted identifiers.
        Parameters:
        unquotedCasing - Casing to set.
      • setIdentifierMaxLength

        public abstract void setIdentifierMaxLength​(int identifierMaxLength)
        Sets the maximum length for sql identifier.
      • setConformance

        public abstract void setConformance​(SqlConformance conformance)
        Sets the SQL language conformance level.
      • setOriginalSql

        public void setOriginalSql​(java.lang.String originalSql)
        Sets the SQL text that is being parsed.
      • getOriginalSql

        public java.lang.String getOriginalSql()
        Returns the SQL text.
      • switchTo

        public abstract void switchTo​(java.lang.String stateName)
        Change parser state.
        Parameters:
        stateName - new state.