isColumnDefinitionStart(DdlTokenStream tokens)
This utility method provides this parser the ability to distinguish between a CreateTable Constrain and a ColumnDefinition
Definition which are the only two statement segment types allowed within the CREATE TABLE parenthesis ( xxxxxx );

isTableConstraint(DdlTokenStream tokens)
This utility method provides this parser the ability to distinguish between a CreateTable Constraint and a ColumnDefinition
Definition which are the only two statement segment types allowed within the CREATE TABLE parenthesis ( xxxxxx );

setRootNode

score

Determine this parser's score for the given DDL string. This method is called to determine how well this parser handles the
supplied DDL, and is often called before the DdlParser.parse(String, AstNode, Object) method.

getIdentifyingKeywords

parse

Parses a DDL string, adding child AstNodes and properties to the supplied root. This method instantiates the
tokenizer, calls a method to allow subclasses to register keywords and statement start phrases with the tokenizer and
finally performs the tokenizing (i.e. tokens.start()) before calling the actual parse method.

parseNextStatement

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.

Parameters:

tokens - the tokenized DdlTokenStream of the DDL input content; may not be null

handleUnknownToken

Utility method subclasses can override to check unknown tokens and perform additional node manipulation. Example would be
in Oracle dialect for CREATE FUNCTION statements that can end with an '/' character because statement can contain multiple
statements.

Parameters:

tokens - the DdlTokenStream representing the tokenized DDL content; may not be null

parseColumnsAndConstraints

Utility method to parse columns and table constraints within either a CREATE TABLE statement. Method first parses and
copies the text enclosed within the bracketed "( xxxx )" statement. Then the individual column definition or table
constraint definition sub-statements are parsed assuming they are comma delimited.

Parameters:

tokens - the DdlTokenStream representing the tokenized DDL content; may not be null

parseIgnorableStatement

Utility method to parse a statement that can be ignored. The value returned in the generic AstNode will contain all
text between starting token and either the terminator (if defined) or the next statement start token. NOTE: This method
does NOT mark and add consumed fragment to parent node.

Parameters:

tokens - the DdlTokenStream representing the tokenized DDL content; may not be null

parseIgnorableStatement

Utility method to parse a statement that can be ignored. The value returned in the generic AstNode will contain all
text between starting token and either the terminator (if defined) or the next statement start token. NOTE: This method
does NOT mark and add consumed fragment to parent node.

Parameters:

tokens - the DdlTokenStream representing the tokenized DDL content; may not be null

isTableConstraint

This utility method provides this parser the ability to distinguish between a CreateTable Constraint and a ColumnDefinition
Definition which are the only two statement segment types allowed within the CREATE TABLE parenthesis ( xxxxxx );

Parameters:

tokens - the DdlTokenStream representing the tokenized DDL content; may not be null

isColumnDefinitionStart

This utility method provides this parser the ability to distinguish between a CreateTable Constrain and a ColumnDefinition
Definition which are the only two statement segment types allowed within the CREATE TABLE parenthesis ( xxxxxx );

Parameters:

tokens - the DdlTokenStream representing the tokenized DDL content; may not be null

parseUntilTerminatorIgnoreEmbeddedStatements

Utility method which parses tokens until a terminator is found or there are no more tokens. This method differs from
parseUntilTermintor() in that it ignores embedded statements. This method can be used for parsers that have statements
which can embed statements that should not be parsed.

Parameters:

tokens - the DdlTokenStream representing the tokenized DDL content; may not be null

parseUntilCommaOrTerminator

doUseTerminator

public boolean doUseTerminator()

Returns if parser is using statement terminator or not.

Returns:

value of useTerminator flag.

setDoUseTerminator

public void setDoUseTerminator(boolean useTerminator)

Sets the value of the use terminator flag for the parser. If TRUE, then all statements are expected to be terminated by a
terminator. The default terminator ";" can be overridden by setting the value using setTerminator() method.

markEndOfStatement

Marks the end of a statement by consuming the terminator (if exists). If it does not exist, a missing terminator node may
be added. If the resulting statement node is a valid child node type for a schema, the child node may be re-parented to the
schema if the schema is still parentable. Each resulting statement node is tagged with the enclosing source expression,
starting line number and column number from the file content as well as a starting character index from that same content.

Parameters:

tokens - the DdlTokenStream representing the tokenized DDL content; may not be null