Package com.mckoi.database.sql
Class SQL
java.lang.Object
com.mckoi.database.sql.SQL
- All Implemented Interfaces:
SQLConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanFields 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 TypeMethodDescriptionvoidaddOperatorToExpression(Expression exp, Operator op) Helper for expression parsing.final StatementTreeAlter()final StatementTreefinal StatementTreefinal voidAssignmentList(ArrayList assignment_list) final ArrayListBasicColumnList(ArrayList list) final Stringfinal voidBetweenPredicate(Expression exp, Stack stack) final voidBooleanOperator(Expression exp, Stack stack) final StatementTreeCall()If the parser has been defined as case insensitive then this returns the uppercase version of the given string.final voidColumnConstraint(ColumnDef column) final voidColumnDataType(ColumnDef column) final voidColumnDeclarationList(ArrayList column_list, ArrayList constraint_list) final ColumnDeffinal Stringfinal Variablefinal voidColumnOrConstraintDefinition(ArrayList column_list, ArrayList constraint_list) final StatementTreeCompact()final StatementTreefinal voidfinal voidConstraintAttributes(ConstraintDef constraint) final Stringfinal StatementTreeCreate()final StatementTreefinal StatementTreefinal StatementTreefinal StatementTreecreateSubstitution(String image) Creates and returns a parameter substitution.final StatementTreefinal StatementTreefinal StatementTreefinal StatementTreefinal StatementTreeDelete()final StatementTreeDescribe()final voidfinal Expressionfinal Expressionfinal StatementTreeDrop()final StatementTreefinal StatementTreefinal StatementTreefinal StatementTreefinal StatementTreefinal StatementTreefinal StatementTreeDropUser()final StatementTreeDropView()final voidvoidexpEnd(Expression exp, Stack stack) Helper for expression parsing.voidexpEndParen(Expression exp, Stack stack) Helper for expression parsing.voidexpOperator(Expression exp, Stack stack, Operator op) Helper for expression parsing.final voidexpression(Expression exp, Stack stack) Parse an expression.final Expression[]final ExpressionvoidflushOperatorStack(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 voidFromClauseJoin(FromClause from_clause) final FunctionDefFunction()final Tokenfinal Stringfinal Expression[]final ParseExceptionfinal AlterTableActionfinal intfinal Stringfinal intfinal intfinal intfinal Stringfinal intfinal Tokenfinal Stringfinal intfinal Stringfinal intfinal Stringfinal TableSelectExpressionfinal TokengetToken(int index) final TTypeGetTType()final StatementTreeGrant()final VariableNOTE: This is an extension, allows for us to specify a column to return the max value for each row representing a group.final Stringfinal StatementTreeInsert()final voidInsertDataList(ArrayList data_list) final Objectfinal ArrayListfinal FunctionDefstatic voidfinal voidnonBooleanExpression(Expression exp, Stack stack) Parses a non-boolean expression.final voidNumericOperator(Expression exp, Stack stack) final voidOperand(Expression exp, Stack stack) final voidOpPart(Expression exp, Stack stack) final booleanfinal Expressionfinal intfinal ArrayListfinal voidPrivListItem(ArrayList list) final Stringfinal Stringfinal Stringfinal voidProcParameterList(ArrayList decl_names, ArrayList decl_types) final StringvoidvoidReInit(InputStream stream) voidvoidreset()Resets the parameter id.final StatementTreeRevoke()final Stringfinal StatementTreeSelect()final SelectColumnfinal voidSelectColumnList(ArrayList list) final voidSelectGroupByList(ArrayList list) final voidSelectOrderByList(ArrayList list) final voidSelectTableList(FromClause from_clause) final Stringfinal StatementTreeSet()final booleanfinal StatementTreeShow()final StatementTreeShutDown()final Tokenfinal StatementTreefinal voidStringOperator(Expression exp, Stack stack) final voidSubQueryExpression(Expression exp, Stack stack) final voidSubQueryOperator(Expression exp, Stack stack) final Stringfinal ConstraintDeffinal voidTableDeclaration(FromClause from_clause) final Stringfinal voidTest()final Stringfinal Stringfinal voidTriggerTypes(ArrayList list) final StatementTreeUpdate()final voidfinal StringUserName()final ArrayListUserNameList(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()
-