Package com.mckoi.database.sql
Class SQL
java.lang.Object
com.mckoi.database.sql.SQL
- All Implemented Interfaces:
SQLConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
Fields inherited from interface com.mckoi.database.sql.SQLConstants
ACCOUNT, ACTION, ADD, AFTER, ALL, ALTER, AND, ANY, AS, ASC, ASSIGNMENT, AUTOCOMMIT, BEFORE, BETWEEN, BIGINT, BINARY, BIT, BLOB, BOOLEAN, BOOLEAN_LITERAL, BOTH, CACHE, CALL, CALLBACK, CANONICAL_DECOMPOSITION, CASCADE, CAST, CHAR, CHARACTER, CHECK, CLOB, COLLATE, COMMIT, COMPACT, CONCAT, CONSTRAINT, COUNT, CREATE, CROSS, CTALIAS, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, CYCLE, DATE, DECIMAL, DEFAULT, DEFERRABLE, DEFERRED, DELETE, DESC, DESCRIBE, DIGIT, DISTINCT, DIVIDE, DOT_DELIMINATED_REF, DOUBLE, DROP, EACH, EOF, EQUALS, EXCEPT, EXECUTE, EXISTS, EXPLAIN, FLOAT, FOR, FOREIGN, FROM, FULL_DECOMPOSITION, FUNCTION, GLOBVARIABLE, GR, GRANT, GREQ, GROUPBY, GROUPMAX, GROUPS, HAVING, IDENTICAL_STRENGTH, IDENTIFIER, IF, IGNORE, IMMEDIATE, IN, INCREMENT, INDEX, INDEX_BLIST, INDEX_NONE, INITIALLY, INNER, INSERT, INT, INTEGER, INTERSECT, INTO, IS, JAVA, JAVA_OBJECT, JAVA_OBJECT_ARRAY_REF, JOIN, KEY, LANGUAGE, LE, LEADING, LEEQ, LEFT, LETTER, LIKE, LIMIT, LOCK, LONG, LONGVARBINARY, LONGVARCHAR, MAXVALUE, MINVALUE, NAME, NATURAL, NEW, NO, NO_DECOMPOSITION, NOT, NOTEQ, NULL_LITERAL, NUMBER_LITERAL, NUMERIC, OLD, ON, OPTIMIZE, OPTION, OR, ORDERBY, OUTER, PARAMETER_REF, PASSWORD, PRIMARY, PRIMARY_STRENGTH, PRIVILEGES, PROCEDURE, PUBLIC, QUOTED_DELIMINATED_REF, QUOTED_VARIABLE, QUOTEDGLOBVARIABLE, READCOMMITTED, READUNCOMMITTED, REAL, REFERENCES, REGEX, REGEX_LITERAL, REPEATABLEREAD, RESTRICT, RETURNS, REVOKE, RIGHT, ROLLBACK, ROW, SCHEMA, SECONDARY_STRENGTH, SELECT, SEQUENCE, SERIALIZABLE, SET, SHOW, SHUTDOWN, SMALLINT, SOME, SQLADD, SQLCOLUMN, SQLDEFAULT, SQLRETURN, STAR, START, STRING, STRING_LITERAL, SUBTRACT, TABLE, TEMPORARY, TERTIARY_STRENGTH, TEXT, TIME, TIMESTAMP, TINYINT, TO, tokenImage, TRAILING, TRANSACTIONISOLATIONLEVEL, TRIGGER, TRIM, UNION, UNIQUE, UNLOCK, UPDATE, USAGE, USE, USER, USING, VALUES, VARBINARY, VARCHAR, VARYING, VIEW, WHERE, WITH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOperatorToExpression
(Expression exp, Operator op) Helper for expression parsing.final StatementTree
Alter()
final StatementTree
final StatementTree
final void
AssignmentList
(ArrayList assignment_list) final ArrayList
BasicColumnList
(ArrayList list) final String
final void
BetweenPredicate
(Expression exp, Stack stack) final void
BooleanOperator
(Expression exp, Stack stack) final StatementTree
Call()
If the parser has been defined as case insensitive then this returns the uppercase version of the given string.final void
ColumnConstraint
(ColumnDef column) final void
ColumnDataType
(ColumnDef column) final void
ColumnDeclarationList
(ArrayList column_list, ArrayList constraint_list) final ColumnDef
final String
final Variable
final void
ColumnOrConstraintDefinition
(ArrayList column_list, ArrayList constraint_list) final StatementTree
Compact()
final StatementTree
final void
final void
ConstraintAttributes
(ConstraintDef constraint) final String
final StatementTree
Create()
final StatementTree
final StatementTree
final StatementTree
final StatementTree
createSubstitution
(String image) Creates and returns a parameter substitution.final StatementTree
final StatementTree
final StatementTree
final StatementTree
final StatementTree
Delete()
final StatementTree
Describe()
final void
final Expression
final Expression
final StatementTree
Drop()
final StatementTree
final StatementTree
final StatementTree
final StatementTree
final StatementTree
final StatementTree
final StatementTree
DropUser()
final StatementTree
DropView()
final void
void
expEnd
(Expression exp, Stack stack) Helper for expression parsing.void
expEndParen
(Expression exp, Stack stack) Helper for expression parsing.void
expOperator
(Expression exp, Stack stack, Operator op) Helper for expression parsing.final void
expression
(Expression exp, Stack stack) Parse an expression.final Expression[]
final Expression
void
flushOperatorStack
(Expression exp, Stack stack, int precedence) Flush the operator stack until the stack is either empty or the top element is either a "(" or of a precedence lower than the given precedence.final void
FromClauseJoin
(FromClause from_clause) final FunctionDef
Function()
final Token
final String
final Expression[]
final ParseException
final AlterTableAction
final int
final String
final int
final int
final int
final String
final int
final Token
final String
final int
final String
final int
final String
final TableSelectExpression
final Token
getToken
(int index) final TType
GetTType()
final StatementTree
Grant()
final Variable
NOTE: This is an extension, allows for us to specify a column to return the max value for each row representing a group.final String
final StatementTree
Insert()
final void
InsertDataList
(ArrayList data_list) final Object
final ArrayList
final FunctionDef
static void
final void
nonBooleanExpression
(Expression exp, Stack stack) Parses a non-boolean expression.final void
NumericOperator
(Expression exp, Stack stack) final void
Operand
(Expression exp, Stack stack) final void
OpPart
(Expression exp, Stack stack) final boolean
final Expression
final int
final ArrayList
final void
PrivListItem
(ArrayList list) final String
final String
final String
final void
ProcParameterList
(ArrayList decl_names, ArrayList decl_types) final String
void
void
ReInit
(InputStream stream) void
void
reset()
Resets the parameter id.final StatementTree
Revoke()
final String
final StatementTree
Select()
final SelectColumn
final void
SelectColumnList
(ArrayList list) final void
SelectGroupByList
(ArrayList list) final void
SelectOrderByList
(ArrayList list) final void
SelectTableList
(FromClause from_clause) final String
final StatementTree
Set()
final boolean
final StatementTree
Show()
final StatementTree
ShutDown()
final Token
final StatementTree
final void
StringOperator
(Expression exp, Stack stack) final void
SubQueryExpression
(Expression exp, Stack stack) final void
SubQueryOperator
(Expression exp, Stack stack) final String
final ConstraintDef
final void
TableDeclaration
(FromClause from_clause) final String
final void
Test()
final String
final String
final void
TriggerTypes
(ArrayList list) final StatementTree
Update()
final void
final String
UserName()
final ArrayList
UserNameList
(ArrayList list)
-
Field Details
-
token_source
-
token
-
jj_nt
-
lookingAhead
public boolean lookingAhead
-
-
Constructor Details
-
SQL
-
SQL
-
SQL
-
-
Method Details
-
reset
public void reset()Resets the parameter id. This MUST be called before a parser is used to parse a statement. -
createSubstitution
Creates and returns a parameter substitution. This is called when the parser comes across a '?' style object. This object is used to mark an expression with a place mark that can be substituted for a value later. -
caseCheck
If the parser has been defined as case insensitive then this returns the uppercase version of the given string. NOTE: This actually doesn't do anything because the case is now resolved outside the parser. -
expEndParen
Helper for expression parsing. Called when an end parenthese has been found. -
expOperator
Helper for expression parsing. Called when an operator has been read in. This needs to check precedence and add the operator to the expression as appropriate. -
flushOperatorStack
Flush the operator stack until the stack is either empty or the top element is either a "(" or of a precedence lower than the given precedence. -
expEnd
Helper for expression parsing. Called when an entire expression has been read in. We need to empty the stack. -
addOperatorToExpression
Helper for expression parsing. Adds an operator to the given expression. -
main
- Throws:
ParseException
-
Test
- Throws:
ParseException
-
parseExpression
- Throws:
ParseException
-
Statement
- Throws:
ParseException
-
Create
- Throws:
ParseException
-
Drop
- Throws:
ParseException
-
Select
- Throws:
ParseException
-
Update
- Throws:
ParseException
-
Alter
- Throws:
ParseException
-
AlterTable
- Throws:
ParseException
-
Compact
- Throws:
ParseException
-
CreateTable
- Throws:
ParseException
-
CreateTrigger
- Throws:
ParseException
-
DropTrigger
- Throws:
ParseException
-
CreateFunction
- Throws:
ParseException
-
DropFunction
- Throws:
ParseException
-
CreateSchema
- Throws:
ParseException
-
DropSchema
- Throws:
ParseException
-
CreateView
- Throws:
ParseException
-
DropView
- Throws:
ParseException
-
CreateIndex
- Throws:
ParseException
-
DropTable
- Throws:
ParseException
-
DropIndex
- Throws:
ParseException
-
Call
- Throws:
ParseException
-
CreateSequence
- Throws:
ParseException
-
DropSequence
- Throws:
ParseException
-
CreateUser
- Throws:
ParseException
-
AlterUser
- Throws:
ParseException
-
DropUser
- Throws:
ParseException
-
UserManagerCommand
- Throws:
ParseException
-
Delete
- Throws:
ParseException
-
Insert
- Throws:
ParseException
-
Describe
- Throws:
ParseException
-
Show
- Throws:
ParseException
-
Grant
- Throws:
ParseException
-
Revoke
- Throws:
ParseException
-
CompleteTransaction
- Throws:
ParseException
-
Set
- Throws:
ParseException
-
ShutDown
- Throws:
ParseException
-
TriggerType
- Throws:
ParseException
-
BeforeOrAfter
- Throws:
ParseException
-
TriggerTypes
- Throws:
ParseException
-
PrivObject
- Throws:
ParseException
-
PrivList
- Throws:
ParseException
-
PrivListItem
- Throws:
ParseException
-
GetTableSelectExpression
- Throws:
ParseException
-
GetAlterTableAction
- Throws:
ParseException
-
InsertElement
- Throws:
ParseException
-
InsertExpressionList
- Throws:
ParseException
-
InsertDataList
- Throws:
ParseException
-
SetQuantifier
- Throws:
ParseException
-
SelectColumnList
- Throws:
ParseException
-
SelectColumn
- Throws:
ParseException
-
SelectGroupByList
- Throws:
ParseException
-
GroupMaxColumn
NOTE: This is an extension, allows for us to specify a column to return the max value for each row representing a group.- Throws:
ParseException
-
SelectOrderByList
- Throws:
ParseException
-
OrderingSpec
- Throws:
ParseException
-
TableDeclaration
- Throws:
ParseException
-
SelectTableList
- Throws:
ParseException
-
FromClauseJoin
- Throws:
ParseException
-
ProcParameterList
public final void ProcParameterList(ArrayList decl_names, ArrayList decl_types) throws ParseException - Throws:
ParseException
-
AssignmentList
- Throws:
ParseException
-
ColumnDeclarationList
public final void ColumnDeclarationList(ArrayList column_list, ArrayList constraint_list) throws ParseException - Throws:
ParseException
-
ColumnOrConstraintDefinition
public final void ColumnOrConstraintDefinition(ArrayList column_list, ArrayList constraint_list) throws ParseException - Throws:
ParseException
-
ColumnDefinition
- Throws:
ParseException
-
ColumnConstraint
- Throws:
ParseException
-
GetCollateStrength
- Throws:
ParseException
-
GetCollateDecomposition
- Throws:
ParseException
-
GetStringSQLType
- Throws:
ParseException
-
GetNumericSQLType
- Throws:
ParseException
-
GetBooleanSQLType
- Throws:
ParseException
-
GetDateSQLType
- Throws:
ParseException
-
GetBinarySQLType
- Throws:
ParseException
-
GetTType
- Throws:
ParseException
-
ColumnDataType
- Throws:
ParseException
-
TableConstraintDefinition
- Throws:
ParseException
-
ReferentialTrigger
- Throws:
ParseException
-
ConstraintAttributes
- Throws:
ParseException
-
BasicColumnList
- Throws:
ParseException
-
UserNameList
- Throws:
ParseException
-
ConditionsExpression
- Throws:
ParseException
-
ExpressionTest
- Throws:
ParseException
-
DoExpression
- Throws:
ParseException
-
DoNonBooleanExpression
- Throws:
ParseException
-
expression
Parse an expression.- Throws:
ParseException
-
nonBooleanExpression
Parses a non-boolean expression.- Throws:
ParseException
-
OpPart
- Throws:
ParseException
-
Operand
- Throws:
ParseException
-
SubQueryExpression
- Throws:
ParseException
-
PositiveIntegerConstant
- Throws:
ParseException
-
SubQueryOperator
- Throws:
ParseException
-
BetweenPredicate
- Throws:
ParseException
-
BooleanOperator
- Throws:
ParseException
-
NumericOperator
- Throws:
ParseException
-
StringOperator
- Throws:
ParseException
-
GetBooleanOperator
- Throws:
ParseException
-
GetSubQueryBooleanOperator
- Throws:
ParseException
-
GetNumericOperator
- Throws:
ParseException
-
GetStringOperator
- Throws:
ParseException
-
FunctionIdentifier
- Throws:
ParseException
-
Function
- Throws:
ParseException
-
JavaInstantiation
- Throws:
ParseException
-
FunctionParams
- Throws:
ParseException
-
ExpressionList
- Throws:
ParseException
-
GetComposite
- Throws:
ParseException
-
TableName
- Throws:
ParseException
-
SequenceName
- Throws:
ParseException
-
TriggerName
- Throws:
ParseException
-
IndexName
- Throws:
ParseException
-
UserName
- Throws:
ParseException
-
SchemaName
- Throws:
ParseException
-
ConstraintName
- Throws:
ParseException
-
ColumnName
- Throws:
ParseException
-
ColumnNameVariable
- Throws:
ParseException
-
TableAliasName
- Throws:
ParseException
-
ProcedureName
- Throws:
ParseException
-
FunctionName
- Throws:
ParseException
-
ProcArgumentName
- Throws:
ParseException
-
SQLIdentifier
- Throws:
ParseException
-
ReInit
-
ReInit
-
ReInit
-
getNextToken
-
getToken
-
generateParseException
-
enable_tracing
public final void enable_tracing() -
disable_tracing
public final void disable_tracing()
-