BNF for SQLParser.jj

NON-TERMINALS

Start ::= ( SQLStatement ( <SEMICOLON> | <SOLIDUS> ) )* <EOF>
SQLStatement ::= ( CreateTableStatement | AlterTableStatement | DropTableStatement | CreateDomainStatement | AlterDomainStatement | DropDomainStatement | OtherStatements )
CreateTableStatement ::= <CREATE> ( ( <GLOBAL> | <LOCAL> ) <TEMPORARY> )? <TABLE> TableName TableElementList ( <ON> <COMMIT> ( <DELETE> | <PRESERVE> ) <ROWS> )? ( OracleParams1 )* ( OracleParams2 )? ( <AS> )?
TableName ::= QualifiedName
QualifiedName ::= ( <IDENTIFIER> <PERIOD> ( <IDENTIFIER> <PERIOD> )? )? Identifier
Identifier ::= ( <CHARACTERSET> )? ( RegularIdentifier | DelimitedIdentifier )
RegularIdentifier ::= <IDENTIFIER>
DelimitedIdentifier ::= ( DelimitedIdentifierPart )+
DelimitedIdentifierPart ::= <QUOTEDSTRING>
TableElementList ::= <LEFTPAREN> TableElement ( <COMMA> TableElement )* <RIGHTPAREN>
TableElement ::= ColumnDefinition
| TableConstraintDefinition
ColumnDefinition ::= ColumnName ( DataType | DomainName ) ( DefaultClause )? ( ColumnConstraintDefinition )* ( CollateClause )?
ColumnName ::= Identifier
DataType ::= ( SpecificType | IntervalType )
SpecificType ::= ( <NATIONAL> )? ( <CHARACTER> | <CHAR> | <VARCHAR> | <VARCHAR2> | <NCHAR> | <BIT> | <NUMERIC> | <DECIMAL> | <DEC> | <INTEGER> | <INT> | <SMALLINT> | <NUMBER> | <FLOAT> | <REAL> | <DOUBLE> <PRECISION> | <RAW> | <LONG> <RAW> | <ROWID> | <MLSLABEL> | <LONG> <VARCHAR> | <GRAPHIC> | <LONG> <VARGRAPHIC> | <VARGRAPHIC> | <DATE> | <TIME> <WITH> <TIME> <ZONE> | <TIME> | <TIMESTAMP> | <LONG> ) ( <VARYING> )? ( <LEFTPAREN> <UNSIGNEDINT> ( <COMMA> ( <UNSIGNEDINT> | <SIGNEDINT> ) )? <RIGHTPAREN> )? ( <CHARACTER> <SET> CharacterSetName )?
CharacterSetName ::= ( <IDENTIFIER> <PERIOD> ( <IDENTIFIER> <PERIOD> )? )? RegularIdentifier
IntervalType ::= <INTERVAL> IntervalQualifier
IntervalQualifier ::= StartField <TO> EndField
| SingleDatetimeField
StartField ::= NonSecondDatetimeField ( <LEFTPAREN> <UNSIGNEDINT> <RIGHTPAREN> )?
NonSecondDatetimeField ::= <YEAR>
| <MONTH>
| <DAY>
| <HOUR>
| <MINUTE>
EndField ::= NonSecondDatetimeField
| <SECOND> ( <LEFTPAREN> <UNSIGNEDINT> <RIGHTPAREN> )?
SingleDatetimeField ::= NonSecondDatetimeField ( <LEFTPAREN> <UNSIGNEDINT> <RIGHTPAREN> )?
| <SECOND> ( <LEFTPAREN> <UNSIGNEDINT> ( <COMMA> <UNSIGNEDINT> )? <RIGHTPAREN> )?
DomainName ::= QualifiedName
DefaultClause ::= <DEFAULT_> DefaultOption
DefaultOption ::= ( Literal | DatetimeValueFunction | ( <USER> | <CURRENT_USER> | <SESSION_USER> | <SYSTEM_USER> | <NULL> ) )
Literal ::= ( <UNSIGNEDINT> | <SIGNEDINT> | <CHARSTRINGLITERAL> | <NATIONALCHARSTRINGLITERAL> | <BITSTRINGLITERAL> | <HEXSTRINGLITERAL> )
DatetimeValueFunction ::= ( <CURRENT_DATE> | ( <CURRENT_TIME> | <CURRENT_TIMESTAMP> ) ( <LEFTPAREN> <UNSIGNEDINT> <RIGHTPAREN> )? )
ColumnConstraintDefinition ::= ( <CONSTRAINT> ConstraintName )? ColumnConstraint ( ConstraintAttributes )? ( OracleConstraintParameters )?
ConstraintName ::= QualifiedName
ColumnConstraint ::= NotNullSpecification
| UniqueSpecification
| ReferencesSpecification
| CheckConstraintDefinition
NotNullSpecification ::= ( <NOT> )? <NULL>
UniqueSpecification ::= ( <UNIQUE> | <PRIMARY> <KEY> )
ReferencesSpecification ::= <REFERENCES> ReferencedTableAndColumns ( <MATCH> ( <FULL> | <PARTIAL> ) )? ( ReferentialTriggeredAction )?
ReferencedTableAndColumns ::= TableName ( ColumnNameList )?
ColumnNameList ::= <LEFTPAREN> ColumnName ( <COMMA> ColumnName )* <RIGHTPAREN>
ReferentialTriggeredAction ::= <ON> ( ( UpdateRule ( <ON> DeleteRule )? ) | ( DeleteRule ( <ON> UpdateRule )? ) )
UpdateRule ::= <UPDATE> ReferentialAction
ReferentialAction ::= <CASCADE>
| <SET> ( <NULL> | <DEFAULT_> )
| <NO> <ACTION>
DeleteRule ::= <DELETE> ReferentialAction
CheckConstraintDefinition ::= <CHECK> <LEFTPAREN> skip_to_matching_parenthesis <RIGHTPAREN>
skip_to_matching_parenthesis ::= java code
ConstraintAttributes ::= ( ConstraintCheckTime ( ( <NOT> )? <DEFERRABLE> )? | ( <NOT> )? <DEFERRABLE> ( ConstraintCheckTime )? )
ConstraintCheckTime ::= <INITIALLY> ( <DEFERRED> | <IMMEDIATE> )
OracleConstraintParameters ::= ( UsingIndex | <DISABLE> )
UsingIndex ::= <USING> <INDEX> ( OracleParams1 )+
OracleParams1 ::= ( ( <PCTFREE> | <PCTUSED> | <INITRANS> | <MAXTRANS> ) ( <UNSIGNEDINT> | <SIGNEDINT> ) | <TABLESPACE> Identifier | <STORAGE> <LEFTPAREN> skip_to_matching_parenthesis <RIGHTPAREN> | <RECOVERABLE> | <UNRECOVERABLE> | <NOSORT> | <CLUSTER> Identifier ( ColumnNameList )? | <ALLOCATE> <EXTENT> <LEFTPAREN> skip_to_matching_parenthesis <RIGHTPAREN> | <DEALLOCATE> <UNUSED> ( <KEEP> <UNSIGNEDINT> ( <K> | <M> )? )? )
CollateClause ::= <COLLATE> QualifiedName
TableConstraintDefinition ::= ( <CONSTRAINT> ConstraintName )? TableConstraint ( ConstraintAttributes )? ( OracleConstraintParameters )?
TableConstraint ::= UniqueConstraintDefinition
| ReferentialConstraintDefinition
| CheckConstraintDefinition
UniqueConstraintDefinition ::= UniqueSpecification ColumnNameList
ReferentialConstraintDefinition ::= <FOREIGN> <KEY> ( ColumnNameList | ColumnName ) ReferencesSpecification
OracleParams2 ::= ( ( ( <ENABLE> | <DISABLE> ) ( ( <UNIQUE> ColumnNameList | <PRIMARY> <KEY> | <CONSTRAINT> ConstraintName ) ( UsingIndex )? ( <EXCEPTIONS> <INTO> TableName )? ( <CASCADE> )? | <ALL> <TRIGGERS> | <TABLE> <LOCK> ) )+ | <NOPARALLEL> | <PARALLEL> <LEFTPAREN> skip_to_matching_parenthesis <RIGHTPAREN> | <CACHE> | <NOCACHE> )
AlterTableStatement ::= <ALTER> <TABLE> TableName ( AlterTableAction )+ ( OracleParams2 )?
AlterTableAction ::= AddColumnDefinition
| AlterColumnDefinition
| ModifyColumnDefinition
| DropColumnDefinition
| AddTableConstraintDefinition
| DropTableConstraintDefinition
| OracleParams1
AddColumnDefinition ::= <ADD> ColumnDefinitionList
ColumnDefinitionList ::= <LEFTPAREN> ColumnDefinition ( <COMMA> ColumnDefinition )* <RIGHTPAREN>
| ( <COLUMN> )? ColumnDefinition
AlterColumnDefinition ::= <ALTER> ( <COLUMN> )? ColumnName AlterColumnAction
AlterColumnAction ::= AlterDefault
AlterDefault ::= <SET> DefaultClause
| ( <DROP> <DEFAULT_> )
ModifyColumnDefinition ::= <MODIFY> ( <LEFTPAREN> ColumnModification ( <COMMA> ColumnModification )* <RIGHTPAREN> | ( <COLUMN> )? ColumnModification )
ColumnModification ::= ColumnName ( DataType | DomainName )? ( DefaultClause )? ( ( <CONSTRAINT> ConstraintName )? NotNullSpecification ( OracleConstraintParameters )? )?
DropColumnDefinition ::= <DROP> ( <COLUMN> )? ColumnName ( DropBehavior )?
DropBehavior ::= <CASCADE>
| <RESTRICT>
AddTableConstraintDefinition ::= <ADD> TableConstraintDefinitionList
TableConstraintDefinitionList ::= <LEFTPAREN> TableConstraintDefinition ( <COMMA> TableConstraintDefinition )* <RIGHTPAREN>
| TableConstraintDefinition
DropTableConstraintDefinition ::= <DROP> ( <CONSTRAINT> ConstraintName ( DropBehavior )? | <PRIMARY> <KEY> ( <CASCADE> )? | <UNIQUE> ColumnNameList ( <CASCADE> )? )
DropTableStatement ::= <DROP> <TABLE> TableName ( ( <CASCADE> <CONSTRAINTS> )? | ( DropBehavior )? )
CreateDomainStatement ::= <CREATE> <DOMAIN> DomainName ( <AS> )? DataType ( DefaultClause )? ( DomainConstraint )* ( CollateClause )?
DomainConstraint ::= ( <CONSTRAINT> ConstraintName )? CheckConstraintDefinition ( ConstraintAttributes )?
AlterDomainStatement ::= <ALTER> <DOMAIN> DomainName AlterDomainAction
AlterDomainAction ::= AlterDefault
| AddDomainConstraintDefinition
| DropDomainConstraintDefinition
AddDomainConstraintDefinition ::= <ADD> DomainConstraint
DropDomainConstraintDefinition ::= <DROP> <CONSTRAINT> ConstraintName
DropDomainStatement ::= <DROP> <DOMAIN> DomainName ( DropBehavior )?
OtherStatements ::= ( <IDENTIFIER> | <SET> | <DROP> | <LOCK> | <ALTER> | <COMMIT> | <CREATE> | <DELETE> | <ENABLE> | <MODIFY> | <UPDATE> | <DISABLE> ) skip_this_statement
skip_this_statement ::= java code