org.modeshape.sequencer.ddl.dialect.teiid

## Class TeiidDdlParser

- java.lang.Object
- - org.modeshape.sequencer.ddl.StandardDdlParser
  - - org.modeshape.sequencer.ddl.dialect.teiid.TeiidDdlParser

- All Implemented Interfaces:
    DdlConstants, DdlConstants.StatementStartPhrases, DdlParser, TeiidDdlConstants

      public final class TeiidDdlParser
      extends StandardDdlParser
      implements TeiidDdlConstants

  A DDL parser for the Teiid dialect.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.modeshape.sequencer.ddl.dialect.teiid.TeiidDdlConstants

      `TeiidDdlConstants.DdlElement, TeiidDdlConstants.DdlStatement, TeiidDdlConstants.SchemaElementType, TeiidDdlConstants.TeiidDataType, TeiidDdlConstants.TeiidFutureReserveWord, TeiidDdlConstants.TeiidNonReservedWord, TeiidDdlConstants.TeiidReservedWord`

    - ### Nested classes/interfaces inherited from interface org.modeshape.sequencer.ddl.DdlConstants

      `DdlConstants.AstNodeNames, DdlConstants.DataTypes, DdlConstants.DropBehavior, DdlConstants.MatchType, DdlConstants.Problems, DdlConstants.ReferencialAction, DdlConstants.StatementStartPhrases`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ID` The Teiid parser identifier.

    - ### Fields inherited from interface org.modeshape.sequencer.ddl.DdlConstants

      `ALTER, CHECK, COLUMN, COMMA, CONSTRAINT, CONSTRAINT_C, CONSTRAINT_FK, CONSTRAINT_PK, CONSTRAINT_UC, CREATE, DECLARE, DEFAULT_TERMINATOR, DELETE, DROP, FOREIGN, FOREIGN_KEY, GIGA, GRANT, INDEX, INSERT, KEY, KILO, L_PAREN, L_SQUOTE, MEGA, MISSING_TERMINATOR_NODE_LITERAL, NOT, NULL, OFF, ON, PERIOD, PRIMARY, PRIMARY_KEY, R_PAREN, REVOKE, SCHEMA, SELECT, SEMICOLON, SET, SPACE, SQL_92_RESERVED_WORDS, TABLE, UNIQUE, UPDATE, VIEW`

    - ### Fields inherited from interface org.modeshape.sequencer.ddl.DdlConstants.StatementStartPhrases

      `SQL_92_ALL_PHRASES, STMT_ALTER_DOMAIN, STMT_ALTER_TABLE, STMT_CREATE_ASSERTION, STMT_CREATE_CHARACTER_SET, STMT_CREATE_COLLATION, STMT_CREATE_DOMAIN, STMT_CREATE_GLOBAL_TEMPORARY_TABLE, STMT_CREATE_LOCAL_TEMPORARY_TABLE, STMT_CREATE_OR_REPLACE_VIEW, STMT_CREATE_SCHEMA, STMT_CREATE_TABLE, STMT_CREATE_TRANSLATION, STMT_CREATE_VIEW, STMT_DROP_ASSERTION, STMT_DROP_CHARACTER_SET, STMT_DROP_COLLATION, STMT_DROP_DOMAIN, STMT_DROP_SCHEMA, STMT_DROP_TABLE, STMT_DROP_TRANSLATION, STMT_DROP_VIEW, STMT_GRANT, STMT_INSERT_INTO, STMT_REVOKE, STMT_SET_DEFINE, VALID_SCHEMA_CHILD_TYPES`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TeiidDdlParser()` Constructs a Teiid DDL parser.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected List<String>` | `getCustomDataTypeStartWords()` Returns a list of custom data type start words which can be used to help identify a column definition sub-statement.
    `String` | `getId()` Get the identifier for this parser.
    `protected String[]` | `getValidSchemaChildTypes()`
    `protected void` | `initializeTokenStream(DdlTokenStream tokens)` Method called by `StandardDdlParser.score(String, String, DdlParserScorer)` and `StandardDdlParser.parse(String, AstNode, Object)` to initialize the `token stream`, giving subclasses a chance to `register key words` and `statement start phrases`.
    `protected AstNode` | `parseNextStatement(DdlTokenStream tokens, AstNode parentNode)` Performs token match checks for initial statement type and delegates to specific parser methods.
    `void` | `postProcess(AstNode rootNode)` Allows parsers to post process the `AstNode` tree given the supplied root.

    - ### Methods inherited from class org.modeshape.sequencer.ddl.StandardDdlParser

      `addProblem, addProblem, areNextTokensCreateTableOptions, attachNewProblem, computeScore, consumeComment, consumeIdentifier, consumeParenBoundedTokens, doUseTerminator, equals, getCurrentMarkedPosition, getDatatypeParser, getDataTypeStartWords, getIdentifyingKeywords, getProblems, getRootNode, getStatementTypeName, getTableElementsString, getTerminator, handleUnknownToken, hashCode, integer, isColumnDefinitionStart, isComment, isMissingTerminatorNode, isTableConstraint, isTerminator, isTestMode, isValidSchemaChild, markEndOfStatement, markStartOfStatement, mergeNodes, missingTerminatorNode, nodeFactory, parse, parseAlterStatement, parseAlterTableStatement, parseCollateClause, parseColumnConstraint, parseColumnDefinition, parseColumnNameList, parseColumnsAndConstraints, parseConstraintAttributes, parseCreateAssertionStatement, parseCreateCharacterSetStatement, parseCreateCollationStatement, parseCreateDomainStatement, parseCreateSchemaStatement, parseCreateStatement, parseCreateTableOptions, parseCreateTableStatement, parseCreateTranslationStatement, parseCreateViewStatement, parseCustomStatement, parseDefaultClause, parseDropStatement, parseGrantPrivileges, parseGrantStatement, parseIgnorableStatement, parseIgnorableStatement, parseInsertStatement, parseName, parseNameList, parseNextCreateTableOption, parseReferences, parseRevokeStatement, parseSetStatement, parseSingleTerminatedColumnDefinition, parseStatement, parseTableConstraint, parseUntilCommaOrTerminator, parseUntilSemiColon, parseUntilTerminator, parseUntilTerminatorIgnoreEmbeddedStatements, removeMissingTerminatorNodes, rewrite, score, setAsSchemaChildNode, setDatatypeParser, setDoUseTerminator, setRootNode, setTerminator, setTestMode, testPrint, unknownTerminatedNode`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ID

          public static final String ID

      The Teiid parser identifier.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TeiidDdlParser

          public TeiidDdlParser()

      Constructs a Teiid DDL parser.

  - ### Method Detail

    - #### getCustomDataTypeStartWords

          protected List<String> getCustomDataTypeStartWords()

      Returns a list of custom data type start words which can be used to help identify a column definition sub-statement. Sub-classes should override this method to contribute DB-specific data types.
      Overrides:
        `getCustomDataTypeStartWords` in class `StandardDdlParser`
      Returns:
        list of data type start words
      See Also:
        `StandardDdlParser.getCustomDataTypeStartWords()`

    - #### getId

          public String getId()

      Get the identifier for this parser.
      Specified by:
        `getId` in interface `DdlParser`
      Overrides:
        `getId` in class `StandardDdlParser`
      Returns:
        the parser's identifier; never null
      See Also:
        `StandardDdlParser.getId()`

    - #### getValidSchemaChildTypes

          protected String[] getValidSchemaChildTypes()

      Overrides:
        `getValidSchemaChildTypes` in class `StandardDdlParser`
      See Also:
        `StandardDdlParser.getValidSchemaChildTypes()`

    - #### initializeTokenStream

          protected void initializeTokenStream(DdlTokenStream tokens)

      Method called by `StandardDdlParser.score(String, String, DdlParserScorer)` and `StandardDdlParser.parse(String, AstNode, Object)` to initialize the `token stream`, giving subclasses a chance to `register key words` and `statement start phrases`.
      Overrides:
        `initializeTokenStream` in class `StandardDdlParser`
      Parameters:
        `tokens` - the stream of tokens
      See Also:
        `StandardDdlParser.initializeTokenStream(org.modeshape.sequencer.ddl.DdlTokenStream)`

    - #### parseNextStatement

          protected AstNode parseNextStatement(DdlTokenStream tokens,
                                   AstNode parentNode)

      Performs token match checks for initial statement type and delegates to specific parser methods. If no specific statement is found, then a call is made to parse a custom statement type. Subclasses may override this method, but the `StandardDdlParser`.parseCustomStatement() method is designed to allow for parsing db-specific statement types.
      Overrides:
        `parseNextStatement` in class `StandardDdlParser`
      Parameters:
        `tokens` - the tokenized `DdlTokenStream` of the DDL input content; may not be null
        `parentNode` - the top level `AstNode`; may not be null
      Returns:
        node the new statement node
      See Also:
        `StandardDdlParser.parseNextStatement(org.modeshape.sequencer.ddl.DdlTokenStream, org.modeshape.sequencer.ddl.node.AstNode)`

    - #### postProcess

          public void postProcess(AstNode rootNode)

      Allows parsers to post process the `AstNode` tree given the supplied root. Initial use-case would be to allow a second pass through the tree to resolve any table references (FK's) that were defined out of order in the DDL
      Specified by:
        `postProcess` in interface `DdlParser`
      Overrides:
        `postProcess` in class `StandardDdlParser`
      Parameters:
        `rootNode` - the top level `AstNode`; may not be null
      See Also:
        `DdlParser.postProcess(org.modeshape.sequencer.ddl.node.AstNode)`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.