00001: /* Generated By:JavaCC: Do not edit this line. SQLParser.java */
00002: /*
00003:
00004: Derby - File org.apache.derby.impl.sql.compile.sqlgrammar.jj
00005:
00006: Licensed to the Apache Software Foundation (ASF) under one or more
00007: contributor license agreements. See the NOTICE file distributed with
00008: this work for additional information regarding copyright ownership.
00009: The ASF licenses this file to you under the Apache License, Version 2.0
00010: (the "License"); you may not use this file except in compliance with
00011: the License. You may obtain a copy of the License at
00012:
00013: http://www.apache.org/licenses/LICENSE-2.0
00014:
00015: Unless required by applicable law or agreed to in writing, software
00016: distributed under the License is distributed on an "AS IS" BASIS,
00017: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00018: See the License for the specific language governing permissions and
00019: limitations under the License.
00020:
00021: */
00022:
00023: package org.apache.derby.impl.sql.compile;
00024:
00025: import org.apache.derby.iapi.sql.Statement;
00026: import org.apache.derby.iapi.sql.StatementType;
00027:
00028: /* aggregates */
00029: import org.apache.derby.impl.sql.compile.CountAggregateDefinition;
00030: import org.apache.derby.impl.sql.compile.MaxMinAggregateDefinition;
00031: import org.apache.derby.impl.sql.compile.SumAvgAggregateDefinition;
00032:
00033: import org.apache.derby.impl.sql.compile.AggregateNode;
00034: import org.apache.derby.impl.sql.compile.BinaryOperatorNode;
00035: import org.apache.derby.impl.sql.compile.CallStatementNode;
00036: import org.apache.derby.impl.sql.compile.CharConstantNode;
00037: import org.apache.derby.impl.sql.compile.CastNode;
00038: import org.apache.derby.impl.sql.compile.ColumnDefinitionNode;
00039: import org.apache.derby.impl.sql.compile.ColumnReference;
00040: import org.apache.derby.impl.sql.compile.CursorNode;
00041: import org.apache.derby.impl.sql.compile.FromBaseTable;
00042: import org.apache.derby.impl.sql.compile.FromList;
00043: import org.apache.derby.impl.sql.compile.FromSubquery;
00044: import org.apache.derby.impl.sql.compile.FromTable;
00045: import org.apache.derby.impl.sql.compile.GroupByList;
00046: import org.apache.derby.impl.sql.compile.HasNodeVisitor;
00047: import org.apache.derby.impl.sql.compile.JavaToSQLValueNode;
00048: import org.apache.derby.impl.sql.compile.JoinNode;
00049: import org.apache.derby.impl.sql.compile.MethodCallNode;
00050: import org.apache.derby.impl.sql.compile.QueryTreeNode;
00051: import org.apache.derby.impl.sql.compile.ReplaceAggregatesWithCRVisitor;
00052: import org.apache.derby.impl.sql.compile.ResultColumnList;
00053: import org.apache.derby.impl.sql.compile.ResultColumn;
00054: import org.apache.derby.impl.sql.compile.OrderByList;
00055: import org.apache.derby.impl.sql.compile.OrderByColumn;
00056: import org.apache.derby.impl.sql.compile.ResultSetNode;
00057: import org.apache.derby.impl.sql.compile.SelectNode;
00058: import org.apache.derby.impl.sql.compile.SubqueryNode;
00059: import org.apache.derby.impl.sql.compile.TableName;
00060: import org.apache.derby.impl.sql.compile.TernaryOperatorNode;
00061: import org.apache.derby.impl.sql.compile.ParameterNode;
00062: import org.apache.derby.impl.sql.compile.PrivilegeNode;
00063: import org.apache.derby.impl.sql.compile.ConstraintDefinitionNode;
00064: import org.apache.derby.impl.sql.compile.DMLModStatementNode;
00065: import org.apache.derby.impl.sql.compile.RoutineDesignator;
00066: import org.apache.derby.impl.sql.compile.StatementNode;
00067: import org.apache.derby.impl.sql.compile.TableElementList;
00068: import org.apache.derby.impl.sql.compile.TableElementNode;
00069: import org.apache.derby.impl.sql.compile.TableOperatorNode;
00070: import org.apache.derby.impl.sql.compile.TablePrivilegesNode;
00071: import org.apache.derby.impl.sql.compile.TransactionStatementNode;
00072: import org.apache.derby.impl.sql.compile.TriggerReferencingStruct;
00073: import org.apache.derby.impl.sql.compile.UnionNode;
00074: import org.apache.derby.impl.sql.compile.IntersectOrExceptNode;
00075: import org.apache.derby.impl.sql.compile.UnaryOperatorNode;
00076: import org.apache.derby.impl.sql.compile.UntypedNullConstantNode;
00077: import org.apache.derby.impl.sql.compile.UpdateNode;
00078: import org.apache.derby.impl.sql.compile.UserTypeConstantNode;
00079: import org.apache.derby.impl.sql.compile.ValueNode;
00080: import org.apache.derby.impl.sql.compile.ValueNodeList;
00081: import org.apache.derby.impl.sql.compile.GroupByColumn;
00082: import org.apache.derby.impl.sql.compile.CurrentDatetimeOperatorNode;
00083: import org.apache.derby.impl.sql.compile.DDLStatementNode;
00084: import org.apache.derby.impl.sql.compile.AlterTableNode;
00085:
00086: import org.apache.derby.impl.sql.compile.ParseException;
00087: import org.apache.derby.impl.sql.compile.Token;
00088: import org.apache.derby.impl.sql.compile.TokenMgrError;
00089: import org.apache.derby.impl.sql.compile.SQLParserConstants;
00090: import org.apache.derby.impl.sql.compile.CharStream;
00091: import org.apache.derby.impl.sql.execute.TablePrivilegeInfo;
00092: import org.apache.derby.iapi.sql.dictionary.DataDictionary;
00093: import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
00094: import org.apache.derby.iapi.sql.dictionary.TriggerDescriptor;
00095: import org.apache.derby.iapi.sql.dictionary.ViewDescriptor;
00096: import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
00097:
00098: import org.apache.derby.iapi.sql.conn.Authorizer;
00099: import org.apache.derby.iapi.sql.execute.ConstantAction;
00100: import org.apache.derby.iapi.sql.execute.ExecutionContext;
00101:
00102: import org.apache.derby.iapi.types.DataTypeDescriptor;
00103: import org.apache.derby.iapi.types.TypeId;
00104: import org.apache.derby.iapi.sql.compile.TypeCompiler;
00105: import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
00106:
00107: import org.apache.derby.iapi.types.DateTimeDataValue;
00108: import org.apache.derby.iapi.types.DataTypeDescriptor;
00109: import org.apache.derby.iapi.types.DataTypeUtilities;
00110: import org.apache.derby.iapi.types.StringDataValue;
00111: import org.apache.derby.iapi.types.DataValueDescriptor;
00112:
00113: import org.apache.derby.iapi.error.StandardException;
00114:
00115: import org.apache.derby.iapi.reference.Property;
00116: import org.apache.derby.iapi.reference.SQLState;
00117: import org.apache.derby.iapi.reference.JDBC30Translation;
00118: import org.apache.derby.iapi.reference.Limits;
00119:
00120: import org.apache.derby.iapi.sql.compile.CompilerContext;
00121: import org.apache.derby.iapi.sql.compile.C_NodeTypes;
00122:
00123: import org.apache.derby.iapi.services.context.ContextManager;
00124:
00125: import org.apache.derby.iapi.sql.compile.NodeFactory;
00126:
00127: import org.apache.derby.iapi.services.sanity.SanityManager;
00128:
00129: import org.apache.derby.catalog.AliasInfo;
00130: import org.apache.derby.catalog.TypeDescriptor;
00131: import org.apache.derby.catalog.types.RoutineAliasInfo;
00132:
00133: import org.apache.derby.iapi.services.io.FormatableProperties;
00134: import org.apache.derby.iapi.services.io.StoredFormatIds;
00135: import org.apache.derby.iapi.util.ReuseFactory;
00136: import org.apache.derby.iapi.services.io.FormatableBitSet;
00137: import org.apache.derby.iapi.util.StringUtil;
00138:
00139: import java.sql.Types;
00140: import java.util.List;
00141: import java.util.ArrayList;
00142: import java.util.Hashtable;
00143: import java.util.Properties;
00144: import java.util.StringTokenizer;
00145: import java.util.Vector;
00146: import java.lang.Character;
00147:
00148: public class SQLParser implements SQLParserConstants {
00149: private static final String[] SAVEPOINT_CLAUSE_NAMES = { "UNIQUE",
00150: "ON ROLLBACK RETAIN LOCKS", "ON ROLLBACK RETAIN CURSORS" };
00151: private static final String[] ROUTINE_CLAUSE_NAMES = { null,
00152: "SPECIFIC", "RESULT SET", "LANGUAGE", "EXTERNAL NAME",
00153: "PARAMETER STYLE", "SQL", "ON NULL INPUT" };
00154: /**
00155: Clauses required for Java routines. Numbers correspond
00156: to offsets in ROUTINE_CLAUSE_NAMES.
00157: 3 - "LANGUAGE"
00158: 4 - "EXTERNAL NAME"
00159: 5 - "PARAMETER STYLE"
00160: */
00161: private static final int[] JAVA_ROUTINE_CLAUSES = { 3, 4, 5 };
00162: private static final String[] TEMPORARY_TABLE_CLAUSE_NAMES = {
00163: "NOT LOGGED", "ON COMMIT", "ON ROLLBACK" };
00164: /* The default length of a char or bit if the length is omitted */
00165: private static final int DEFAULT_STRING_COLUMN_LENGTH = 1;
00166:
00167: // Defines for ON or USING clauses
00168: private static final int ON_OR_USING_CLAUSE_SIZE = 2;
00169: private static final int ON_CLAUSE = 0;
00170: private static final int USING_CLAUSE = 1;
00171:
00172: // Defines for optional table clauses
00173: private static final int OPTIONAL_TABLE_CLAUSES_SIZE = 3;
00174: private static final int OPTIONAL_TABLE_CLAUSES_TABLE_PROPERTIES = 0;
00175: private static final int OPTIONAL_TABLE_CLAUSES_DERIVED_RCL = 1;
00176: private static final int OPTIONAL_TABLE_CLAUSES_CORRELATION_NAME = 2;
00177:
00178: // Define for UTF8 max
00179: private static final int MAX_UTF8_LENGTH = 65535;
00180:
00181: // Constants for set operator types
00182: private static final int NO_SET_OP = 0;
00183: private static final int UNION_OP = 1;
00184: private static final int UNION_ALL_OP = 2;
00185: private static final int EXCEPT_OP = 3;
00186: private static final int EXCEPT_ALL_OP = 4;
00187: private static final int INTERSECT_OP = 5;
00188: private static final int INTERSECT_ALL_OP = 6;
00189:
00190: private Object[] paramDefaults;
00191: private String statementSQLText;
00192: private NodeFactory nodeFactory;
00193: private ContextManager cm;
00194: private CompilerContext compilerContext;
00195:
00196: /* The number of the next ? parameter */
00197: private int parameterNumber;
00198:
00199: /* The list of ? parameters */
00200: private Vector parameterList;
00201:
00202: /* Remember if the last identifier or keyword was a
00203: * delimited identifier. This is used for remembering
00204: * if the xxx in SERIALIZE(xxx) was a delimited identifier
00205: * because we need to know whether or not we can convert
00206: * xxx to upper case if we try to resolve it as a class
00207: * alias at bind time.
00208: */
00209: private Boolean lastTokenDelimitedIdentifier = Boolean.FALSE;
00210: private Boolean nextToLastTokenDelimitedIdentifier = Boolean.FALSE;
00211:
00212: /*
00213: ** Remember the last token we got that was an identifier
00214: */
00215: private Token lastIdentifierToken;
00216: private Token nextToLastIdentifierToken;
00217:
00218: static final String SINGLEQUOTES = "\'\'";
00219: static final String DOUBLEQUOTES = "\"\"";
00220:
00221: static final String DEFAULT_INDEX_TYPE = "BTREE";
00222:
00223: //the following 2 booleans are used to make sure only null or not null is
00224: //defined for a column while creating a table or altering a table. Defining
00225: //both at the same time will be an error case.
00226: boolean explicitNotNull = false;
00227: boolean explicitNull = false;
00228:
00229: //this vector keeps a list of explicitly nullable columns, so that if they
00230: //get used in the table level primary key constraint, it will result in an
00231: //exception.
00232: Vector explicitlyNullableColumnsList = new Vector();
00233:
00234: final void setCompilerContext(CompilerContext cc) {
00235: this .compilerContext = cc;
00236: this .cm = cc.getContextManager();
00237: }
00238:
00239: /**
00240: * Get the NodeFactory for this database.
00241: *
00242: * @return The NodeFactory for this database.
00243: * @exception StandardException Thrown on error
00244: */
00245: private final NodeFactory getNodeFactory() throws StandardException {
00246: if (nodeFactory == null) {
00247: nodeFactory = getCompilerContext().getNodeFactory();
00248: }
00249:
00250: return nodeFactory;
00251: }
00252:
00253: private final CompilerContext getCompilerContext() {
00254: return compilerContext;
00255: }
00256:
00257: private DataTypeDescriptor getDataTypeServices(int type,
00258: int precision, int scale, int length) {
00259: return new DataTypeDescriptor(TypeId.getBuiltInTypeId(type),
00260: precision, scale, true, /* assume nullable for now, change it if not nullable */
00261: length);
00262: }
00263:
00264: private DataTypeDescriptor getJavaClassDataTypeDescriptor(
00265: String javaClassName) {
00266: return new DataTypeDescriptor(TypeId.getUserDefinedTypeId(
00267: javaClassName, lastTokenDelimitedIdentifier
00268: .booleanValue()), true);
00269: }
00270:
00271: private LanguageConnectionContext getLanguageConnectionContext() {
00272: return (LanguageConnectionContext) getContextManager()
00273: .getContext(LanguageConnectionContext.CONTEXT_ID);
00274: }
00275:
00276: /**
00277: Utility method for checking that the underlying database has been
00278: upgraded to the required level to use this functionality. Used to
00279: disallow SQL statements that would leave on-disk formats that would
00280: not be understood by a engine that matches the current upgrade level
00281: of the database. Throws an exception if the database is not a the required level.
00282: <P>
00283: Typically used for CREATE statements at the parser level. Called usually just
00284: before the node is created, or can be called in just a partial syntax fragment
00285:
00286: @param version Data Dictionary major version (DataDictionary.DD_ constant)
00287: @param feature SQL Feature name, for error text.
00288: */
00289: private void checkVersion(int version, String feature)
00290: throws StandardException {
00291: getLanguageConnectionContext().getDataDictionary()
00292: .checkVersion(version, feature);
00293: }
00294:
00295: /**
00296: Utility method for checking that the underlying database uses SQL standard
00297: permission checking (GRANT/REVOKE).
00298:
00299: @param command "GRANT" or "REVOKE"
00300: */
00301: private void checkSqlStandardAccess(String command)
00302: throws StandardException {
00303: if (getLanguageConnectionContext().usesSqlAuthorization())
00304: return;
00305:
00306: throw StandardException.newException(
00307: SQLState.LANG_GRANT_REVOKE_WITH_LEGACY_ACCESS, command,
00308: Property.SQL_AUTHORIZATION_PROPERTY, "TRUE");
00309: }
00310:
00311: /*
00312: ** Make sure that a select list in a parser-rewritten tree does
00313: ** not contain two columns by the same name. This is the patch
00314: ** to bug 280. In this case, the bind phase cannot tell the
00315: ** difference between the two columns and so the query may
00316: ** return wrong results.
00317: **
00318: ** This issue is caused by parser rewriting of group by/having clauses
00319: ** into table expressions. (See function tableExpression() in this file)
00320: ** There is an improvement request filed under DERBY-681 to eliminate this
00321: ** rewrite, after which it should be possible to allow multiple columns to
00322: ** have same name in the select list.
00323: */
00324: private void vetSelectList280(ResultColumnList selectList)
00325: throws StandardException {
00326: Hashtable allNames = new Hashtable();
00327: int count = selectList.size();
00328:
00329: for (int i = 0; i < count; i++) {
00330: ResultColumn rc = (ResultColumn) selectList.elementAt(i);
00331: String duplicateName = ambiguousDuplicateName(allNames, rc);
00332:
00333: if (duplicateName != null) {
00334: throw StandardException
00335: .newException(SQLState.LANG_UNBINDABLE_REWRITE,
00336: duplicateName);
00337: }
00338:
00339: }
00340: }
00341:
00342: // allow two references to the same column. disallow aliasing
00343: // two different expressions to the same name. returns the
00344: // ambiguous column name if two result columns cannot be distinguished.
00345: private String ambiguousDuplicateName(Hashtable allNames,
00346: ResultColumn rc) throws StandardException {
00347: String columnName = rc.getName();
00348: ValueNode newExpression = rc.getExpression();
00349:
00350: // no column name means that the compiler will generate a
00351: // unique name. that's ok and avoids bug 280
00352: if (columnName == null) {
00353: return null;
00354: }
00355:
00356: ValueNode oldExpression = (ValueNode) allNames.get(columnName);
00357:
00358: // no problem yet if we haven't seen this column
00359: if (oldExpression == null) {
00360: allNames.put(columnName, newExpression);
00361: return null;
00362: }
00363:
00364: // if the two identically named references aren't both the
00365: // same table column, then the bug occurs
00366: if (!(newExpression instanceof ColumnReference)
00367: || !(oldExpression instanceof ColumnReference)) {
00368: return columnName;
00369: }
00370:
00371: ColumnReference newCR = (ColumnReference) newExpression;
00372: ColumnReference oldCR = (ColumnReference) oldExpression;
00373: TableName newTableName = newCR.getTableNameNode();
00374: TableName oldTableName = oldCR.getTableNameNode();
00375:
00376: if (((newTableName == null) && (oldTableName == null))
00377: || ((newTableName != null) && (newTableName
00378: .equals(oldTableName)))) {
00379: // same table but different column aliased to same column name
00380: if (!newCR.getColumnName().equals(oldCR.getColumnName())) {
00381: return columnName;
00382: } else {
00383: return null;
00384: }
00385: }
00386:
00387: // different tables
00388: return null;
00389: }
00390:
00391: /**
00392: Check that the current mode supports internal extensions.
00393:
00394: @param feature Description of feature for exception.
00395:
00396: @exception StandardException current mode does not support statement
00397: */
00398: private void checkInternalFeature(String feature)
00399: throws StandardException {
00400: CompilerContext cc = getCompilerContext();
00401: if ((cc.getReliability() & CompilerContext.INTERNAL_SQL_ILLEGAL) != 0)
00402: throw StandardException.newException(
00403: SQLState.LANG_SYNTAX_ERROR, feature);
00404: }
00405:
00406: /**
00407: * check if the type length is ok for the given type.
00408: */
00409: private void checkTypeLimits(int type, int length)
00410: throws StandardException {
00411: boolean valid = true;
00412:
00413: switch (type) {
00414: case Types.BINARY:
00415: case Types.CHAR:
00416: if (length > Limits.DB2_CHAR_MAXWIDTH)
00417: valid = false;
00418: break;
00419:
00420: case Types.VARBINARY:
00421: case Types.VARCHAR:
00422: if (length > Limits.DB2_VARCHAR_MAXWIDTH)
00423: valid = false;
00424:
00425: break;
00426: default:
00427: break;
00428: }
00429: if (!valid) // If these limits are too big
00430: {
00431: DataTypeDescriptor charDTD = DataTypeDescriptor
00432: .getBuiltInDataTypeDescriptor(type, length);
00433:
00434: throw StandardException.newException(
00435: SQLState.LANG_DB2_LENGTH_PRECISION_SCALE_VIOLATION,
00436: charDTD.getSQLstring());
00437: }
00438: }
00439:
00440: // Get the current ContextManager
00441: private final ContextManager getContextManager() {
00442: return cm;
00443: }
00444:
00445: /*
00446: ** Compress 2 adjacent (single or double) quotes into a single (s or d) quote when
00447: ** found in the middle of a String.
00448: ** NOTE: """" or '''' will be compressed into "" or ''.
00449: ** This function assumes that the leading and trailing quote from a
00450: ** string or delimited identifier have already been removed.
00451: */
00452: private static String compressQuotes(String source, String quotes) {
00453: String result = source;
00454: int index;
00455:
00456: /* Find the first occurrence of adjacent quotes. */
00457: index = result.indexOf(quotes);
00458:
00459: /* Replace each occurrence with a single quote and begin the
00460: * search for the next occurrence from where we left off.
00461: */
00462: while (index != -1) {
00463: result = result.substring(0, index + 1)
00464: + result.substring(index + 2);
00465:
00466: index = result.indexOf(quotes, index + 1);
00467: }
00468:
00469: return result;
00470: }
00471:
00472: private static void verifyImageLength(String image)
00473: throws StandardException {
00474: // beetle 2758. For right now throw an error for literals > 64K
00475: if (image.length() > MAX_UTF8_LENGTH) {
00476: throw StandardException
00477: .newException(SQLState.LANG_INVALID_LITERAL_LENGTH);
00478: }
00479: }
00480:
00481: /*
00482: ** Converts a delimited id to a canonical form.
00483: ** Post process delimited identifiers to eliminate leading and
00484: ** trailing " and convert all occurrences of "" to ".
00485: */
00486: private static String normalizeDelimitedID(String str) {
00487: str = compressQuotes(str, DOUBLEQUOTES);
00488: return str;
00489: }
00490:
00491: private static boolean isDATETIME(int val) {
00492: if (val == DATE || val == TIME || val == TIMESTAMP)
00493: return true;
00494: else
00495: return false;
00496: }
00497:
00498: /*
00499: * Generate a multiplicative operator node, if necessary.
00500: *
00501: * If there are two operands, generate the multiplicative operator
00502: * that corresponds to the multiplicativeOperator parameter. If there
00503: * is no left operand, just return the right operand.
00504: *
00505: * @param leftOperand The left operand, null if no operator
00506: * @param rightOperand The right operand
00507: * @param multiplicativeOperator An identifier from BinaryOperatorNode
00508: * telling what operator to generate.
00509: *
00510: * @return The multiplicative operator, or the right operand if there is
00511: * no operator.
00512: *
00513: * @exception StandardException Thrown on error
00514: */
00515:
00516: ValueNode multOp(ValueNode leftOperand, ValueNode rightOperand,
00517: int multiplicativeOperator) throws StandardException {
00518: if (leftOperand == null) {
00519: return rightOperand;
00520: }
00521:
00522: switch (multiplicativeOperator) {
00523: case BinaryOperatorNode.TIMES:
00524: return (ValueNode) nodeFactory.getNode(
00525: C_NodeTypes.BINARY_TIMES_OPERATOR_NODE,
00526: leftOperand, rightOperand, getContextManager());
00527:
00528: case BinaryOperatorNode.DIVIDE:
00529: return (ValueNode) nodeFactory.getNode(
00530: C_NodeTypes.BINARY_DIVIDE_OPERATOR_NODE,
00531: leftOperand, rightOperand, getContextManager());
00532: case BinaryOperatorNode.CONCATENATE:
00533: return (ValueNode) nodeFactory.getNode(
00534: C_NodeTypes.CONCATENATION_OPERATOR_NODE,
00535: leftOperand, rightOperand, getContextManager());
00536:
00537: default:
00538: if (SanityManager.DEBUG)
00539: SanityManager
00540: .THROWASSERT("Unexpected multiplicative operator "
00541: + multiplicativeOperator);
00542: return null;
00543: }
00544: }
00545:
00546: /**
00547: * Set up and like the parameters to the descriptors.
00548: * Set all the ParameterNodes to point to the array of
00549: * parameter descriptors.
00550: *
00551: * @exception StandardException
00552: */
00553: private void setUpAndLinkParameters() throws StandardException {
00554: CompilerContext cc = getCompilerContext();
00555: cc.setParameterList(parameterList);
00556: /* Link the untyped parameters to the array of parameter descriptors */
00557:
00558: DataTypeDescriptor[] descriptors = cc.getParameterTypes();
00559:
00560: ParameterNode newNode;
00561: ParameterNode oldNode;
00562: int paramCount;
00563:
00564: /*
00565: ** Iterate through the list of untyped parameter nodes, set each one
00566: ** to point to the array of parameter descriptors.
00567: */
00568: paramCount = -1;
00569: int plSize = parameterList.size();
00570: for (int index = 0; index < plSize; index++) {
00571: paramCount++;
00572:
00573: newNode = (ParameterNode) parameterList.elementAt(index);
00574: newNode.setDescriptors(descriptors);
00575: }
00576: }
00577:
00578: /**
00579: * Initializes the list of unnamed parameters, i.e., "?" parameters
00580: *
00581: * Usually, this routine just gets an empty list for the unnamed parameters.
00582: *
00583: *
00584: */
00585: void initUnnamedParameterList() {
00586: parameterList = new Vector();
00587: }
00588:
00589: /**
00590: * Makes a new unnamed ParameterNode and chains it onto parameterList.
00591: *
00592: * @return new unnamed parameter.
00593: *
00594: * @exception StandardException
00595: */
00596: ParameterNode makeParameterNode() throws StandardException {
00597: ParameterNode parm;
00598: DataValueDescriptor sdv = null;
00599:
00600: if ((paramDefaults != null)
00601: && (parameterNumber < paramDefaults.length)) {
00602: sdv = (DataValueDescriptor) paramDefaults[parameterNumber];
00603: }
00604:
00605: parm = (ParameterNode) nodeFactory.getNode(
00606: C_NodeTypes.PARAMETER_NODE, ReuseFactory
00607: .getInteger(parameterNumber), sdv,
00608: getContextManager());
00609:
00610: parameterNumber++;
00611: parameterList.addElement(parm);
00612:
00613: return parm;
00614: }
00615:
00616: /**
00617: * Looks up an unnamed parameter given its parameter number.
00618: *
00619: * @param paramNumber Number of parameter in unnamed
00620: * parameter list.
00621: *
00622: * @return corresponding unnamed parameter.
00623: *
00624: */
00625: ParameterNode lookupUnnamedParameter(int paramNumber) {
00626: ParameterNode unnamedParameter;
00627:
00628: unnamedParameter = (ParameterNode) parameterList
00629: .elementAt(paramNumber);
00630: return unnamedParameter;
00631: }
00632:
00633: /**
00634: * Translate a String containing a number into the appropriate type
00635: * of Numeric node.
00636: *
00637: * @exception StandardException Thrown on error
00638: */
00639: ValueNode getNumericNode(String num) throws StandardException {
00640: ContextManager cm = getContextManager();
00641:
00642: // first, see if it might be an integer
00643: try {
00644: return (ValueNode) nodeFactory
00645: .getNode(C_NodeTypes.INT_CONSTANT_NODE,
00646: new Integer(num), cm);
00647: } catch (NumberFormatException nfe) {
00648: // we catch because we want to continue on below
00649: }
00650:
00651: // next, see if it might be a long
00652: try {
00653: return (ValueNode) nodeFactory.getNode(
00654: C_NodeTypes.LONGINT_CONSTANT_NODE, new Long(num),
00655: cm);
00656: } catch (NumberFormatException nfe) {
00657: // we catch because we want to continue on below
00658: }
00659:
00660: return (ValueNode) nodeFactory.getNode(
00661: C_NodeTypes.DECIMAL_CONSTANT_NODE, num, cm);
00662: }
00663:
00664: /**
00665: * Determine whether the current token represents one of
00666: * the built-in aliases.
00667: *
00668: * @return TRUE iff the current token names a built-in alias
00669: */
00670: private boolean isBuiltInAlias() {
00671: boolean retval = false;
00672:
00673: switch (token.kind) {
00674: case UCASE:
00675: case LCASE:
00676: case SQRT:
00677: case LOCATE:
00678: case ABS:
00679: case ABSVAL:
00680: case SUBSTR:
00681: case MOD:
00682: retval = true;
00683: break;
00684:
00685: default:
00686: retval = false;
00687: break;
00688: }
00689:
00690: return retval;
00691: }
00692:
00693: /**
00694: * Determine whether the next sequence of tokens represents one of
00695: * the common (built-in) datatypes.
00696: *
00697: * @return TRUE iff the next set of tokens names a common datatype
00698: */
00699: boolean commonDatatypeName(boolean checkFollowingToken) {
00700: boolean retval = false;
00701:
00702: switch (getToken(1).kind) {
00703: case CHARACTER:
00704: case CHAR:
00705: case VARCHAR:
00706: case NVARCHAR:
00707: case NCHAR:
00708: case BIT:
00709: case NUMERIC:
00710: case DECIMAL:
00711: case DEC:
00712: case INTEGER:
00713: case INT:
00714: case SMALLINT:
00715: case LONGINT:
00716: case FLOAT:
00717: case REAL:
00718: case DATE:
00719: case TIME:
00720: case TIMESTAMP:
00721: case BOOLEAN:
00722: case DOUBLE:
00723: case BLOB:
00724: case CLOB:
00725: case NCLOB:
00726: case BINARY: // LARGE OBJECT
00727: case XML:
00728: retval = true;
00729: break;
00730:
00731: case LONG:
00732: if (checkFollowingToken == true) {
00733: switch (getToken(2).kind) {
00734: case VARCHAR:
00735: case NVARCHAR:
00736: case BINARY:
00737: case VARBINARY:
00738: case BIT:
00739: retval = true;
00740: break;
00741: }
00742: break;
00743: } else {
00744: retval = true;
00745: break;
00746: }
00747:
00748: case NATIONAL:
00749: if (checkFollowingToken == true) {
00750: switch (getToken(2).kind) {
00751: case CHAR:
00752: case CHARACTER:
00753: retval = true;
00754: break;
00755: }
00756: break;
00757: } else {
00758: retval = true;
00759: break;
00760: }
00761: }
00762:
00763: return retval;
00764: }
00765:
00766: /**
00767: * Get a DELETE node given the pieces.
00768: *
00769: *
00770: * @exception StandardException
00771: */
00772: private QueryTreeNode getDeleteNode(FromTable fromTable,
00773: TableName tableName, ValueNode whereClause)
00774: throws StandardException {
00775: FromList fromList = (FromList) nodeFactory.getNode(
00776: C_NodeTypes.FROM_LIST, getContextManager());
00777: QueryTreeNode retval;
00778: SelectNode resultSet;
00779:
00780: fromList.addFromTable(fromTable);
00781:
00782: resultSet = (SelectNode) nodeFactory.getNode(
00783: C_NodeTypes.SELECT_NODE, null, null, /* AGGREGATE list */
00784: fromList, /* FROM list */
00785: whereClause, /* WHERE clause */
00786: null, /* GROUP BY list */
00787: getContextManager());
00788:
00789: retval = (QueryTreeNode) nodeFactory.getNode(
00790: C_NodeTypes.DELETE_NODE, tableName, resultSet,
00791: getContextManager());
00792:
00793: setUpAndLinkParameters();
00794:
00795: return retval;
00796: }
00797:
00798: /**
00799: * Get an UPDATE node given the pieces.
00800: *
00801: *
00802: * @exception StandardException
00803: */
00804: private QueryTreeNode getUpdateNode(FromTable fromTable,
00805: TableName tableName, ResultColumnList setClause,
00806: ValueNode whereClause) throws StandardException {
00807: FromList fromList = (FromList) nodeFactory.getNode(
00808: C_NodeTypes.FROM_LIST, getContextManager());
00809: QueryTreeNode retval;
00810: SelectNode resultSet;
00811:
00812: fromList.addFromTable(fromTable);
00813:
00814: resultSet = (SelectNode) nodeFactory.getNode(
00815: C_NodeTypes.SELECT_NODE, setClause, null, /* AGGREGATE list */
00816: fromList, /* FROM list */
00817: whereClause, /* WHERE clause */
00818: null, /* GROUP BY list */
00819: getContextManager());
00820:
00821: retval = (QueryTreeNode) nodeFactory.getNode(
00822: C_NodeTypes.UPDATE_NODE, tableName, resultSet,
00823: getContextManager());
00824:
00825: setUpAndLinkParameters();
00826:
00827: return retval;
00828: }
00829:
00830: /**
00831: * Determine whether the next sequence of tokens can be the beginning
00832: * of a remainingPredicate() rule.
00833: *
00834: * @return TRUE iff the next set of tokens is the beginning of a
00835: * remainingPredicate()
00836: */
00837: private boolean remainingPredicateFollows() {
00838: boolean retval = false;
00839:
00840: switch (getToken(1).kind) {
00841: case EQUALS_OPERATOR:
00842: case NOT_EQUALS_OPERATOR:
00843: case NOT_EQUALS_OPERATOR2: // !=
00844: case LESS_THAN_OPERATOR:
00845: case GREATER_THAN_OPERATOR:
00846: case LESS_THAN_OR_EQUALS_OPERATOR:
00847: case GREATER_THAN_OR_EQUALS_OPERATOR:
00848: case IN:
00849: case LIKE:
00850: case BETWEEN:
00851: retval = true;
00852: break;
00853:
00854: case NOT:
00855: switch (getToken(2).kind) {
00856: case IN:
00857: case LIKE:
00858: case BETWEEN:
00859: retval = true;
00860: }
00861: break;
00862: }
00863:
00864: return retval;
00865: }
00866:
00867: /**
00868: * Determine whether the next token is a DROP
00869: *
00870: * @return TRUE iff the next token is DROP
00871: */
00872: private boolean dropFollows() {
00873: if (getToken(1).kind == DROP) {
00874: return true;
00875: } else {
00876: return false;
00877: }
00878: }
00879:
00880: /**
00881: * Determine whether the next sequence of tokens can be the beginning
00882: * of a escapedValueFunction().
00883: *
00884: * We check only for the punctuation here, because identifiers are
00885: * very hard to check for in semantic lookahead.
00886: *
00887: * @return TRUE iff the next set of tokens is the beginning of a
00888: * escapedValueFunction()
00889: */
00890: private boolean escapedValueFunctionFollows() {
00891: if (getToken(1).kind != LEFT_BRACE) {
00892: return false;
00893: }
00894:
00895: return getToken(2).kind == FN;
00896: }
00897:
00898: /**
00899: List of JDBC escape functions that map directly onto
00900: a function in the SYSFUN schema.
00901: */
00902: private static final String[] ESCAPED_SYSFUN_FUNCTIONS = { "ACOS",
00903: "ASIN", "ATAN", "COS", "SIN", "TAN", "PI", "DEGREES",
00904: "RADIANS", "EXP", "LOG", "LOG10", "CEILING", "FLOOR" };
00905:
00906: /**
00907: Convert a JDBC escaped function name to a function
00908: name in the SYSFUC schema. Returns null if no such
00909: function exists.
00910: */
00911: private String getEscapedSYSFUN(String name) {
00912: name = StringUtil.SQLToUpperCase(name);
00913:
00914: for (int i = 0; i < ESCAPED_SYSFUN_FUNCTIONS.length; i++) {
00915: if (ESCAPED_SYSFUN_FUNCTIONS[i].equals(name))
00916: return name;
00917: }
00918: return null;
00919: }
00920:
00921: /**
00922: * Determine whether the next sequence of tokens can be the beginning
00923: * of a columnInvocation() rule. columnInvocations start with
00924: * [ [ id . ] id . ] id . id (
00925: *
00926: * We check only for the punctuation here, because identifiers are
00927: * very hard to check for in semantic lookahead.
00928: *
00929: * @return TRUE iff the next set of tokens is the beginning of a
00930: * columnInvocation()
00931: */
00932: private boolean columnMethodInvocationFollows() {
00933: int tokKind;
00934:
00935: // First token must not be a built-in function name that can be
00936: // followed immediately by a PERIOD. There are only a few of
00937: // these - most built-in functions have a LEFT_PAREN following
00938: // the function name.
00939:
00940: // if we run out of token, it's probably a syntax error,
00941: // in fact
00942: tokKind = getToken(1).kind;
00943: if (tokKind == EOF) {
00944: return false;
00945: }
00946:
00947: // disambiguate from named parameter reference
00948: if (getToken(1).image.charAt(0) == '?') {
00949: return false;
00950: }
00951:
00952: if (tokKind == CURRENT_DATE || tokKind == CURRENT_TIME
00953: || tokKind == CURRENT_TIMESTAMP || tokKind == CURRENT
00954: && (isDATETIME(getToken(2).kind))) {
00955: return false;
00956: }
00957:
00958: // Second token must be a PERIOD
00959: if (getToken(2).kind != PERIOD) {
00960: return false;
00961: }
00962:
00963: // We have established that we start with " id . "
00964: tokKind = getToken(4).kind;
00965: if (tokKind == LEFT_PAREN) {
00966: // id.id(
00967: return true;
00968: }
00969:
00970: // Not id.id(, so 4th token must be PERIOD
00971: if (tokKind != PERIOD) {
00972: return false;
00973: }
00974:
00975: tokKind = getToken(6).kind;
00976: if (tokKind == LEFT_PAREN) {
00977: // id.id.id(
00978: return true;
00979: }
00980:
00981: // Not id.id.id(, so 6th token must be PERIOD
00982: if (tokKind != PERIOD) {
00983: return false;
00984: }
00985:
00986: tokKind = getToken(8).kind;
00987: if (tokKind == LEFT_PAREN) {
00988: // id.id.id.id(
00989: return true;
00990: }
00991:
00992: return false;
00993: }
00994:
00995: /**
00996: * Determine whether the next sequence of tokens can be the beginning
00997: * of an aggregateNode()() rule. aggregateNodes() start with one
00998: * of the built-in aggregate names, or with an identifier followed
00999: * by "( DISTINCT". A non-distinct user-defined aggregate invocation
01000: * is treated as a staticMethodInvocationAlias() by the parser,
01001: * and the binding phase figures out what it really is by looking
01002: * at the data dictionary.
01003: *
01004: * We check only for the punctuation here, because identifiers are
01005: * very hard to check for in semantic lookahead.
01006: *
01007: * @return TRUE iff the next set of tokens is the beginning of a
01008: * aggregateNode()
01009: */
01010: private boolean aggregateFollows() {
01011: boolean retval = false;
01012:
01013: switch (getToken(1).kind) {
01014: case MAX:
01015: case AVG:
01016: case MIN:
01017: case SUM:
01018: // This is a built-in aggregate
01019: retval = true;
01020: break;
01021:
01022: case COUNT:
01023: // COUNT is not a reserved word
01024: // This may eclipse use of COUNT as a function or a procedure that is probably what we want
01025: if (getToken(2).kind == LEFT_PAREN)
01026: retval = true;
01027: default:
01028: // Not a built-in aggregate - assume the first token is an
01029: // identifier, and see whether it is followed by " ( DISTINCT "
01030: if (getToken(2).kind == LEFT_PAREN
01031: && getToken(3).kind == DISTINCT)
01032: retval = true;
01033: break;
01034: }
01035:
01036: return retval;
01037: }
01038:
01039: /**
01040: * Determine whether the next sequence of tokens can be the beginning
01041: * of a miscBuiltins().
01042: *
01043: * We check only for the punctuation here, because identifiers are
01044: * very hard to check for in semantic lookahead.
01045: *
01046: * @return TRUE iff the next set of tokens is the beginning of a
01047: * aggregateNode()
01048: */
01049: private boolean miscBuiltinFollows() {
01050: boolean retval = false;
01051: int tokKind = getToken(1).kind;
01052:
01053: if (getToken(0).kind == CALL)
01054: retval = true;
01055:
01056: switch (tokKind) {
01057: case GET_CURRENT_CONNECTION:
01058: case CURRENT_DATE:
01059: case CURRENT_TIME:
01060: case CURRENT_TIMESTAMP:
01061: retval = true;
01062: break;
01063:
01064: case CURRENT:
01065: if (isDATETIME(getToken(2).kind))
01066: retval = true;
01067: break;
01068:
01069: case CAST:
01070: case LEFT_PAREN:
01071: retval = false;
01072: break;
01073:
01074: default:
01075: if (getToken(2).kind == LEFT_PAREN)
01076: retval = true;
01077: break;
01078: }
01079:
01080: return retval;
01081: }
01082:
01083: /**
01084: * Determine whether the next sequence of tokens can be the beginning
01085: * of a subquery. A subquery can begin with an arbitrary number of
01086: * left parentheses, followed by either SELECT or VALUES.
01087: *
01088: * @return TRUE iff the next set of tokens is the beginning of a
01089: * subquery.
01090: */
01091: private boolean subqueryFollows() {
01092: int tokKind;
01093: boolean retval = false;
01094:
01095: for (int i = 1; true; i++) {
01096: tokKind = getToken(i).kind;
01097: if (tokKind == LEFT_PAREN) {
01098: // A subquery can start with an arbitrary number of left
01099: // parentheses.
01100: continue;
01101: } else if (tokKind == SELECT || tokKind == VALUES) {
01102: // If the first token we find after all the left parentheses
01103: // is SELECT or VALUES, it's a subquery.
01104: retval = true;
01105: break;
01106: } else {
01107: // If the first token we find after all the left parentheses
01108: // is neither SELECT nor VALUES, it's not a subquery.
01109: break;
01110: }
01111: }
01112:
01113: return retval;
01114: }
01115:
01116: /**
01117: * Determine whether the next sequence of tokens can be the beginning
01118: * of a rowValueConstructorList. A rowValueConstructorList is a comma-
01119: * separated list of expressions enclosed in parentheses. This presents
01120: * special problems, because an expression be nested within an
01121: * arbitrary number of parentheses. To determine whether a left
01122: * parenthesis introduces a rowValueConstructorList or an expression,
01123: * we need to find the closing parenthesis, and determine whether
01124: * the next token is a comma.
01125: *
01126: * For example, the following is a rowValueConstructorList:
01127: *
01128: * (((1)), 2)
01129: *
01130: * and the following is just an expression:
01131: *
01132: * (((1)))
01133: *
01134: * @return TRUE iff the next set of tokens is the beginning of a
01135: * subquery.
01136: */
01137: private boolean rowValueConstructorListFollows() {
01138: int nesting;
01139: boolean retval = false;
01140:
01141: // A rowValueConstructorList starts with a left parenthesis
01142: if (getToken(1).kind == LEFT_PAREN) {
01143: // Keep track of the nesting of parens while looking ahead
01144: nesting = 1;
01145: for (int i = 2; true; i++) {
01146: int tokKind = getToken(i).kind;
01147:
01148: // Special case for NULL/DEFAULT because they are not allowed in
01149: // a parenthesized expression, so (null)/(default) must be seen
01150: // as a rowValueConstructorList with one element.
01151: if (i == 2 && (tokKind == NULL || tokKind == _DEFAULT)) {
01152: retval = true;
01153: break;
01154: }
01155:
01156: // There must be a COMMA at nesting level 1 (i.e. outside of
01157: // the first expression) for it to be a rowValueConstructorList
01158: if (nesting == 1 && tokKind == COMMA) {
01159: retval = true;
01160: break;
01161: }
01162:
01163: // If we run out of tokens before finding the last closing
01164: // parenthesis, it's not a rowValueConstructorList (it's
01165: // probably a syntax error, in fact)
01166: if (tokKind == EOF) {
01167: break;
01168: }
01169:
01170: // Increase the nesting for each (, and decrease it for each )
01171: if (tokKind == LEFT_PAREN) {
01172: nesting++;
01173: } else if (tokKind == RIGHT_PAREN) {
01174: nesting--;
01175: }
01176:
01177: // Don't look any farther than the last closing parenthesis
01178: if (nesting == 0) {
01179: break;
01180: }
01181: }
01182: }
01183:
01184: return retval;
01185: }
01186:
01187: /**
01188: * Determine whether the next token is the beginning of a propertyList().
01189: * A properties list is the comment "--derby-properties" followed by a
01190: * dot-separated list, followed by an =, followed by a value all on that
01191: * comment line. This means that the comment should start with the word
01192: * "derby-properties".
01193: *
01194: * @return TRUE iff the next token is derby-properties
01195: */
01196: private boolean derbyPropertiesListFollows() {
01197: return getToken(1).kind == DERBYDASHPROPERTIES;
01198: }
01199:
01200: /**
01201: * Determine whether the next sequence of tokens can be the beginning
01202: * of a newInvocation(). A newInvocation() begins with the word "new"
01203: * followed by a dot-separated list of identifiers, followed
01204: * by a left parenthesis.
01205: *
01206: * @param startToken Token to look for new at
01207: *
01208: * @return TRUE iff the next set of tokens is the beginning of a
01209: * newInvocation().
01210: */
01211: private boolean newInvocationFollows(int startToken) {
01212: boolean retval = false;
01213:
01214: // newInvocation() starts with the word "new"
01215: if (getToken(startToken).kind == NEW) {
01216: // Look at every other token. Ignore the identifiers, because
01217: // they are hard to test for.
01218: for (int i = 2 + startToken; true; i += 2) {
01219: int tokKind = getToken(i).kind;
01220:
01221: // If we find a left parenthesis without any intervening
01222: // cruft, we have found a newInvocation()
01223: if (tokKind == LEFT_PAREN) {
01224: retval = true;
01225: break;
01226: } else if (tokKind != PERIOD) {
01227: // Anything other than a PERIOD is "cruft"
01228: break;
01229: }
01230: }
01231: }
01232:
01233: return retval;
01234: }
01235:
01236: /**
01237: * Determine whether the next sequence of tokens is a class name
01238: *
01239: * @return TRUE iff the next set of tokens is the java class name
01240: */
01241: boolean javaClassFollows() {
01242: boolean retval = false;
01243:
01244: // Look at every other token. Ignore the identifiers, because
01245: // they are hard to test for.
01246: for (int i = 2; true; i += 2) {
01247: int tokKind = getToken(i).kind;
01248:
01249: // If we find a '::' without any intervening
01250: // cruft, we have found a javaClass
01251: if (tokKind == DOUBLE_COLON) {
01252: retval = true;
01253: break;
01254: } else if (tokKind != PERIOD) {
01255: // Anything other than a PERIOD is "cruft"
01256: break;
01257: }
01258: }
01259:
01260: return retval;
01261: }
01262:
01263: /**
01264: * Determine whether the next sequence of tokens can be the beginning
01265: * of a FROM newInvocation(). A FROM newInvocation() begins with the words "from new"
01266: * followed by a dot-separated list of identifiers, followed
01267: * by a left parenthesis.
01268: *
01269: * @return TRUE iff the next set of tokens is the beginning of a
01270: * FROM newInvocation().
01271: */
01272: private boolean fromNewInvocationFollows() {
01273: boolean retval = false;
01274:
01275: // FROM newInvocation() starts with the words "from new"
01276: return (getToken(1).kind == FROM && newInvocationFollows(2));
01277: }
01278:
01279: /**
01280: * Determine whether the next sequence of tokens can be the beginning
01281: * of a joinedTableExpression(). A joinedTableExpression() begins
01282: * with one of:
01283: *
01284: * JOIN
01285: * INNER JOIN
01286: * LEFT OUTER JOIN
01287: * RIGHT OUTER JOIN
01288: *
01289: * @return TRUE iff the next set of tokens is the beginning of a
01290: * joinedTableExpression().
01291: */
01292: private boolean joinedTableExpressionFollows() {
01293: boolean retval = false;
01294:
01295: int tokKind1 = getToken(1).kind;
01296: int tokKind2 = getToken(2).kind;
01297:
01298: if (tokKind1 == JOIN) {
01299: retval = true;
01300: } else if (tokKind1 == INNER && tokKind2 == JOIN) {
01301: retval = true;
01302: } else if ((tokKind1 == LEFT || tokKind1 == RIGHT)
01303: && tokKind2 == OUTER) {
01304: if (getToken(3).kind == JOIN) {
01305: retval = true;
01306: }
01307: } else if ((tokKind1 == LEFT || tokKind1 == RIGHT)
01308: && tokKind2 == JOIN) {
01309: retval = true;
01310: }
01311:
01312: return retval;
01313: }
01314:
01315: /**
01316: * Translate a token for the name of a built-in aggregate to a String
01317: * containing an aggregate name.
01318: */
01319: private static String aggName(Token token) {
01320: String retval = null;
01321:
01322: switch (token.kind) {
01323: case MAX:
01324: retval = "MAX";
01325: break;
01326:
01327: case AVG:
01328: retval = "AVG";
01329: break;
01330:
01331: case MIN:
01332: retval = "MIN";
01333: break;
01334:
01335: case SUM:
01336: retval = "SUM";
01337: break;
01338:
01339: case COUNT:
01340: retval = "COUNT";
01341: break;
01342:
01343: default:
01344: if (SanityManager.DEBUG) {
01345: SanityManager
01346: .THROWASSERT("Unexpected token type in aggName: "
01347: + token.kind);
01348: }
01349: break;
01350: }
01351:
01352: return retval;
01353: }
01354:
01355: /**
01356: * Translate a token for the name of a built-in aggregate to an
01357: * aggregate definition class.
01358: */
01359: private static Class aggClass(Token token) {
01360: Class retval = null;
01361:
01362: switch (token.kind) {
01363: case MAX:
01364: case MIN:
01365: retval = MaxMinAggregateDefinition.class;
01366: break;
01367:
01368: case AVG:
01369: case SUM:
01370: retval = SumAvgAggregateDefinition.class;
01371: break;
01372:
01373: case COUNT:
01374: retval = CountAggregateDefinition.class;
01375: break;
01376:
01377: default:
01378: if (SanityManager.DEBUG) {
01379: SanityManager
01380: .THROWASSERT("Unexpected token type in aggClass: "
01381: + token.kind);
01382: }
01383: break;
01384: }
01385:
01386: return retval;
01387: }
01388:
01389: /**
01390: * Determine whether the next sequence of tokens can be the beginning
01391: * of another element in a PROPERTY list. These elements are of the
01392: * form:
01393: *
01394: * COMMA dot.separated.list = ...
01395: *
01396: * Look for the COMMA, the dots in the dot-separated list, and the =
01397: *
01398: * @return TRUE iff the next set of tokens is the beginning of a
01399: * another element in a PROPERTY list.
01400: */
01401: private boolean anotherPropertyFollows() {
01402: boolean retval = false;
01403:
01404: // Element must start with COMMA
01405: if (getToken(1).kind == COMMA) {
01406: // Rest of element is dot-separated list with = at end
01407: int i = 3;
01408: int tokKind;
01409: do {
01410: tokKind = getToken(i).kind;
01411:
01412: // If we've found nothing but PERIODs until the EQUALS_OPERATOR
01413: // it is the beginning of another property list element.
01414: if (tokKind == EQUALS_OPERATOR) {
01415: retval = true;
01416: break;
01417: }
01418:
01419: i += 2;
01420: } while (tokKind == PERIOD);
01421: }
01422:
01423: return retval;
01424: }
01425:
01426: /**
01427: * Get one of the several types of create alias nodes.
01428: *
01429: * @param aliasName The name of the alias
01430: * @param fullStaticMethodName The full path/method name
01431: * @param aliasSpecificInfo Information specific to the type of alias being created.
01432: * @param aliasType The type of alias to create
01433: * @param delimitedIdentifier Whether or not to treat the class name
01434: * as a delimited identifier if trying to
01435: * resolve it as a class alias.
01436: *
01437: * @return A CreateAliasNode matching the given parameters
01438: *
01439: * @exception StandardException Thrown on error
01440: */
01441: QueryTreeNode getCreateAliasNode(Object aliasName,
01442: String fullStaticMethodName, Object aliasSpecificInfo,
01443: char aliasType, Boolean delimitedIdentifier)
01444: throws StandardException {
01445:
01446: StatementNode aliasNode = (StatementNode) getNodeFactory()
01447: .getCreateAliasNode(aliasName, fullStaticMethodName,
01448: aliasSpecificInfo, aliasType,
01449: delimitedIdentifier, getContextManager());
01450:
01451: return aliasNode;
01452: }
01453:
01454: /**
01455: Create a node for the drop alias/procedure call.
01456: */
01457: QueryTreeNode dropAliasNode(Object aliasName, char type)
01458: throws StandardException {
01459:
01460: StatementNode stmt = (StatementNode) nodeFactory.getNode(
01461: C_NodeTypes.DROP_ALIAS_NODE, aliasName, new Character(
01462: type), getContextManager());
01463:
01464: return stmt;
01465: }
01466:
01467: /**
01468: * Get a substring node from
01469: * - the string
01470: * - the start position
01471: * - the length
01472: * - a boolean values for specifying the kind of substring function
01473: * @exception StandardException Thrown on error
01474: */
01475: ValueNode getSubstringNode(ValueNode stringValue,
01476: ValueNode startPosition, ValueNode length, Boolean boolVal)
01477: throws StandardException {
01478: return (ValueNode) nodeFactory.getNode(
01479: C_NodeTypes.SUBSTRING_OPERATOR_NODE, stringValue,
01480: startPosition, length, ReuseFactory
01481: .getInteger(TernaryOperatorNode.SUBSTRING),
01482: null, getContextManager());
01483: }
01484:
01485: final public TableName qualifiedName(int id_length_limit)
01486: throws ParseException, StandardException {
01487: return qualifiedName(C_NodeTypes.TABLE_NAME, id_length_limit);
01488: }
01489:
01490: private void initStatement(String statementSQLText,
01491: Object[] paramDefaults) throws StandardException {
01492: /* Do per-statement initialization here */
01493: parameterNumber = 0;
01494: this .statementSQLText = statementSQLText;
01495: this .paramDefaults = paramDefaults;
01496: nodeFactory = getNodeFactory();
01497: initUnnamedParameterList();
01498: } // End of initStatement
01499:
01500: private void checkIdentifierLengthLimit(String identifier,
01501: int identifier_length_limit) throws StandardException {
01502: if (identifier.length() > identifier_length_limit)
01503: throw StandardException.newException(
01504: SQLState.LANG_IDENTIFIER_TOO_LONG, identifier,
01505: String.valueOf(identifier_length_limit));
01506: }
01507:
01508: private ValueNode getJdbcIntervalNode(int intervalType)
01509: throws StandardException {
01510: return (ValueNode) nodeFactory.getNode(
01511: C_NodeTypes.INT_CONSTANT_NODE, ReuseFactory
01512: .getInteger(intervalType), getContextManager());
01513: }
01514:
01515: private void checkAuthorizationLength(String authorization)
01516: throws StandardException {
01517: checkIdentifierLengthLimit(authorization,
01518: Limits.DB2_MAX_USERID_LENGTH);
01519: }
01520:
01521: /**
01522: Check to see if the required claues have been added
01523: to a procedure or function defintion.
01524:
01525: @param required int array of require clauses
01526: @param clauses the array of declared clauses.
01527: */
01528: void checkRequiredRoutineClause(int[] required, Object[] clauses)
01529: throws StandardException {
01530: for (int i = 0; i < required.length; i++) {
01531: int re = required[i];
01532: if (clauses[re] == null) {
01533: throw StandardException.newException(
01534: SQLState.LANG_SYNTAX_ERROR,
01535: ROUTINE_CLAUSE_NAMES[re]);
01536: }
01537: }
01538: }
01539:
01540: /*
01541: * <A NAME="Statement">Statement</A>
01542: */
01543: final public QueryTreeNode Statement(String statementSQLText,
01544: Object[] paramDefaults) throws ParseException,
01545: StandardException {
01546: QueryTreeNode statementNode;
01547:
01548: initStatement(statementSQLText, paramDefaults);
01549: statementNode = StatementPart(null);
01550: jj_consume_token(0);
01551: {
01552: if (true)
01553: return statementNode;
01554: }
01555: throw new Error("Missing return statement in function");
01556: }
01557:
01558: final public QueryTreeNode proceduralStatement(Token[] tokenHolder)
01559: throws ParseException, StandardException {
01560: QueryTreeNode statementNode;
01561: tokenHolder[0] = getToken(1);
01562: switch (jj_nt.kind) {
01563: case INSERT:
01564: statementNode = insertStatement();
01565: break;
01566: case UPDATE:
01567: statementNode = preparableUpdateStatement();
01568: break;
01569: case DELETE:
01570: statementNode = preparableDeleteStatement();
01571: break;
01572: case SELECT:
01573: case VALUES:
01574: case LEFT_PAREN:
01575: statementNode = preparableSelectStatement(true);
01576: break;
01577: case CALL:
01578: case LEFT_BRACE:
01579: case QUESTION_MARK:
01580: statementNode = callStatement();
01581: break;
01582: default:
01583: jj_la1[0] = jj_gen;
01584: jj_consume_token(-1);
01585: throw new ParseException();
01586: }
01587: {
01588: if (true)
01589: return statementNode;
01590: }
01591: throw new Error("Missing return statement in function");
01592: }
01593:
01594: /*
01595: * <A NAME="StatementPart">StatementPart</A>
01596: *
01597: * @param tokenHolder returns the token that starts
01598: * the statement. If null, ignored.
01599: */
01600: final public QueryTreeNode StatementPart(Token[] tokenHolder)
01601: throws ParseException, StandardException {
01602: QueryTreeNode statementNode;
01603: //before starting new statements, initialize this variables. Otherwise, the left
01604: //over values from previously failed sql will affect the next sql.
01605: explicitNotNull = false;
01606: explicitNull = false;
01607: explicitlyNullableColumnsList = new Vector();
01608:
01609: /*
01610: ** Grab the token preceding this production
01611: */
01612: if (tokenHolder != null) {
01613: tokenHolder[0] = getToken(1);
01614: }
01615: switch (jj_nt.kind) {
01616: case LOCK:
01617: case RENAME:
01618: switch (jj_nt.kind) {
01619: case RENAME:
01620: statementNode = spsRenameStatement();
01621: break;
01622: case LOCK:
01623: // statementNode = SQLTransactionStatement() |
01624: statementNode = lockStatement();
01625: break;
01626: default:
01627: jj_la1[1] = jj_gen;
01628: jj_consume_token(-1);
01629: throw new ParseException();
01630: }
01631: {
01632: if (true)
01633: return statementNode;
01634: }
01635: break;
01636: default:
01637: jj_la1[4] = jj_gen;
01638: if (jj_2_2(1)) {
01639: switch (jj_nt.kind) {
01640: case CREATE:
01641: statementNode = createStatements();
01642: break;
01643: case DROP:
01644: statementNode = dropStatements();
01645: break;
01646: case ALTER:
01647: statementNode = spsAlterStatement();
01648: break;
01649: case DECLARE:
01650: statementNode = globalTemporaryTableDeclaration();
01651: break;
01652: case DELETE:
01653: case INSERT:
01654: case ROLLBACK:
01655: case SELECT:
01656: case UPDATE:
01657: case VALUES:
01658: case RELEASE:
01659: case SAVEPOINT:
01660: case CALL:
01661: case LEFT_BRACE:
01662: case LEFT_PAREN:
01663: case QUESTION_MARK:
01664: statementNode = preparableSQLDataStatement();
01665: break;
01666: default:
01667: jj_la1[2] = jj_gen;
01668: if (jj_2_1(1)) {
01669: statementNode = spsSetStatement();
01670: } else {
01671: switch (jj_nt.kind) {
01672: case TRUNCATE:
01673: statementNode = truncateTableStatement();
01674: break;
01675: case GRANT:
01676: statementNode = grantStatement();
01677: break;
01678: case REVOKE:
01679: statementNode = revokeStatement();
01680: break;
01681: case EXECUTE:
01682: statementNode = execStatement();
01683: break;
01684: default:
01685: jj_la1[3] = jj_gen;
01686: jj_consume_token(-1);
01687: throw new ParseException();
01688: }
01689: }
01690: }
01691: {
01692: if (true)
01693: return statementNode;
01694: }
01695: } else {
01696: jj_consume_token(-1);
01697: throw new ParseException();
01698: }
01699: }
01700: throw new Error("Missing return statement in function");
01701: }
01702:
01703: /*
01704: * <A NAME="createStatements">spsCreateStatement</A>
01705: */
01706: final public QueryTreeNode createStatements()
01707: throws ParseException, StandardException {
01708: QueryTreeNode statementNode;
01709: Token beginToken;
01710: int tokKind;
01711: beginToken = jj_consume_token(CREATE);
01712: switch (jj_nt.kind) {
01713: case SCHEMA:
01714: case VIEW:
01715: case SYNONYM:
01716: case TRIGGER:
01717: switch (jj_nt.kind) {
01718: case SCHEMA:
01719: statementNode = schemaDefinition();
01720: break;
01721: case VIEW:
01722: statementNode = viewDefinition(beginToken);
01723: break;
01724: case TRIGGER:
01725: statementNode = triggerDefinition();
01726: break;
01727: case SYNONYM:
01728: statementNode = synonymDefinition();
01729: break;
01730: default:
01731: jj_la1[5] = jj_gen;
01732: jj_consume_token(-1);
01733: throw new ParseException();
01734: }
01735:
01736: break;
01737: case TABLE:
01738: statementNode = tableDefinition();
01739:
01740: break;
01741: case PROCEDURE:
01742: statementNode = procedureDefinition();
01743: break;
01744: case FUNCTION:
01745: statementNode = functionDefinition();
01746: break;
01747: case UNIQUE:
01748: case INDEX:
01749: statementNode = indexDefinition();
01750:
01751: break;
01752: default:
01753: jj_la1[6] = jj_gen;
01754: jj_consume_token(-1);
01755: throw new ParseException();
01756: }
01757: {
01758: if (true)
01759: return statementNode;
01760: }
01761: throw new Error("Missing return statement in function");
01762: }
01763:
01764: /*
01765: * <A NAME="dropStatements">spsDropStatement</A>
01766: */
01767: final public QueryTreeNode dropStatements() throws ParseException,
01768: StandardException {
01769: QueryTreeNode statementNode;
01770: jj_consume_token(DROP);
01771: switch (jj_nt.kind) {
01772: case SCHEMA:
01773: statementNode = dropSchemaStatement();
01774: break;
01775: case TABLE:
01776: statementNode = dropTableStatement();
01777: break;
01778: case INDEX:
01779: statementNode = dropIndexStatement();
01780: break;
01781: case FUNCTION:
01782: case PROCEDURE:
01783: case SYNONYM:
01784: statementNode = dropAliasStatement();
01785: break;
01786: case VIEW:
01787: statementNode = dropViewStatement();
01788: break;
01789: case TRIGGER:
01790: statementNode = dropTriggerStatement();
01791: break;
01792: default:
01793: jj_la1[7] = jj_gen;
01794: jj_consume_token(-1);
01795: throw new ParseException();
01796: }
01797: {
01798: if (true)
01799: return statementNode;
01800: }
01801: throw new Error("Missing return statement in function");
01802: }
01803:
01804: /*
01805: * <A NAME="spsAlterStatement">spsAlterStatement</A>
01806: */
01807: final public QueryTreeNode spsAlterStatement()
01808: throws ParseException, StandardException {
01809: QueryTreeNode statementNode;
01810: jj_consume_token(ALTER);
01811: statementNode = alterTableStatement();
01812: {
01813: if (true)
01814: return statementNode;
01815: }
01816: throw new Error("Missing return statement in function");
01817: }
01818:
01819: /*
01820: * <A NAME="spsSetStatement">spsSetStatement</A>
01821: */
01822: final public QueryTreeNode spsSetStatement() throws ParseException,
01823: StandardException {
01824: QueryTreeNode statementNode;
01825: if (getToken(1).kind == SET && getToken(2).kind != CURRENT) {
01826: jj_consume_token(SET);
01827: if (jj_2_3(1)) {
01828: statementNode = setIsolationStatement();
01829: } else if (jj_2_4(1)) {
01830: statementNode = setSchemaStatement();
01831: } else {
01832: switch (jj_nt.kind) {
01833: case MESSAGE_LOCALE:
01834: statementNode = setMessageLocaleStatement();
01835: break;
01836: default:
01837: jj_la1[8] = jj_gen;
01838: jj_consume_token(-1);
01839: throw new ParseException();
01840: }
01841: }
01842: {
01843: if (true)
01844: return statementNode;
01845: }
01846: } else if (getToken(1).kind == SET
01847: && getToken(2).kind == CURRENT) {
01848: jj_consume_token(SET);
01849: if (jj_2_5(1)) {
01850: statementNode = setSchemaStatement();
01851: } else if (jj_2_6(1)) {
01852: statementNode = setIsolationStatement();
01853: } else {
01854: jj_consume_token(-1);
01855: throw new ParseException();
01856: }
01857: {
01858: if (true)
01859: return statementNode;
01860: }
01861: } else {
01862: jj_consume_token(-1);
01863: throw new ParseException();
01864: }
01865: throw new Error("Missing return statement in function");
01866: }
01867:
01868: /*
01869: * <A NAME="preparableSQLDataStatement">preparableSQLDataStatement</A>
01870: *
01871: * preparableSQLDataStatement differs from
01872: * directSQLDataStatement in that it
01873: * supports positioned update and delete
01874: * and a preparable select (with FOR UPDATE)
01875: * instead of a direct select (without FOR UPDATE)
01876: */
01877: final public QueryTreeNode preparableSQLDataStatement()
01878: throws ParseException, StandardException {
01879: QueryTreeNode dmlStatement;
01880: switch (jj_nt.kind) {
01881: case DELETE:
01882: /*
01883: ** RESOLVE: Ignoring temporary table declarations for now.
01884: */
01885: dmlStatement = preparableDeleteStatement();
01886: {
01887: if (true)
01888: return dmlStatement;
01889: }
01890: break;
01891: case SELECT:
01892: case VALUES:
01893: case LEFT_PAREN:
01894: dmlStatement = preparableSelectStatement(true);
01895: {
01896: if (true)
01897: return dmlStatement;
01898: }
01899: break;
01900: case INSERT:
01901: dmlStatement = insertStatement();
01902: {
01903: if (true)
01904: return dmlStatement;
01905: }
01906: break;
01907: case UPDATE:
01908: dmlStatement = preparableUpdateStatement();
01909: {
01910: if (true)
01911: return dmlStatement;
01912: }
01913: break;
01914: case CALL:
01915: case LEFT_BRACE:
01916: case QUESTION_MARK:
01917: dmlStatement = callStatement();
01918: {
01919: if (true)
01920: return dmlStatement;
01921: }
01922: break;
01923: case ROLLBACK:
01924: case RELEASE:
01925: case SAVEPOINT:
01926: dmlStatement = savepointStatement();
01927: {
01928: if (true)
01929: return dmlStatement;
01930: }
01931: break;
01932: default:
01933: jj_la1[9] = jj_gen;
01934: jj_consume_token(-1);
01935: throw new ParseException();
01936: }
01937: throw new Error("Missing return statement in function");
01938: }
01939:
01940: /*
01941: * <A NAME="preparableDeleteStatement">preparableDeleteStatement</A>
01942: *
01943: * This may be a search or positioned delete statement.
01944: */
01945: final public QueryTreeNode preparableDeleteStatement()
01946: throws ParseException, StandardException {
01947: QueryTreeNode qtn;
01948: jj_consume_token(DELETE);
01949: qtn = deleteBody();
01950: {
01951: if (true)
01952: return qtn;
01953: }
01954: throw new Error("Missing return statement in function");
01955: }
01956:
01957: final public QueryTreeNode deleteBody() throws ParseException,
01958: StandardException {
01959: JavaToSQLValueNode javaToSQLNode = null;
01960: String correlationName = null;
01961: TableName tableName = null;
01962: ValueNode whereClause = null;
01963: FromTable fromTable = null;
01964: QueryTreeNode retval;
01965: Properties targetProperties = null;
01966: Token whereToken = null;
01967: if (fromNewInvocationFollows()) {
01968: jj_consume_token(FROM);
01969: javaToSQLNode = newInvocation();
01970: switch (jj_nt.kind) {
01971: case WHERE:
01972: whereToken = jj_consume_token(WHERE);
01973: whereClause = whereClause(whereToken);
01974: break;
01975: default:
01976: jj_la1[10] = jj_gen;
01977: ;
01978: }
01979: fromTable = (FromTable) nodeFactory.getNode(
01980: C_NodeTypes.FROM_VTI, javaToSQLNode
01981: .getJavaValueNode(), (String) null, null,
01982: (Properties) null, getContextManager());
01983:
01984: {
01985: if (true)
01986: return getDeleteNode(fromTable, tableName,
01987: whereClause);
01988: }
01989: } else {
01990: switch (jj_nt.kind) {
01991: case FROM:
01992: jj_consume_token(FROM);
01993: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
01994: if ((getToken(1).kind != EOF)
01995: && (getToken(1).kind != WHERE)
01996: && !derbyPropertiesListFollows()) {
01997: switch (jj_nt.kind) {
01998: case AS:
01999: jj_consume_token(AS);
02000: break;
02001: default:
02002: jj_la1[11] = jj_gen;
02003: ;
02004: }
02005: correlationName = identifier(
02006: Limits.MAX_IDENTIFIER_LENGTH, true);
02007: } else {
02008: ;
02009: }
02010: switch (jj_nt.kind) {
02011: case DERBYDASHPROPERTIES:
02012: targetProperties = propertyList(false);
02013: jj_consume_token(CHECK_PROPERTIES);
02014: break;
02015: default:
02016: jj_la1[12] = jj_gen;
02017: ;
02018: }
02019: switch (jj_nt.kind) {
02020: case WHERE:
02021: whereToken = jj_consume_token(WHERE);
02022: if ((getToken(1).kind == CURRENT)
02023: && (getToken(2).kind == OF)) {
02024: fromTable = currentOfClause(correlationName);
02025: } else if (jj_2_7(1)) {
02026: whereClause = whereClause(whereToken);
02027: } else {
02028: jj_consume_token(-1);
02029: throw new ParseException();
02030: }
02031: break;
02032: default:
02033: jj_la1[13] = jj_gen;
02034: ;
02035: }
02036: /* Fabricate a ResultSetNode (SelectNode) under the DeleteNode.
02037: * For a searched delete,
02038: * The FromList is simply the table that we are deleting from.
02039: * (NOTE - we mark the table as the one that we are deleting from.)
02040: * For a positioned delete,
02041: * the FromList is a CurrentOfNode holding the cursor name.
02042: * The select list will be null for now. We will generate it at
02043: * bind time, in keeping with the design decision that the parser's
02044: * output should look like the language.
02045: */
02046: if (fromTable == null)
02047: fromTable = (FromTable) nodeFactory.getNode(
02048: C_NodeTypes.FROM_BASE_TABLE, tableName,
02049: correlationName, ReuseFactory
02050: .getInteger(FromBaseTable.DELETE),
02051: null, getContextManager());
02052:
02053: /* Update the FromTable with any properties, if non-null */
02054: if (targetProperties != null) {
02055: if (SanityManager.DEBUG) {
02056: if (((FromBaseTable) fromTable).getProperties() != null) {
02057: SanityManager
02058: .THROWASSERT("Overwriting existing properties");
02059: }
02060: }
02061: ((FromBaseTable) fromTable)
02062: .setTableProperties(targetProperties);
02063: }
02064:
02065: {
02066: if (true)
02067: return getDeleteNode(fromTable, tableName,
02068: whereClause);
02069: }
02070: break;
02071: default:
02072: jj_la1[14] = jj_gen;
02073: jj_consume_token(-1);
02074: throw new ParseException();
02075: }
02076: }
02077: throw new Error("Missing return statement in function");
02078: }
02079:
02080: /*
02081: * <A NAME="currentOfClause">currentOfClause</A>
02082: */
02083: final public FromTable currentOfClause(String correlationName)
02084: throws ParseException, StandardException {
02085: String cursorName = null;
02086: jj_consume_token(CURRENT);
02087: jj_consume_token(OF);
02088: cursorName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
02089: {
02090: if (true)
02091: return (FromTable) nodeFactory.getNode(
02092: C_NodeTypes.CURRENT_OF_NODE, correlationName,
02093: cursorName, null, getContextManager());
02094: }
02095: throw new Error("Missing return statement in function");
02096: }
02097:
02098: /*
02099: * <A NAME="preparableSelectStatement">preparableSelectStatement</A>
02100: *
02101: *
02102: * The preparable select statement is a superset of
02103: * the directSelectStatementMultipleRows in that it
02104: * allows both the preparable single row select statement
02105: * (a query expression that returns one row, although it
02106: * is also handled like a cursor) and the preparable
02107: * multiple row select statement, which allows not only
02108: * an order by clause but also a for update clause.
02109: */
02110: final public CursorNode preparableSelectStatement(
02111: boolean checkParams) throws ParseException,
02112: StandardException {
02113: ResultSetNode queryExpression;
02114: Vector updateColumns = new Vector();
02115: int forUpdateState = CursorNode.UNSPECIFIED;
02116: int isolationLevel = ExecutionContext.UNSPECIFIED_ISOLATION_LEVEL;
02117: CursorNode retval;
02118: OrderByList orderCols = null;
02119: queryExpression = queryExpression(null, NO_SET_OP);
02120: switch (jj_nt.kind) {
02121: case ORDER:
02122: orderCols = orderByClause();
02123: break;
02124: default:
02125: jj_la1[15] = jj_gen;
02126: ;
02127: }
02128: switch (jj_nt.kind) {
02129: case FOR:
02130: jj_consume_token(FOR);
02131: forUpdateState = forUpdateClause(updateColumns);
02132: break;
02133: default:
02134: jj_la1[16] = jj_gen;
02135: ;
02136: }
02137: switch (jj_nt.kind) {
02138: case WITH:
02139: isolationLevel = atIsolationLevel();
02140: break;
02141: default:
02142: jj_la1[17] = jj_gen;
02143: ;
02144: }
02145: // Note: if order by is specified, the for update clause
02146: // must be READ ONLY or empty, and the cursor
02147: // is implicitly READ_ONLY.
02148:
02149: retval = (CursorNode) nodeFactory.getNode(
02150: C_NodeTypes.CURSOR_NODE, "SELECT", queryExpression,
02151: null, orderCols, ReuseFactory
02152: .getInteger(forUpdateState),
02153: (forUpdateState == CursorNode.READ_ONLY ? null
02154: : updateColumns), getContextManager());
02155:
02156: if (checkParams) {
02157: setUpAndLinkParameters();
02158: }
02159:
02160: /* Set the isolation levels for the scans if specified */
02161: if (isolationLevel != ExecutionContext.UNSPECIFIED_ISOLATION_LEVEL) {
02162: getCompilerContext().setScanIsolationLevel(isolationLevel);
02163: }
02164:
02165: {
02166: if (true)
02167: return retval;
02168: }
02169: throw new Error("Missing return statement in function");
02170: }
02171:
02172: /*
02173: * <A NAME="insertStatement">insertStatement</A>
02174: */
02175: final public QueryTreeNode insertStatement() throws ParseException,
02176: StandardException {
02177: QueryTreeNode insertNode;
02178: QueryTreeNode targetTable;
02179: jj_consume_token(INSERT);
02180: jj_consume_token(INTO);
02181: targetTable = targetTable();
02182: insertNode = insertColumnsAndSource(targetTable);
02183: setUpAndLinkParameters();
02184:
02185: {
02186: if (true)
02187: return insertNode;
02188: }
02189: throw new Error("Missing return statement in function");
02190: }
02191:
02192: final public QueryTreeNode targetTable() throws ParseException,
02193: StandardException {
02194: JavaToSQLValueNode javaToSQLNode = null;
02195: String correlationName = null;
02196: TableName tableName;
02197: if (newInvocationFollows(1)) {
02198: javaToSQLNode = newInvocation();
02199: {
02200: if (true)
02201: return (QueryTreeNode) nodeFactory.getNode(
02202: C_NodeTypes.FROM_VTI, javaToSQLNode
02203: .getJavaValueNode(),
02204: correlationName, null, (Properties) null,
02205: getContextManager());
02206: }
02207: } else {
02208: switch (jj_nt.kind) {
02209: case BINARY:
02210: case COALESCE:
02211: case COUNT:
02212: case D:
02213: case MODULE:
02214: case T:
02215: case TS:
02216: case VALUE:
02217: case VARBINARY:
02218: case ABS:
02219: case ABSVAL:
02220: case ACTION:
02221: case ALWAYS:
02222: case BLOB:
02223: case C:
02224: case CALLED:
02225: case CLOB:
02226: case COBOL:
02227: case COMMITTED:
02228: case CONCAT:
02229: case CONTAINS:
02230: case DATA:
02231: case DATE:
02232: case DAY:
02233: case DYNAMIC:
02234: case FORTRAN:
02235: case GENERATED:
02236: case IDENTITY_VAL_LOCAL:
02237: case INCREMENT:
02238: case INITIAL:
02239: case INTERVAL:
02240: case LANGUAGE:
02241: case LARGE:
02242: case LENGTH:
02243: case LEVEL:
02244: case LOCKS:
02245: case LOCKSIZE:
02246: case LOGGED:
02247: case MOD:
02248: case MODIFIES:
02249: case MODIFY:
02250: case MONTH:
02251: case _MORE:
02252: case MUMPS:
02253: case NAME:
02254: case NCLOB:
02255: case NULLABLE:
02256: case NUMBER:
02257: case OBJECT:
02258: case PASCAL:
02259: case PLI:
02260: case PRECISION:
02261: case RELEASE:
02262: case REPEATABLE:
02263: case RESTART:
02264: case RETURNS:
02265: case ROW:
02266: case SAVEPOINT:
02267: case SCALE:
02268: case SERIALIZABLE:
02269: case SQL_TSI_FRAC_SECOND:
02270: case SQL_TSI_SECOND:
02271: case SQL_TSI_MINUTE:
02272: case SQL_TSI_HOUR:
02273: case SQL_TSI_DAY:
02274: case SQL_TSI_WEEK:
02275: case SQL_TSI_MONTH:
02276: case SQL_TSI_QUARTER:
02277: case SQL_TSI_YEAR:
02278: case START:
02279: case STATEMENT:
02280: case SYNONYM:
02281: case THEN:
02282: case TIME:
02283: case TIMESTAMP:
02284: case TIMESTAMPADD:
02285: case TIMESTAMPDIFF:
02286: case TRUNCATE:
02287: case TYPE:
02288: case UNCOMMITTED:
02289: case USAGE:
02290: case WHEN:
02291: case CURDATE:
02292: case CURTIME:
02293: case DATABASE:
02294: case LONG:
02295: case AFTER:
02296: case BEFORE:
02297: case CLASS:
02298: case COMPRESS:
02299: case CONTENT:
02300: case CS:
02301: case DB2SQL:
02302: case DIRTY:
02303: case DOCUMENT:
02304: case EACH:
02305: case EMPTY:
02306: case EXCLUSIVE:
02307: case FN:
02308: case INDEX:
02309: case JAVA:
02310: case LCASE:
02311: case LOCATE:
02312: case LOCK:
02313: case MESSAGE_LOCALE:
02314: case METHOD:
02315: case MODE:
02316: case NEW:
02317: case NEW_TABLE:
02318: case OJ:
02319: case OFF:
02320: case OLD:
02321: case OLD_TABLE:
02322: case PARAMETER:
02323: case PASSING:
02324: case PROPERTIES:
02325: case READS:
02326: case REF:
02327: case REFERENCING:
02328: case RENAME:
02329: case RESET:
02330: case RESULT:
02331: case RETAIN:
02332: case RETURNING:
02333: case RR:
02334: case RS:
02335: case SEQUENCE:
02336: case SEQUENTIAL:
02337: case SETS:
02338: case SHARE:
02339: case SQLID:
02340: case SPECIFIC:
02341: case SQRT:
02342: case STABILITY:
02343: case STRIP:
02344: case STYLE:
02345: case TRIGGER:
02346: case UCASE:
02347: case UR:
02348: case WHITESPACE:
02349: case IDENTIFIER:
02350: case DELIMITED_IDENTIFIER:
02351: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
02352: {
02353: if (true)
02354: return (QueryTreeNode) tableName;
02355: }
02356: break;
02357: default:
02358: jj_la1[18] = jj_gen;
02359: jj_consume_token(-1);
02360: throw new ParseException();
02361: }
02362: }
02363: throw new Error("Missing return statement in function");
02364: }
02365:
02366: /*
02367: * <A NAME="preparableUpdateStatement">preparableUpdateStatement</A>
02368: */
02369: final public QueryTreeNode preparableUpdateStatement()
02370: throws ParseException, StandardException {
02371: QueryTreeNode qtn;
02372: jj_consume_token(UPDATE);
02373: qtn = updateBody();
02374: {
02375: if (true)
02376: return qtn;
02377: }
02378: throw new Error("Missing return statement in function");
02379: }
02380:
02381: final public boolean tableOrIndex() throws ParseException {
02382: switch (jj_nt.kind) {
02383: case TABLE:
02384: jj_consume_token(TABLE);
02385: {
02386: if (true)
02387: return true;
02388: }
02389: break;
02390: case INDEX:
02391: jj_consume_token(INDEX);
02392: {
02393: if (true)
02394: return false;
02395: }
02396: break;
02397: default:
02398: jj_la1[19] = jj_gen;
02399: jj_consume_token(-1);
02400: throw new ParseException();
02401: }
02402: throw new Error("Missing return statement in function");
02403: }
02404:
02405: final public QueryTreeNode updateBody() throws ParseException,
02406: StandardException {
02407: ResultColumnList columnList;
02408: String correlationName = null;
02409: JavaToSQLValueNode javaToSQLNode = null;
02410: TableName tableName = null;
02411: ValueNode whereClause = null;
02412: FromTable fromTable = null;
02413: Properties targetProperties = null;
02414: Token whereToken = null;
02415: if (newInvocationFollows(1)) {
02416: javaToSQLNode = newInvocation();
02417: jj_consume_token(SET);
02418: columnList = setClauseList();
02419: switch (jj_nt.kind) {
02420: case WHERE:
02421: whereToken = jj_consume_token(WHERE);
02422: whereClause = whereClause(whereToken);
02423: break;
02424: default:
02425: jj_la1[20] = jj_gen;
02426: ;
02427: }
02428: fromTable = (FromTable) nodeFactory.getNode(
02429: C_NodeTypes.FROM_VTI, javaToSQLNode
02430: .getJavaValueNode(), (String) null, null,
02431: (Properties) null, getContextManager());
02432:
02433: {
02434: if (true)
02435: return getUpdateNode(fromTable, tableName,
02436: columnList, whereClause);
02437: }
02438: } else {
02439: switch (jj_nt.kind) {
02440: case BINARY:
02441: case COALESCE:
02442: case COUNT:
02443: case D:
02444: case MODULE:
02445: case T:
02446: case TS:
02447: case VALUE:
02448: case VARBINARY:
02449: case ABS:
02450: case ABSVAL:
02451: case ACTION:
02452: case ALWAYS:
02453: case BLOB:
02454: case C:
02455: case CALLED:
02456: case CLOB:
02457: case COBOL:
02458: case COMMITTED:
02459: case CONCAT:
02460: case CONTAINS:
02461: case DATA:
02462: case DATE:
02463: case DAY:
02464: case DYNAMIC:
02465: case FORTRAN:
02466: case GENERATED:
02467: case IDENTITY_VAL_LOCAL:
02468: case INCREMENT:
02469: case INITIAL:
02470: case INTERVAL:
02471: case LANGUAGE:
02472: case LARGE:
02473: case LENGTH:
02474: case LEVEL:
02475: case LOCKS:
02476: case LOCKSIZE:
02477: case LOGGED:
02478: case MOD:
02479: case MODIFIES:
02480: case MODIFY:
02481: case MONTH:
02482: case _MORE:
02483: case MUMPS:
02484: case NAME:
02485: case NCLOB:
02486: case NULLABLE:
02487: case NUMBER:
02488: case OBJECT:
02489: case PASCAL:
02490: case PLI:
02491: case PRECISION:
02492: case RELEASE:
02493: case REPEATABLE:
02494: case RESTART:
02495: case RETURNS:
02496: case ROW:
02497: case SAVEPOINT:
02498: case SCALE:
02499: case SERIALIZABLE:
02500: case SQL_TSI_FRAC_SECOND:
02501: case SQL_TSI_SECOND:
02502: case SQL_TSI_MINUTE:
02503: case SQL_TSI_HOUR:
02504: case SQL_TSI_DAY:
02505: case SQL_TSI_WEEK:
02506: case SQL_TSI_MONTH:
02507: case SQL_TSI_QUARTER:
02508: case SQL_TSI_YEAR:
02509: case START:
02510: case STATEMENT:
02511: case SYNONYM:
02512: case THEN:
02513: case TIME:
02514: case TIMESTAMP:
02515: case TIMESTAMPADD:
02516: case TIMESTAMPDIFF:
02517: case TRUNCATE:
02518: case TYPE:
02519: case UNCOMMITTED:
02520: case USAGE:
02521: case WHEN:
02522: case CURDATE:
02523: case CURTIME:
02524: case DATABASE:
02525: case LONG:
02526: case AFTER:
02527: case BEFORE:
02528: case CLASS:
02529: case COMPRESS:
02530: case CONTENT:
02531: case CS:
02532: case DB2SQL:
02533: case DIRTY:
02534: case DOCUMENT:
02535: case EACH:
02536: case EMPTY:
02537: case EXCLUSIVE:
02538: case FN:
02539: case INDEX:
02540: case JAVA:
02541: case LCASE:
02542: case LOCATE:
02543: case LOCK:
02544: case MESSAGE_LOCALE:
02545: case METHOD:
02546: case MODE:
02547: case NEW:
02548: case NEW_TABLE:
02549: case OJ:
02550: case OFF:
02551: case OLD:
02552: case OLD_TABLE:
02553: case PARAMETER:
02554: case PASSING:
02555: case PROPERTIES:
02556: case READS:
02557: case REF:
02558: case REFERENCING:
02559: case RENAME:
02560: case RESET:
02561: case RESULT:
02562: case RETAIN:
02563: case RETURNING:
02564: case RR:
02565: case RS:
02566: case SEQUENCE:
02567: case SEQUENTIAL:
02568: case SETS:
02569: case SHARE:
02570: case SQLID:
02571: case SPECIFIC:
02572: case SQRT:
02573: case STABILITY:
02574: case STRIP:
02575: case STYLE:
02576: case TRIGGER:
02577: case UCASE:
02578: case UR:
02579: case WHITESPACE:
02580: case IDENTIFIER:
02581: case DELIMITED_IDENTIFIER:
02582: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
02583: if ((getToken(1).kind != SET)
02584: && !derbyPropertiesListFollows()) {
02585: switch (jj_nt.kind) {
02586: case AS:
02587: jj_consume_token(AS);
02588: break;
02589: default:
02590: jj_la1[21] = jj_gen;
02591: ;
02592: }
02593: correlationName = identifier(
02594: Limits.MAX_IDENTIFIER_LENGTH, true);
02595: } else {
02596: ;
02597: }
02598: switch (jj_nt.kind) {
02599: case DERBYDASHPROPERTIES:
02600: targetProperties = propertyList(false);
02601: jj_consume_token(CHECK_PROPERTIES);
02602: break;
02603: default:
02604: jj_la1[22] = jj_gen;
02605: ;
02606: }
02607: jj_consume_token(SET);
02608: columnList = setClauseList();
02609: switch (jj_nt.kind) {
02610: case WHERE:
02611: whereToken = jj_consume_token(WHERE);
02612: if (jj_2_8(1)) {
02613: whereClause = whereClause(whereToken);
02614: } else {
02615: switch (jj_nt.kind) {
02616: case CURRENT:
02617: fromTable = currentOfClause(correlationName);
02618: break;
02619: default:
02620: jj_la1[23] = jj_gen;
02621: jj_consume_token(-1);
02622: throw new ParseException();
02623: }
02624: }
02625: break;
02626: default:
02627: jj_la1[24] = jj_gen;
02628: ;
02629: }
02630: /* Fabricate a ResultSetNode (SelectNode) under the UpdateNode.
02631: * For a searched update,
02632: * The FromList is simply the table that we are updating.
02633: * For a positioned update,
02634: * the FromList is a CurrentOfNode holding the cursor name.
02635: * (NOTE - we mark the table as the one that we are updating.)
02636: * The select list is the columns in the SET clause. At bind time,
02637: * we will prepend the CurrentRowLocation() in keeping with the design
02638: * decision that the parser's output should look like the language.
02639: */
02640: if (fromTable == null)
02641: fromTable = (FromTable) nodeFactory.getNode(
02642: C_NodeTypes.FROM_BASE_TABLE, tableName,
02643: correlationName, ReuseFactory
02644: .getInteger(FromBaseTable.UPDATE),
02645: null, getContextManager());
02646:
02647: /* Update the FromTable with any properties, if non-null */
02648: if (targetProperties != null) {
02649: if (SanityManager.DEBUG) {
02650: if (((FromBaseTable) fromTable).getProperties() != null) {
02651: SanityManager
02652: .THROWASSERT("Overwriting existing properties");
02653: }
02654: }
02655: ((FromBaseTable) fromTable)
02656: .setTableProperties(targetProperties);
02657: }
02658: {
02659: if (true)
02660: return getUpdateNode(fromTable, tableName,
02661: columnList, whereClause);
02662: }
02663: break;
02664: default:
02665: jj_la1[25] = jj_gen;
02666: jj_consume_token(-1);
02667: throw new ParseException();
02668: }
02669: }
02670: throw new Error("Missing return statement in function");
02671: }
02672:
02673: /*
02674: * <A NAME="callStatement">callStatement</A>
02675: */
02676: final public QueryTreeNode callStatement() throws ParseException,
02677: StandardException {
02678: QueryTreeNode retval;
02679: switch (jj_nt.kind) {
02680: case CALL:
02681: case QUESTION_MARK:
02682: retval = bareCallStatement();
02683: break;
02684: case LEFT_BRACE:
02685: jj_consume_token(LEFT_BRACE);
02686: retval = bareCallStatement();
02687: jj_consume_token(RIGHT_BRACE);
02688: break;
02689: default:
02690: jj_la1[26] = jj_gen;
02691: jj_consume_token(-1);
02692: throw new ParseException();
02693: }
02694: {
02695: if (true)
02696: return retval;
02697: }
02698: throw new Error("Missing return statement in function");
02699: }
02700:
02701: /*
02702: * <A NAME="bareCallStatement">baseCallStatement</A>
02703: */
02704: final public QueryTreeNode bareCallStatement()
02705: throws ParseException, StandardException {
02706: ParameterNode returnParam = null;
02707:
02708: ValueNode value = null;
02709:
02710: ResultSetNode resultSetNode = null;
02711: switch (jj_nt.kind) {
02712: case CALL:
02713: jj_consume_token(CALL);
02714: value = primaryExpression(true);
02715: if (!(value instanceof JavaToSQLValueNode)
02716: || !(((JavaToSQLValueNode) value)
02717: .getJavaValueNode() instanceof MethodCallNode)) {
02718: {
02719: if (true)
02720: throw StandardException
02721: .newException(SQLState.LANG_INVALID_CALL_STATEMENT);
02722: }
02723: }
02724:
02725: QueryTreeNode callStatement = (QueryTreeNode) nodeFactory
02726: .getNode(C_NodeTypes.CALL_STATEMENT_NODE, value,
02727: getContextManager());
02728:
02729: setUpAndLinkParameters();
02730:
02731: {
02732: if (true)
02733: return callStatement;
02734: }
02735: break;
02736: case QUESTION_MARK:
02737: returnParam = dynamicParameterSpecification();
02738: getCompilerContext().setReturnParameterFlag(); //bug4450
02739:
02740: jj_consume_token(EQUALS_OPERATOR);
02741: jj_consume_token(CALL);
02742: resultSetNode = rowValueConstructor(null);
02743: // validate that we have something that is an appropriate call statement
02744: ResultColumnList rcl = resultSetNode.getResultColumns();
02745:
02746: // we can have only 1 return value/column
02747: if (rcl == null || rcl.size() > 1) {
02748: {
02749: if (true)
02750: throw StandardException
02751: .newException(SQLState.LANG_INVALID_CALL_STATEMENT);
02752: }
02753: }
02754:
02755: // we must have a method call node
02756: value = ((ResultColumn) rcl.elementAt(0)).getExpression();
02757: if (!(value instanceof JavaToSQLValueNode)
02758: || !(((JavaToSQLValueNode) value)
02759: .getJavaValueNode() instanceof MethodCallNode)) {
02760: {
02761: if (true)
02762: throw StandardException
02763: .newException(SQLState.LANG_INVALID_CALL_STATEMENT);
02764: }
02765: }
02766:
02767: // wrap the row result set in a cursor node
02768: QueryTreeNode cursorNode = (QueryTreeNode) nodeFactory
02769: .getNode(C_NodeTypes.CURSOR_NODE, "SELECT",
02770: resultSetNode, null, null, ReuseFactory
02771: .getInteger(CursorNode.READ_ONLY),
02772: null, getContextManager());
02773:
02774: // set the 0th param to be a RETURN param
02775: returnParam.setReturnOutputParam(value);
02776:
02777: setUpAndLinkParameters();
02778:
02779: {
02780: if (true)
02781: return cursorNode;
02782: }
02783: break;
02784: default:
02785: jj_la1[27] = jj_gen;
02786: jj_consume_token(-1);
02787: throw new ParseException();
02788: }
02789: throw new Error("Missing return statement in function");
02790: }
02791:
02792: /*
02793: * <A NAME="primaryExpression">primaryExpression</A>
02794: *
02795: * @param inSelectClause will be true if this method got called while parsing the select or values clause
02796: * If in select or values clause, we do not want to allow boolean values.
02797: */
02798: final public ValueNode primaryExpression(boolean inSelectClause)
02799: throws ParseException, StandardException {
02800: ValueNode value = null;
02801: if (getToken(2).kind == PERIOD
02802: && getToken(4).kind == LEFT_PAREN) {
02803: value = routineInvocation();
02804: {
02805: if (true)
02806: return value;
02807: }
02808: } else if (jj_2_9(1)) {
02809: value = primaryExpressionXX(inSelectClause);
02810: {
02811: if (true)
02812: return value;
02813: }
02814: } else {
02815: jj_consume_token(-1);
02816: throw new ParseException();
02817: }
02818: throw new Error("Missing return statement in function");
02819: }
02820:
02821: /*
02822: * <A NAME="savepointStatement">savepointStatement</A>
02823:
02824: savepointStatementClauses contains the UNIQUE, ON ROLLBACK RETAIN LOCKS, ON ROLLBACK RETAIN CURSORS clauses.
02825:
02826: 0 - Boolean - UNIQUE clause
02827: 1 - Boolean - ON ROLLBACK RETAIN LOCKS clause
02828: 2 - Boolean - ON ROLLBACK RETAIN CURSORS clause
02829: */
02830: final public QueryTreeNode savepointStatement()
02831: throws ParseException, StandardException {
02832: String savepointName = null;
02833: int savepointStatementType;
02834: Object[] savepointStatementClauses = new Object[3];
02835: switch (jj_nt.kind) {
02836: case SAVEPOINT:
02837: jj_consume_token(SAVEPOINT);
02838: savepointName = identifier(Limits.MAX_IDENTIFIER_LENGTH,
02839: true);
02840: label_1: while (true) {
02841: savepointStatementClause(savepointStatementClauses);
02842: switch (jj_nt.kind) {
02843: case ON:
02844: case UNIQUE:
02845: ;
02846: break;
02847: default:
02848: jj_la1[28] = jj_gen;
02849: break label_1;
02850: }
02851: }
02852: //ON ROLLBACK RETAIN CURSORS is mandatory
02853: if (savepointStatementClauses[2] == null) {
02854: if (true)
02855: throw StandardException.newException(
02856: SQLState.LANG_SYNTAX_ERROR,
02857: "MISSING ON ROLLBACK RETAIN CURSORS");
02858: }
02859: savepointStatementType = 1;
02860: break;
02861: case ROLLBACK:
02862: jj_consume_token(ROLLBACK);
02863: switch (jj_nt.kind) {
02864: case WORK:
02865: jj_consume_token(WORK);
02866: break;
02867: default:
02868: jj_la1[29] = jj_gen;
02869: ;
02870: }
02871: jj_consume_token(TO);
02872: jj_consume_token(SAVEPOINT);
02873: switch (jj_nt.kind) {
02874: case BINARY:
02875: case COALESCE:
02876: case COUNT:
02877: case D:
02878: case MODULE:
02879: case T:
02880: case TS:
02881: case VALUE:
02882: case VARBINARY:
02883: case ABS:
02884: case ABSVAL:
02885: case ACTION:
02886: case ALWAYS:
02887: case BLOB:
02888: case C:
02889: case CALLED:
02890: case CLOB:
02891: case COBOL:
02892: case COMMITTED:
02893: case CONCAT:
02894: case CONTAINS:
02895: case DATA:
02896: case DATE:
02897: case DAY:
02898: case DYNAMIC:
02899: case FORTRAN:
02900: case GENERATED:
02901: case IDENTITY_VAL_LOCAL:
02902: case INCREMENT:
02903: case INITIAL:
02904: case INTERVAL:
02905: case LANGUAGE:
02906: case LARGE:
02907: case LENGTH:
02908: case LEVEL:
02909: case LOCKS:
02910: case LOCKSIZE:
02911: case LOGGED:
02912: case MOD:
02913: case MODIFIES:
02914: case MODIFY:
02915: case MONTH:
02916: case _MORE:
02917: case MUMPS:
02918: case NAME:
02919: case NCLOB:
02920: case NULLABLE:
02921: case NUMBER:
02922: case OBJECT:
02923: case PASCAL:
02924: case PLI:
02925: case PRECISION:
02926: case RELEASE:
02927: case REPEATABLE:
02928: case RESTART:
02929: case RETURNS:
02930: case ROW:
02931: case SAVEPOINT:
02932: case SCALE:
02933: case SERIALIZABLE:
02934: case SQL_TSI_FRAC_SECOND:
02935: case SQL_TSI_SECOND:
02936: case SQL_TSI_MINUTE:
02937: case SQL_TSI_HOUR:
02938: case SQL_TSI_DAY:
02939: case SQL_TSI_WEEK:
02940: case SQL_TSI_MONTH:
02941: case SQL_TSI_QUARTER:
02942: case SQL_TSI_YEAR:
02943: case START:
02944: case STATEMENT:
02945: case SYNONYM:
02946: case THEN:
02947: case TIME:
02948: case TIMESTAMP:
02949: case TIMESTAMPADD:
02950: case TIMESTAMPDIFF:
02951: case TRUNCATE:
02952: case TYPE:
02953: case UNCOMMITTED:
02954: case USAGE:
02955: case WHEN:
02956: case CURDATE:
02957: case CURTIME:
02958: case DATABASE:
02959: case LONG:
02960: case AFTER:
02961: case BEFORE:
02962: case CLASS:
02963: case COMPRESS:
02964: case CONTENT:
02965: case CS:
02966: case DB2SQL:
02967: case DIRTY:
02968: case DOCUMENT:
02969: case EACH:
02970: case EMPTY:
02971: case EXCLUSIVE:
02972: case FN:
02973: case INDEX:
02974: case JAVA:
02975: case LCASE:
02976: case LOCATE:
02977: case LOCK:
02978: case MESSAGE_LOCALE:
02979: case METHOD:
02980: case MODE:
02981: case NEW:
02982: case NEW_TABLE:
02983: case OJ:
02984: case OFF:
02985: case OLD:
02986: case OLD_TABLE:
02987: case PARAMETER:
02988: case PASSING:
02989: case PROPERTIES:
02990: case READS:
02991: case REF:
02992: case REFERENCING:
02993: case RENAME:
02994: case RESET:
02995: case RESULT:
02996: case RETAIN:
02997: case RETURNING:
02998: case RR:
02999: case RS:
03000: case SEQUENCE:
03001: case SEQUENTIAL:
03002: case SETS:
03003: case SHARE:
03004: case SQLID:
03005: case SPECIFIC:
03006: case SQRT:
03007: case STABILITY:
03008: case STRIP:
03009: case STYLE:
03010: case TRIGGER:
03011: case UCASE:
03012: case UR:
03013: case WHITESPACE:
03014: case IDENTIFIER:
03015: case DELIMITED_IDENTIFIER:
03016: savepointName = identifier(
03017: Limits.MAX_IDENTIFIER_LENGTH, true);
03018: break;
03019: default:
03020: jj_la1[30] = jj_gen;
03021: ;
03022: }
03023: savepointStatementType = 2;
03024: break;
03025: case RELEASE:
03026: jj_consume_token(RELEASE);
03027: switch (jj_nt.kind) {
03028: case TO:
03029: jj_consume_token(TO);
03030: break;
03031: default:
03032: jj_la1[31] = jj_gen;
03033: ;
03034: }
03035: jj_consume_token(SAVEPOINT);
03036: savepointName = identifier(Limits.MAX_IDENTIFIER_LENGTH,
03037: true);
03038: savepointStatementType = 3;
03039: break;
03040: default:
03041: jj_la1[32] = jj_gen;
03042: jj_consume_token(-1);
03043: throw new ParseException();
03044: }
03045: {
03046: if (true)
03047: return (QueryTreeNode) nodeFactory
03048: .getNode(
03049: C_NodeTypes.SAVEPOINT_NODE,
03050: savepointName,
03051: ReuseFactory
03052: .getInteger(savepointStatementType),
03053: getContextManager());
03054: }
03055: throw new Error("Missing return statement in function");
03056: }
03057:
03058: final public void savepointStatementClause(
03059: Object[] savepointStatementClauses) throws ParseException,
03060: StandardException {
03061: int clausePosition = -1;
03062: switch (jj_nt.kind) {
03063: case UNIQUE:
03064: jj_consume_token(UNIQUE);
03065: clausePosition = 0;
03066: break;
03067: case ON:
03068: jj_consume_token(ON);
03069: jj_consume_token(ROLLBACK);
03070: jj_consume_token(RETAIN);
03071: clausePosition = LocksOrCursors();
03072: break;
03073: default:
03074: jj_la1[33] = jj_gen;
03075: jj_consume_token(-1);
03076: throw new ParseException();
03077: }
03078: if (clausePosition != -1) {
03079: // check for repeated clause
03080: if (savepointStatementClauses[clausePosition] != null) {
03081:
03082: String which = SAVEPOINT_CLAUSE_NAMES[clausePosition];
03083: {
03084: if (true)
03085: throw StandardException.newException(
03086: SQLState.LANG_DB2_MULTIPLE_ELEMENTS,
03087: which);
03088: }
03089: }
03090:
03091: savepointStatementClauses[clausePosition] = Boolean.TRUE;
03092: }
03093: }
03094:
03095: /*
03096: * <A NAME="LocksOrCursors">LocksOrCursors</A>
03097: */
03098: final public int LocksOrCursors() throws ParseException {
03099: switch (jj_nt.kind) {
03100: case LOCKS:
03101: jj_consume_token(LOCKS);
03102: {
03103: if (true)
03104: return (1);
03105: }
03106: break;
03107: case CURSORS:
03108: jj_consume_token(CURSORS);
03109: {
03110: if (true)
03111: return (2);
03112: }
03113: break;
03114: default:
03115: jj_la1[34] = jj_gen;
03116: jj_consume_token(-1);
03117: throw new ParseException();
03118: }
03119: throw new Error("Missing return statement in function");
03120: }
03121:
03122: /*
03123: * <A NAME="globalTemporaryTableDeclaration">globalTemporaryTableDeclaration</A>
03124:
03125: declareTableClauses contains the NOT LOGGED, on commit and on rollback clauses.
03126:
03127: 0 - Boolean - NOT LOGGED clause
03128: 1 - Boolean - on commit behavior
03129: 2 - Boolean - on rollback behavior
03130: */
03131: final public QueryTreeNode globalTemporaryTableDeclaration()
03132: throws ParseException, StandardException {
03133: TableName tableName;
03134: TableElementList tableElementList;
03135: Object[] declareTableClauses = new Object[3];
03136: jj_consume_token(DECLARE);
03137: jj_consume_token(GLOBAL);
03138: jj_consume_token(TEMPORARY);
03139: jj_consume_token(TABLE);
03140: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
03141: tableElementList = tableElementList();
03142: label_2: while (true) {
03143: declareTableClause(declareTableClauses);
03144: if (jj_2_10(1)) {
03145: ;
03146: } else {
03147: break label_2;
03148: }
03149: }
03150: // NOT LOGGED is mandatory
03151: if (declareTableClauses[0] == null) {
03152: if (true)
03153: throw StandardException.newException(
03154: SQLState.LANG_SYNTAX_ERROR,
03155: "MISSING NOT LOGGED");
03156: }
03157: // if ON COMMIT behavior not explicitly specified in DECLARE command, resort to default ON COMMIT DELETE ROWS
03158: if (declareTableClauses[1] == null)
03159: declareTableClauses[1] = Boolean.TRUE;
03160: // if ON ROLLBACK behavior not explicitly specified in DECLARE command, resort to default ON ROLLBACK DELETE ROWS
03161: if (declareTableClauses[2] == null)
03162: declareTableClauses[2] = Boolean.TRUE;
03163: {
03164: if (true)
03165: return (QueryTreeNode) nodeFactory.getNode(
03166: C_NodeTypes.CREATE_TABLE_NODE, tableName,
03167: tableElementList, (Properties) null,
03168: (Boolean) declareTableClauses[1],
03169: (Boolean) declareTableClauses[2],
03170: getContextManager());
03171: }
03172: throw new Error("Missing return statement in function");
03173: }
03174:
03175: final public void declareTableClause(Object[] declareTableClauses)
03176: throws ParseException, StandardException {
03177: int clausePosition = -1;
03178: Object clauseValue = null;
03179: switch (jj_nt.kind) {
03180: case NOT:
03181: jj_consume_token(NOT);
03182: jj_consume_token(LOGGED);
03183: clauseValue = Boolean.TRUE;
03184: clausePosition = 0;
03185: break;
03186: default:
03187: jj_la1[35] = jj_gen;
03188: if (getToken(1).kind == ON && getToken(2).kind == COMMIT) {
03189: jj_consume_token(ON);
03190: jj_consume_token(COMMIT);
03191: clauseValue = onCommit();
03192: jj_consume_token(ROWS);
03193: clausePosition = 1;
03194: } else if (getToken(1).kind == ON
03195: && getToken(2).kind == ROLLBACK) {
03196: jj_consume_token(ON);
03197: jj_consume_token(ROLLBACK);
03198: jj_consume_token(DELETE);
03199: jj_consume_token(ROWS);
03200: clauseValue = Boolean.TRUE;
03201: clausePosition = 2;
03202: } else {
03203: jj_consume_token(-1);
03204: throw new ParseException();
03205: }
03206: }
03207: if (clausePosition != -1) {
03208: // check for repeated clause
03209: if (declareTableClauses[clausePosition] != null) {
03210:
03211: String which = TEMPORARY_TABLE_CLAUSE_NAMES[clausePosition];
03212: {
03213: if (true)
03214: throw StandardException.newException(
03215: SQLState.LANG_DB2_MULTIPLE_ELEMENTS,
03216: which);
03217: }
03218: }
03219:
03220: declareTableClauses[clausePosition] = clauseValue;
03221: }
03222: }
03223:
03224: /*
03225: * <A NAME="onCommit">onCommit</A>
03226: */
03227: final public Boolean onCommit() throws ParseException {
03228: switch (jj_nt.kind) {
03229: case PRESERVE:
03230: jj_consume_token(PRESERVE);
03231: {
03232: if (true)
03233: return (Boolean.FALSE);
03234: }
03235: break;
03236: case DELETE:
03237: jj_consume_token(DELETE);
03238: {
03239: if (true)
03240: return (Boolean.TRUE);
03241: }
03242: break;
03243: default:
03244: jj_la1[36] = jj_gen;
03245: jj_consume_token(-1);
03246: throw new ParseException();
03247: }
03248: throw new Error("Missing return statement in function");
03249: }
03250:
03251: /*
03252: * <A NAME="tableElementList">tableElementList</A>
03253: */
03254: final public TableElementList tableElementList()
03255: throws ParseException, StandardException {
03256: TableElementList tableElementList = (TableElementList) nodeFactory
03257: .getNode(C_NodeTypes.TABLE_ELEMENT_LIST,
03258: getContextManager());
03259: jj_consume_token(LEFT_PAREN);
03260: tableElement(tableElementList);
03261: label_3: while (true) {
03262: switch (jj_nt.kind) {
03263: case COMMA:
03264: ;
03265: break;
03266: default:
03267: jj_la1[37] = jj_gen;
03268: break label_3;
03269: }
03270: jj_consume_token(COMMA);
03271: tableElement(tableElementList);
03272: }
03273: jj_consume_token(RIGHT_PAREN);
03274: {
03275: if (true)
03276: return tableElementList;
03277: }
03278: throw new Error("Missing return statement in function");
03279: }
03280:
03281: /*
03282: * <A NAME="tableElement">tableElement</A>
03283: */
03284: final public void tableElement(TableElementList tableElementList)
03285: throws ParseException, StandardException {
03286: TableElementNode tableElement;
03287: //initialize following two booleans for every new table element so that the
03288: //values from previous tableElement doesn't impact the next tableElement
03289: explicitNotNull = false;
03290: explicitNull = false;
03291: switch (jj_nt.kind) {
03292: case BINARY:
03293: case COALESCE:
03294: case COUNT:
03295: case D:
03296: case MODULE:
03297: case T:
03298: case TS:
03299: case VALUE:
03300: case VARBINARY:
03301: case ABS:
03302: case ABSVAL:
03303: case ACTION:
03304: case ALWAYS:
03305: case BLOB:
03306: case C:
03307: case CALLED:
03308: case CLOB:
03309: case COBOL:
03310: case COMMITTED:
03311: case CONCAT:
03312: case CONTAINS:
03313: case DATA:
03314: case DATE:
03315: case DAY:
03316: case DYNAMIC:
03317: case FORTRAN:
03318: case GENERATED:
03319: case IDENTITY_VAL_LOCAL:
03320: case INCREMENT:
03321: case INITIAL:
03322: case INTERVAL:
03323: case LANGUAGE:
03324: case LARGE:
03325: case LENGTH:
03326: case LEVEL:
03327: case LOCKS:
03328: case LOCKSIZE:
03329: case LOGGED:
03330: case MOD:
03331: case MODIFIES:
03332: case MODIFY:
03333: case MONTH:
03334: case _MORE:
03335: case MUMPS:
03336: case NAME:
03337: case NCLOB:
03338: case NULLABLE:
03339: case NUMBER:
03340: case OBJECT:
03341: case PASCAL:
03342: case PLI:
03343: case PRECISION:
03344: case RELEASE:
03345: case REPEATABLE:
03346: case RESTART:
03347: case RETURNS:
03348: case ROW:
03349: case SAVEPOINT:
03350: case SCALE:
03351: case SERIALIZABLE:
03352: case SQL_TSI_FRAC_SECOND:
03353: case SQL_TSI_SECOND:
03354: case SQL_TSI_MINUTE:
03355: case SQL_TSI_HOUR:
03356: case SQL_TSI_DAY:
03357: case SQL_TSI_WEEK:
03358: case SQL_TSI_MONTH:
03359: case SQL_TSI_QUARTER:
03360: case SQL_TSI_YEAR:
03361: case START:
03362: case STATEMENT:
03363: case SYNONYM:
03364: case THEN:
03365: case TIME:
03366: case TIMESTAMP:
03367: case TIMESTAMPADD:
03368: case TIMESTAMPDIFF:
03369: case TRUNCATE:
03370: case TYPE:
03371: case UNCOMMITTED:
03372: case USAGE:
03373: case WHEN:
03374: case CURDATE:
03375: case CURTIME:
03376: case DATABASE:
03377: case LONG:
03378: case AFTER:
03379: case BEFORE:
03380: case CLASS:
03381: case COMPRESS:
03382: case CONTENT:
03383: case CS:
03384: case DB2SQL:
03385: case DIRTY:
03386: case DOCUMENT:
03387: case EACH:
03388: case EMPTY:
03389: case EXCLUSIVE:
03390: case FN:
03391: case INDEX:
03392: case JAVA:
03393: case LCASE:
03394: case LOCATE:
03395: case LOCK:
03396: case MESSAGE_LOCALE:
03397: case METHOD:
03398: case MODE:
03399: case NEW:
03400: case NEW_TABLE:
03401: case OJ:
03402: case OFF:
03403: case OLD:
03404: case OLD_TABLE:
03405: case PARAMETER:
03406: case PASSING:
03407: case PROPERTIES:
03408: case READS:
03409: case REF:
03410: case REFERENCING:
03411: case RENAME:
03412: case RESET:
03413: case RESULT:
03414: case RETAIN:
03415: case RETURNING:
03416: case RR:
03417: case RS:
03418: case SEQUENCE:
03419: case SEQUENTIAL:
03420: case SETS:
03421: case SHARE:
03422: case SQLID:
03423: case SPECIFIC:
03424: case SQRT:
03425: case STABILITY:
03426: case STRIP:
03427: case STYLE:
03428: case TRIGGER:
03429: case UCASE:
03430: case UR:
03431: case WHITESPACE:
03432: case IDENTIFIER:
03433: case DELIMITED_IDENTIFIER:
03434: tableElement = columnDefinition(tableElementList);
03435: tableElementList.addTableElement(tableElement);
03436: break;
03437: case CHECK:
03438: case CONSTRAINT:
03439: case FOREIGN:
03440: case PRIMARY:
03441: case UNIQUE:
03442: tableElement = tableConstraintDefinition();
03443: tableElementList.addTableElement(tableElement);
03444: break;
03445: default:
03446: jj_la1[38] = jj_gen;
03447: jj_consume_token(-1);
03448: throw new ParseException();
03449: }
03450: }
03451:
03452: /*
03453: * <A NAME="columnDefinition">columnDefinition</A>
03454: */
03455: final public TableElementNode columnDefinition(
03456: TableElementList tableElementList) throws ParseException,
03457: StandardException {
03458: DataTypeDescriptor typeDescriptor = null;
03459: ValueNode defaultNode = null;
03460: String columnName;
03461: long[] autoIncrementInfo = new long[4];
03462: /*
03463: ** RESOLVE: We are ignoring domains and collation.
03464: */
03465:
03466: /* identifier() used to be columnName() */
03467: columnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
03468: typeDescriptor = dataTypeDDL();
03469: switch (jj_nt.kind) {
03470: case CHECK:
03471: case CONSTRAINT:
03472: case _DEFAULT:
03473: case NOT:
03474: case PRIMARY:
03475: case REFERENCES:
03476: case UNIQUE:
03477: case WITH:
03478: case GENERATED:
03479: defaultNode = defaultAndConstraints(typeDescriptor,
03480: tableElementList, columnName, autoIncrementInfo);
03481: break;
03482: default:
03483: jj_la1[39] = jj_gen;
03484: ;
03485: }
03486: // Only pass autoincrement info for autoincrement columns
03487: if (autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_IS_AUTOINCREMENT_INDEX] == 0) {
03488: autoIncrementInfo = null;
03489: }
03490:
03491: {
03492: if (true)
03493: return (TableElementNode) nodeFactory.getNode(
03494: C_NodeTypes.COLUMN_DEFINITION_NODE, columnName,
03495: defaultNode, typeDescriptor, autoIncrementInfo,
03496: getContextManager());
03497: }
03498: throw new Error("Missing return statement in function");
03499: }
03500:
03501: /*
03502: * <A NAME="defaultAndConstraints">defaultAndConstraints</A>
03503: */
03504: final public ValueNode defaultAndConstraints(
03505: DataTypeDescriptor typeDescriptor,
03506: TableElementList tableElementList, String columnName,
03507: long[] autoIncrementInfo) throws ParseException,
03508: StandardException {
03509: ValueNode defaultNode = null;
03510: switch (jj_nt.kind) {
03511: case CHECK:
03512: case CONSTRAINT:
03513: case NOT:
03514: case PRIMARY:
03515: case REFERENCES:
03516: case UNIQUE:
03517: columnConstraintDefinition(typeDescriptor,
03518: tableElementList, columnName);
03519: label_4: while (true) {
03520: switch (jj_nt.kind) {
03521: case CHECK:
03522: case CONSTRAINT:
03523: case NOT:
03524: case PRIMARY:
03525: case REFERENCES:
03526: case UNIQUE:
03527: ;
03528: break;
03529: default:
03530: jj_la1[40] = jj_gen;
03531: break label_4;
03532: }
03533: columnConstraintDefinition(typeDescriptor,
03534: tableElementList, columnName);
03535: }
03536: switch (jj_nt.kind) {
03537: case _DEFAULT:
03538: case WITH:
03539: case GENERATED:
03540: defaultNode = defaultClause(autoIncrementInfo,
03541: columnName);
03542: label_5: while (true) {
03543: switch (jj_nt.kind) {
03544: case CHECK:
03545: case CONSTRAINT:
03546: case NOT:
03547: case PRIMARY:
03548: case REFERENCES:
03549: case UNIQUE:
03550: ;
03551: break;
03552: default:
03553: jj_la1[41] = jj_gen;
03554: break label_5;
03555: }
03556: columnConstraintDefinition(typeDescriptor,
03557: tableElementList, columnName);
03558: }
03559: break;
03560: default:
03561: jj_la1[42] = jj_gen;
03562: ;
03563: }
03564: {
03565: if (true)
03566: return defaultNode;
03567: }
03568: break;
03569: case _DEFAULT:
03570: case WITH:
03571: case GENERATED:
03572: defaultNode = defaultClause(autoIncrementInfo, columnName);
03573: label_6: while (true) {
03574: switch (jj_nt.kind) {
03575: case CHECK:
03576: case CONSTRAINT:
03577: case NOT:
03578: case PRIMARY:
03579: case REFERENCES:
03580: case UNIQUE:
03581: ;
03582: break;
03583: default:
03584: jj_la1[43] = jj_gen;
03585: break label_6;
03586: }
03587: columnConstraintDefinition(typeDescriptor,
03588: tableElementList, columnName);
03589: }
03590: {
03591: if (true)
03592: return defaultNode;
03593: }
03594: break;
03595: default:
03596: jj_la1[44] = jj_gen;
03597: jj_consume_token(-1);
03598: throw new ParseException();
03599: }
03600: throw new Error("Missing return statement in function");
03601: }
03602:
03603: /*
03604: * <A NAME="dataTypeDDL">dataTypeDDL</A>
03605: */
03606: final public DataTypeDescriptor dataTypeDDL()
03607: throws ParseException, StandardException {
03608: DataTypeDescriptor typeDescriptor;
03609: if (commonDatatypeName(false)) {
03610:
03611: } else {
03612: jj_consume_token(-1);
03613: throw new ParseException();
03614: }
03615: typeDescriptor = dataTypeCommon();
03616: {
03617: if (true)
03618: return typeDescriptor;
03619: }
03620: throw new Error("Missing return statement in function");
03621: }
03622:
03623: /*
03624: * <A NAME="dataTypeCast">dataTypeCast</A>
03625: */
03626: final public DataTypeDescriptor dataTypeCast()
03627: throws ParseException, StandardException {
03628: DataTypeDescriptor typeDescriptor;
03629: if (commonDatatypeName(true)) {
03630:
03631: } else {
03632: jj_consume_token(-1);
03633: throw new ParseException();
03634: }
03635: typeDescriptor = dataTypeCommon();
03636: {
03637: if (true)
03638: return typeDescriptor;
03639: }
03640: throw new Error("Missing return statement in function");
03641: }
03642:
03643: /*
03644: * <A NAME="dataTypeCommon">dataTypeCommon</A>
03645: */
03646: final public DataTypeDescriptor dataTypeCommon()
03647: throws ParseException, StandardException {
03648: DataTypeDescriptor typeDescriptor;
03649: boolean checkCS = false;
03650: if (jj_2_11(1)) {
03651: if (getToken(2).kind != LARGE) {
03652:
03653: } else {
03654: jj_consume_token(-1);
03655: throw new ParseException();
03656: }
03657: typeDescriptor = characterStringType();
03658: } else if (jj_2_12(1)) {
03659: if (getToken(3).kind != LARGE) {
03660:
03661: } else {
03662: jj_consume_token(-1);
03663: throw new ParseException();
03664: }
03665: typeDescriptor = nationalCharacterStringType();
03666: } else if (jj_2_13(1)) {
03667: typeDescriptor = numericType();
03668: } else {
03669: switch (jj_nt.kind) {
03670: case DATE:
03671: case TIME:
03672: case TIMESTAMP:
03673: typeDescriptor = datetimeType();
03674: break;
03675: case BOOLEAN:
03676: jj_consume_token(BOOLEAN);
03677: checkInternalFeature(TypeId.BOOLEAN_NAME);
03678: typeDescriptor = new DataTypeDescriptor(
03679: TypeId.BOOLEAN_ID, true);
03680: break;
03681: case LONG:
03682: typeDescriptor = longType();
03683: break;
03684: case BINARY:
03685: case CHAR:
03686: case CHARACTER:
03687: case NATIONAL:
03688: case BLOB:
03689: case CLOB:
03690: case NCLOB:
03691: typeDescriptor = LOBType();
03692: break;
03693: case XML:
03694: typeDescriptor = XMLType();
03695: break;
03696: default:
03697: jj_la1[45] = jj_gen;
03698: jj_consume_token(-1);
03699: throw new ParseException();
03700: }
03701: }
03702: {
03703: if (true)
03704: return typeDescriptor;
03705: }
03706: throw new Error("Missing return statement in function");
03707: }
03708:
03709: /*
03710: * <A NAME="characterStringType">characterStringType</A>
03711: */
03712: final public DataTypeDescriptor characterStringType()
03713: throws ParseException, StandardException {
03714: int length = DEFAULT_STRING_COLUMN_LENGTH;
03715: Token varyingToken = null;
03716: int type;
03717: switch (jj_nt.kind) {
03718: case VARCHAR:
03719: jj_consume_token(VARCHAR);
03720: length = charLength();
03721: type = Types.VARCHAR;
03722: break;
03723: case CHAR:
03724: case CHARACTER:
03725: charOrCharacter();
03726: switch (jj_nt.kind) {
03727: case VARYING:
03728: // Length is optional for CHARACTER, not for plain CHARACTER VARYING
03729: varyingToken = jj_consume_token(VARYING);
03730: length = charLength();
03731: break;
03732: default:
03733: jj_la1[47] = jj_gen;
03734: switch (jj_nt.kind) {
03735: case LEFT_PAREN:
03736: length = charLength();
03737: break;
03738: default:
03739: jj_la1[46] = jj_gen;
03740: ;
03741: }
03742: }
03743: // If the user says CHARACTER VARYING, it's really VARCHAR
03744: type = (varyingToken == null ? Types.CHAR : Types.VARCHAR);
03745: break;
03746: default:
03747: jj_la1[48] = jj_gen;
03748: jj_consume_token(-1);
03749: throw new ParseException();
03750: }
03751: switch (jj_nt.kind) {
03752: case FOR:
03753: type = forBitData(type);
03754: break;
03755: default:
03756: jj_la1[49] = jj_gen;
03757: ;
03758: }
03759: checkTypeLimits(type, length);
03760: DataTypeDescriptor charDTD = DataTypeDescriptor
03761: .getBuiltInDataTypeDescriptor(type, length);
03762: {
03763: if (true)
03764: return charDTD;
03765: }
03766: throw new Error("Missing return statement in function");
03767: }
03768:
03769: /*
03770: * <A NAME="charOrCharacter">charOrCharacter</A>
03771: */
03772: final public void charOrCharacter() throws ParseException {
03773: switch (jj_nt.kind) {
03774: case CHAR:
03775: jj_consume_token(CHAR);
03776: break;
03777: case CHARACTER:
03778: jj_consume_token(CHARACTER);
03779: break;
03780: default:
03781: jj_la1[50] = jj_gen;
03782: jj_consume_token(-1);
03783: throw new ParseException();
03784: }
03785: }
03786:
03787: /*
03788: * <A NAME="charType">charType</A>
03789: */
03790: final public int charLength() throws ParseException,
03791: StandardException {
03792: int length;
03793: jj_consume_token(LEFT_PAREN);
03794: length = length();
03795: jj_consume_token(RIGHT_PAREN);
03796: {
03797: if (true)
03798: return length;
03799: }
03800: throw new Error("Missing return statement in function");
03801: }
03802:
03803: /*
03804: ** <A NAME="forBitData">forBitData</A>
03805: */
03806: final public int forBitData(int charType) throws ParseException {
03807: jj_consume_token(FOR);
03808: jj_consume_token(BIT);
03809: jj_consume_token(DATA);
03810: if (charType == Types.CHAR)
03811: charType = Types.BINARY;
03812: else if (charType == Types.VARCHAR)
03813: charType = Types.VARBINARY;
03814: else if (charType == Types.LONGVARCHAR)
03815: charType = Types.LONGVARBINARY;
03816:
03817: {
03818: if (true)
03819: return charType;
03820: }
03821: throw new Error("Missing return statement in function");
03822: }
03823:
03824: /*
03825: * <A NAME="nationalCharacterStringType">nationalCharacterStringType</A>
03826: */
03827: final public DataTypeDescriptor nationalCharacterStringType()
03828: throws ParseException, StandardException {
03829: DataTypeDescriptor dataTypeDescriptor;
03830: int length = DEFAULT_STRING_COLUMN_LENGTH;
03831: String type = null;
03832: Token varyingToken = null;
03833: switch (jj_nt.kind) {
03834: case NATIONAL:
03835: jj_consume_token(NATIONAL);
03836: charOrCharacter();
03837: switch (jj_nt.kind) {
03838: case VARYING:
03839: // Length is optional for NATIONAL CHARACTER , not for NATIONAL CHARACTER VARYING
03840: varyingToken = jj_consume_token(VARYING);
03841: length = charLength();
03842: break;
03843: default:
03844: jj_la1[52] = jj_gen;
03845: switch (jj_nt.kind) {
03846: case LEFT_PAREN:
03847: length = charLength();
03848: break;
03849: default:
03850: jj_la1[51] = jj_gen;
03851: ;
03852: }
03853: }
03854: // If the user says NATIONAL CHARACTER VARYING, it's really NATIONALVARCHAR
03855: type = (varyingToken == null ? TypeId.NATIONAL_CHAR_NAME
03856: : TypeId.NATIONAL_VARCHAR_NAME);
03857: break;
03858: case NCHAR:
03859: jj_consume_token(NCHAR);
03860: switch (jj_nt.kind) {
03861: case VARYING:
03862: // Length is optional for NCHAR, not for NCHAR VARYING
03863: varyingToken = jj_consume_token(VARYING);
03864: length = charLength();
03865: break;
03866: default:
03867: jj_la1[54] = jj_gen;
03868: switch (jj_nt.kind) {
03869: case LEFT_PAREN:
03870: length = charLength();
03871: break;
03872: default:
03873: jj_la1[53] = jj_gen;
03874: ;
03875: }
03876: }
03877: // If the user says NCHAR VARYING, it's really NATIONALVARCHAR
03878: type = (varyingToken == null ? TypeId.NATIONAL_CHAR_NAME
03879: : TypeId.NATIONAL_VARCHAR_NAME);
03880: break;
03881: case NVARCHAR:
03882: jj_consume_token(NVARCHAR);
03883: length = charLength();
03884: type = TypeId.NATIONAL_VARCHAR_NAME;
03885: break;
03886: default:
03887: jj_la1[55] = jj_gen;
03888: jj_consume_token(-1);
03889: throw new ParseException();
03890: }
03891: // need to re-enable according to SQL standard
03892: {
03893: if (true)
03894: throw StandardException.newException(
03895: SQLState.NOT_IMPLEMENTED, type);
03896: }
03897: // return DataTypeDescriptor.getBuiltInDataTypeDescriptor(type, length);
03898:
03899: throw new Error("Missing return statement in function");
03900: }
03901:
03902: /*
03903: * <A NAME="LOBType">lobType</A>
03904: */
03905: final public DataTypeDescriptor LOBType() throws ParseException,
03906: StandardException {
03907: int length = 2147483647; // default to 2GB-1 if no length specified
03908: String type;
03909: switch (jj_nt.kind) {
03910: case BLOB:
03911: jj_consume_token(BLOB);
03912: switch (jj_nt.kind) {
03913: case LEFT_PAREN:
03914: length = lengthAndModifier();
03915: break;
03916: default:
03917: jj_la1[56] = jj_gen;
03918: ;
03919: }
03920: type = TypeId.BLOB_NAME;
03921: break;
03922: case CLOB:
03923: jj_consume_token(CLOB);
03924: switch (jj_nt.kind) {
03925: case LEFT_PAREN:
03926: length = lengthAndModifier();
03927: break;
03928: default:
03929: jj_la1[57] = jj_gen;
03930: ;
03931: }
03932: type = TypeId.CLOB_NAME;
03933: break;
03934: case NCLOB:
03935: jj_consume_token(NCLOB);
03936: length = lengthAndModifier();
03937: type = TypeId.NCLOB_NAME;
03938: // need to re-enable according to SQL standard
03939: {
03940: if (true)
03941: throw StandardException.newException(
03942: SQLState.NOT_IMPLEMENTED, type);
03943: }
03944: break;
03945: case BINARY:
03946: jj_consume_token(BINARY);
03947: jj_consume_token(LARGE);
03948: jj_consume_token(OBJECT);
03949: switch (jj_nt.kind) {
03950: case LEFT_PAREN:
03951: length = lengthAndModifier();
03952: break;
03953: default:
03954: jj_la1[58] = jj_gen;
03955: ;
03956: }
03957: type = TypeId.BLOB_NAME;
03958: break;
03959: case CHAR:
03960: case CHARACTER:
03961: charOrCharacter();
03962: jj_consume_token(LARGE);
03963: jj_consume_token(OBJECT);
03964: switch (jj_nt.kind) {
03965: case LEFT_PAREN:
03966: length = lengthAndModifier();
03967: break;
03968: default:
03969: jj_la1[59] = jj_gen;
03970: ;
03971: }
03972: type = TypeId.CLOB_NAME;
03973: break;
03974: case NATIONAL:
03975: jj_consume_token(NATIONAL);
03976: jj_consume_token(CHARACTER);
03977: jj_consume_token(LARGE);
03978: jj_consume_token(OBJECT);
03979: length = lengthAndModifier();
03980: type = TypeId.NCLOB_NAME;
03981: // need to re-enable according to SQL standard
03982: {
03983: if (true)
03984: throw StandardException.newException(
03985: SQLState.NOT_IMPLEMENTED, type);
03986: }
03987: break;
03988: default:
03989: jj_la1[60] = jj_gen;
03990: jj_consume_token(-1);
03991: throw new ParseException();
03992: }
03993: DataTypeDescriptor dtd = DataTypeDescriptor
03994: .getBuiltInDataTypeDescriptor(type, length);
03995:
03996: {
03997: if (true)
03998: return dtd;
03999: }
04000: throw new Error("Missing return statement in function");
04001: }
04002:
04003: /*
04004: * <A NAME="numericType">numericType</A>
04005: */
04006: final public DataTypeDescriptor numericType()
04007: throws ParseException, StandardException {
04008: DataTypeDescriptor typeDescriptor;
04009: switch (jj_nt.kind) {
04010: case DEC:
04011: case DECIMAL:
04012: case INT:
04013: case INTEGER:
04014: case NUMERIC:
04015: case SMALLINT:
04016: case LONGINT:
04017: typeDescriptor = exactNumericType();
04018: {
04019: if (true)
04020: return typeDescriptor;
04021: }
04022: break;
04023: default:
04024: jj_la1[61] = jj_gen;
04025: if (jj_2_14(1)) {
04026: typeDescriptor = approximateNumericType();
04027: {
04028: if (true)
04029: return typeDescriptor;
04030: }
04031: } else {
04032: jj_consume_token(-1);
04033: throw new ParseException();
04034: }
04035: }
04036: throw new Error("Missing return statement in function");
04037: }
04038:
04039: /*
04040: * <A NAME="exactNumericType">exactNumericType</A>
04041: */
04042: final public DataTypeDescriptor exactNumericType()
04043: throws ParseException, StandardException {
04044: int precision = TypeCompiler.DEFAULT_DECIMAL_PRECISION;
04045: int scale = TypeCompiler.DEFAULT_DECIMAL_SCALE;
04046: int type = Types.DECIMAL;
04047: String typeStr = "DECIMAL";
04048: int maxWidth;
04049: DataTypeDescriptor dtd = null;
04050: switch (jj_nt.kind) {
04051: case DEC:
04052: case DECIMAL:
04053: case NUMERIC:
04054: switch (jj_nt.kind) {
04055: case NUMERIC:
04056: jj_consume_token(NUMERIC);
04057: type = Types.NUMERIC;
04058: typeStr = "NUMERIC";
04059: break;
04060: case DECIMAL:
04061: jj_consume_token(DECIMAL);
04062: break;
04063: case DEC:
04064: jj_consume_token(DEC);
04065: break;
04066: default:
04067: jj_la1[62] = jj_gen;
04068: jj_consume_token(-1);
04069: throw new ParseException();
04070: }
04071: switch (jj_nt.kind) {
04072: case LEFT_PAREN:
04073: jj_consume_token(LEFT_PAREN);
04074: precision = precision();
04075: switch (jj_nt.kind) {
04076: case COMMA:
04077: jj_consume_token(COMMA);
04078: scale = scale();
04079: break;
04080: default:
04081: jj_la1[63] = jj_gen;
04082: ;
04083: }
04084: jj_consume_token(RIGHT_PAREN);
04085: break;
04086: default:
04087: jj_la1[64] = jj_gen;
04088: ;
04089: }
04090: if ((precision <= 0)
04091: || (precision > TypeCompiler.MAX_DECIMAL_PRECISION_SCALE)) {
04092: {
04093: if (true)
04094: throw StandardException.newException(
04095: SQLState.LANG_INVALID_PRECISION,
04096: typeStr, String.valueOf(precision));
04097: }
04098: } else if ((scale < 0)
04099: || (scale > TypeCompiler.MAX_DECIMAL_PRECISION_SCALE)) {
04100: {
04101: if (true)
04102: throw StandardException.newException(
04103: SQLState.LANG_INVALID_DECIMAL_SCALE,
04104: typeStr, String.valueOf(scale));
04105: }
04106: } else if (scale > precision) {
04107: {
04108: if (true)
04109: throw StandardException
04110: .newException(
04111: SQLState.LANG_INVALID_DECIMAL_PRECISION_SCALE,
04112: String.valueOf(scale), String
04113: .valueOf(precision));
04114: }
04115: }
04116: /*
04117: ** If we have a decimal point, need to count it
04118: ** towards maxwidth. Max width needs to account
04119: ** for the possible leading '0' and '-' and the
04120: ** decimal point. e.g., DEC(1,1) has a maxwidth
04121: ** of 4 (to handle "-0.1").
04122: */
04123: maxWidth = DataTypeUtilities.computeMaxWidth(precision,
04124: scale);
04125: {
04126: if (true)
04127: return getDataTypeServices(type, precision, scale,
04128: maxWidth);
04129: }
04130: break;
04131: case INT:
04132: case INTEGER:
04133: case SMALLINT:
04134: case LONGINT:
04135: dtd = exactIntegerType();
04136: {
04137: if (true)
04138: return dtd;
04139: }
04140: break;
04141: default:
04142: jj_la1[65] = jj_gen;
04143: jj_consume_token(-1);
04144: throw new ParseException();
04145: }
04146: throw new Error("Missing return statement in function");
04147: }
04148:
04149: /*
04150: * <A NAME="exactNumericType">exactNumericType</A>
04151: */
04152: final public DataTypeDescriptor exactIntegerType()
04153: throws ParseException, StandardException {
04154: switch (jj_nt.kind) {
04155: case INT:
04156: case INTEGER:
04157: switch (jj_nt.kind) {
04158: case INTEGER:
04159: jj_consume_token(INTEGER);
04160: break;
04161: case INT:
04162: jj_consume_token(INT);
04163: break;
04164: default:
04165: jj_la1[66] = jj_gen;
04166: jj_consume_token(-1);
04167: throw new ParseException();
04168: }
04169: {
04170: if (true)
04171: return DataTypeDescriptor
04172: .getBuiltInDataTypeDescriptor(Types.INTEGER);
04173: }
04174: break;
04175: case SMALLINT:
04176: jj_consume_token(SMALLINT);
04177: {
04178: if (true)
04179: return DataTypeDescriptor
04180: .getBuiltInDataTypeDescriptor(Types.SMALLINT);
04181: }
04182: break;
04183: case LONGINT:
04184: jj_consume_token(LONGINT);
04185: {
04186: if (true)
04187: return DataTypeDescriptor
04188: .getBuiltInDataTypeDescriptor(Types.BIGINT);
04189: }
04190: break;
04191: default:
04192: jj_la1[67] = jj_gen;
04193: jj_consume_token(-1);
04194: throw new ParseException();
04195: }
04196: throw new Error("Missing return statement in function");
04197: }
04198:
04199: /*
04200: * <A NAME="approximateNumericType">approximateNumericType</A>
04201: */
04202: final public DataTypeDescriptor approximateNumericType()
04203: throws ParseException, StandardException {
04204: int type = 0, scale = 0, width = 0;
04205: int prec = -1;
04206: DataTypeDescriptor dts = null;
04207: switch (jj_nt.kind) {
04208: case FLOAT:
04209: jj_consume_token(FLOAT);
04210: switch (jj_nt.kind) {
04211: case LEFT_PAREN:
04212: jj_consume_token(LEFT_PAREN);
04213: prec = precision();
04214: jj_consume_token(RIGHT_PAREN);
04215: break;
04216: default:
04217: jj_la1[68] = jj_gen;
04218: ;
04219: }
04220: /*
04221: When not specified, default is DOUBLE_PRECISION
04222: */
04223: if (prec == -1)
04224: prec = TypeId.DOUBLE_PRECISION;
04225:
04226: if (prec > 0 && prec <= TypeId.REAL_PRECISION) {
04227: type = Types.REAL;
04228: prec = TypeId.REAL_PRECISION;
04229: scale = TypeId.REAL_SCALE;
04230: width = TypeId.REAL_MAXWIDTH;
04231: } else if (prec > TypeId.REAL_PRECISION
04232: && prec <= TypeId.DOUBLE_PRECISION) {
04233: type = Types.DOUBLE;
04234: prec = TypeId.DOUBLE_PRECISION;
04235: scale = TypeId.DOUBLE_SCALE;
04236: width = TypeId.DOUBLE_MAXWIDTH;
04237: } else {
04238: if (true)
04239: throw StandardException.newException(
04240: SQLState.LANG_INVALID_PRECISION, "FLOAT",
04241: String.valueOf(prec));
04242: }
04243:
04244: /*
04245: REMIND: this is a slight hack, in that exacting reading of
04246: the InformationSchema requires that the type the user typed
04247: in be visible to them in the InformationSchema views. But
04248: most implementations use synonyms or mappings at some point,
04249: and this is one of those places, for us.
04250: */
04251: {
04252: if (true)
04253: return getDataTypeServices(type, prec, scale, width);
04254: }
04255: break;
04256: case REAL:
04257: jj_consume_token(REAL);
04258: {
04259: if (true)
04260: return DataTypeDescriptor
04261: .getBuiltInDataTypeDescriptor(Types.REAL);
04262: }
04263: break;
04264: default:
04265: jj_la1[69] = jj_gen;
04266: if (jj_2_15(1)) {
04267: dts = doubleType();
04268: {
04269: if (true)
04270: return dts;
04271: }
04272: } else {
04273: jj_consume_token(-1);
04274: throw new ParseException();
04275: }
04276: }
04277: throw new Error("Missing return statement in function");
04278: }
04279:
04280: /*
04281: * <A NAME="doubleType">doubleType</A>
04282: */
04283: final public DataTypeDescriptor doubleType() throws ParseException,
04284: StandardException {
04285: if (getToken(2).kind == PRECISION) {
04286: jj_consume_token(DOUBLE);
04287: jj_consume_token(PRECISION);
04288: } else {
04289: switch (jj_nt.kind) {
04290: case DOUBLE:
04291: jj_consume_token(DOUBLE);
04292: break;
04293: default:
04294: jj_la1[70] = jj_gen;
04295: jj_consume_token(-1);
04296: throw new ParseException();
04297: }
04298: }
04299: {
04300: if (true)
04301: return DataTypeDescriptor
04302: .getBuiltInDataTypeDescriptor(Types.DOUBLE);
04303: }
04304: throw new Error("Missing return statement in function");
04305: }
04306:
04307: /*
04308: * <A NAME="longType">longType</A>
04309: */
04310: final public DataTypeDescriptor longType() throws ParseException,
04311: StandardException {
04312: DataTypeDescriptor dataTypeDescriptor;
04313: jj_consume_token(LONG);
04314: dataTypeDescriptor = longSubType();
04315: {
04316: if (true)
04317: return dataTypeDescriptor;
04318: }
04319: throw new Error("Missing return statement in function");
04320: }
04321:
04322: final public DataTypeDescriptor longSubType()
04323: throws ParseException, StandardException {
04324: int lvcType = Types.LONGVARCHAR;
04325: switch (jj_nt.kind) {
04326: case VARCHAR:
04327: jj_consume_token(VARCHAR);
04328: switch (jj_nt.kind) {
04329: case FOR:
04330: lvcType = forBitData(lvcType);
04331: break;
04332: default:
04333: jj_la1[71] = jj_gen;
04334: ;
04335: }
04336: {
04337: if (true)
04338: return DataTypeDescriptor
04339: .getBuiltInDataTypeDescriptor(lvcType);
04340: }
04341: break;
04342: case NVARCHAR:
04343: jj_consume_token(NVARCHAR);
04344: // need to re-enable according to SQL standard
04345: {
04346: if (true)
04347: throw StandardException.newException(
04348: SQLState.NOT_IMPLEMENTED,
04349: TypeId.NATIONAL_LONGVARCHAR_NAME);
04350: }
04351: // return DataTypeDescriptor.getBuiltInDataTypeDescriptor(TypeId.NATIONAL_LONGVARCHAR_NAME);
04352:
04353: break;
04354: default:
04355: jj_la1[72] = jj_gen;
04356: jj_consume_token(-1);
04357: throw new ParseException();
04358: }
04359: throw new Error("Missing return statement in function");
04360: }
04361:
04362: /*
04363: * <A NAME="XMLType">XMLType</A>
04364: */
04365: final public DataTypeDescriptor XMLType() throws ParseException,
04366: StandardException {
04367: DataTypeDescriptor value;
04368: jj_consume_token(XML);
04369: checkVersion(DataDictionary.DD_VERSION_DERBY_10_1, "XML");
04370: {
04371: if (true)
04372: return DataTypeDescriptor
04373: .getBuiltInDataTypeDescriptor(StoredFormatIds.XML_TYPE_ID);
04374: }
04375: throw new Error("Missing return statement in function");
04376: }
04377:
04378: /*
04379: * <A NAME="xmlDocOrContent">xmlDocOrContent</A>
04380: *
04381: * Parse the XML keywords DOCUMENT and CONTENT. We don't
04382: * support CONTENT yet, so we throw an appropriate error
04383: * if we see it.
04384: *
04385: */
04386: final public void xmlDocOrContent() throws ParseException,
04387: StandardException {
04388: if ((getToken(1).kind != DOCUMENT)
04389: && (getToken(1).kind != CONTENT)) {
04390: {
04391: if (true)
04392: throw StandardException
04393: .newException(
04394: SQLState.LANG_XML_KEYWORD_MISSING,
04395: "DOCUMENT",
04396: ReuseFactory
04397: .getInteger(getToken(1).beginLine),
04398: ReuseFactory
04399: .getInteger(getToken(1).beginColumn));
04400: }
04401: } else if (getToken(1).kind == CONTENT) {
04402: jj_consume_token(CONTENT);
04403: {
04404: if (true)
04405: throw StandardException.newException(
04406: SQLState.LANG_UNSUPPORTED_XML_FEATURE,
04407: "CONTENT");
04408: }
04409: } else if (getToken(1).kind == DOCUMENT) {
04410: jj_consume_token(DOCUMENT);
04411: {
04412: if (true)
04413: return;
04414: }
04415: } else {
04416: jj_consume_token(-1);
04417: throw new ParseException();
04418: }
04419: }
04420:
04421: /*
04422: * <A NAME="javaType">javaType</A>
04423: */
04424: final public DataTypeDescriptor javaType() throws ParseException,
04425: StandardException {
04426: String javaClassName;
04427: javaClassName = javaClassName();
04428: {
04429: if (true)
04430: return getJavaClassDataTypeDescriptor(javaClassName);
04431: }
04432: throw new Error("Missing return statement in function");
04433: }
04434:
04435: /*
04436: * <A NAME = "javaDSL">javaDSL</A>
04437: *
04438: * A Java dot-separated list.
04439: */
04440: final public String javaDSL() throws ParseException {
04441: String dotSeparatedList;
04442: dotSeparatedList = caseSensitiveIdentifierPlusReservedWords();
04443: label_7: while (true) {
04444: switch (jj_nt.kind) {
04445: case PERIOD:
04446: ;
04447: break;
04448: default:
04449: jj_la1[73] = jj_gen;
04450: break label_7;
04451: }
04452: dotSeparatedList = javaDSLNameExtender(dotSeparatedList);
04453: }
04454: {
04455: if (true)
04456: return dotSeparatedList;
04457: }
04458: throw new Error("Missing return statement in function");
04459: }
04460:
04461: /*
04462: * <A NAME="javaClassName">javaClassName</A>
04463: */
04464: final public String javaClassName() throws ParseException {
04465: String javaClassName;
04466: javaClassName = javaDSL();
04467: {
04468: if (true)
04469: return javaClassName;
04470: }
04471: throw new Error("Missing return statement in function");
04472: }
04473:
04474: /*
04475: * <A NAME="javaDSLNameExtender">javaDSLNameExtender</A>
04476: */
04477: final public String javaDSLNameExtender(String dotSeparatedList)
04478: throws ParseException {
04479: String extender;
04480: jj_consume_token(PERIOD);
04481: extender = caseSensitiveIdentifierPlusReservedWords();
04482: {
04483: if (true)
04484: return dotSeparatedList + "." + extender;
04485: }
04486: throw new Error("Missing return statement in function");
04487: }
04488:
04489: /*
04490: * <A NAME="length">lengthAndModifier</A>
04491: */
04492: final public int lengthAndModifier() throws ParseException,
04493: StandardException {
04494: Token tok;
04495: Token tokmod = null;
04496: jj_consume_token(LEFT_PAREN);
04497: switch (jj_nt.kind) {
04498: case LENGTH_MODIFIER:
04499: tok = jj_consume_token(LENGTH_MODIFIER);
04500: break;
04501: case EXACT_NUMERIC:
04502: tok = jj_consume_token(EXACT_NUMERIC);
04503: switch (jj_nt.kind) {
04504: case IDENTIFIER:
04505: tokmod = jj_consume_token(IDENTIFIER);
04506: break;
04507: default:
04508: jj_la1[74] = jj_gen;
04509: ;
04510: }
04511: break;
04512: default:
04513: jj_la1[75] = jj_gen;
04514: jj_consume_token(-1);
04515: throw new ParseException();
04516: }
04517: jj_consume_token(RIGHT_PAREN);
04518: String s = tok.image + (tokmod == null ? "" : tokmod.image); // colapse cases;
04519: try {
04520: char modifier = s.charAt(s.length() - 1);
04521: String number = s.substring(0, s.length() - 1); // in case of ending w. letter
04522: long mul;
04523: switch (modifier) {
04524: case 'G':
04525: case 'g':
04526: mul = 1073741824L; //1 Giga
04527: break;
04528: case 'M':
04529: case 'm':
04530: mul = 1048576L; // 1 Mega
04531: break;
04532: case 'K':
04533: case 'k':
04534: mul = 1024L; // 1 Kilo
04535: break;
04536: default:
04537: mul = 1;
04538: number = s; // no letter in end, need whole string
04539: break;
04540: }
04541: long specifiedLength = Long.parseLong(number) * mul;
04542:
04543: // match DB2 limits of 1 to 2147483647
04544: if ((specifiedLength > 0L)
04545: && (specifiedLength <= Limits.DB2_LOB_MAXWIDTH)) {
04546: {
04547: if (true)
04548: return (int) specifiedLength;
04549: }
04550: }
04551:
04552: // DB2 allows 2G or 2048M or 2097152k that calculate out to
04553: // 2147483648, but sets the length to be one less.
04554: if (mul != 1 && specifiedLength == 2147483648L) {
04555: if (true)
04556: return Limits.DB2_LOB_MAXWIDTH;
04557: }
04558:
04559: } catch (NumberFormatException nfe) {
04560: }
04561:
04562: {
04563: if (true)
04564: throw StandardException.newException(
04565: SQLState.LANG_INVALID_COLUMN_LENGTH, s);
04566: }
04567: throw new Error("Missing return statement in function");
04568: }
04569:
04570: /*
04571: * <A NAME="length">length</A>
04572: */
04573: final public int length() throws ParseException, StandardException {
04574: Token tok;
04575: int retval;
04576: tok = jj_consume_token(EXACT_NUMERIC);
04577: try {
04578: retval = Integer.parseInt(tok.image);
04579:
04580: if (retval > 0) {
04581: if (true)
04582: return retval;
04583: }
04584: } catch (NumberFormatException nfe) {
04585: }
04586: {
04587: if (true)
04588: throw StandardException.newException(
04589: SQLState.LANG_INVALID_COLUMN_LENGTH, tok.image);
04590: }
04591: throw new Error("Missing return statement in function");
04592: }
04593:
04594: /*
04595: * <A NAME="exactNumber">exactNumber</A>
04596: */
04597: final public long exactNumber() throws ParseException,
04598: StandardException {
04599: Token longToken;
04600: String sign = "";
04601: switch (jj_nt.kind) {
04602: case PLUS_SIGN:
04603: case MINUS_SIGN:
04604: sign = sign();
04605: break;
04606: default:
04607: jj_la1[76] = jj_gen;
04608: ;
04609: }
04610: longToken = jj_consume_token(EXACT_NUMERIC);
04611: try {
04612: long longvalue = Long.parseLong(longToken.image);
04613: if (sign.equals("-")) {
04614: {
04615: if (true)
04616: return -longvalue;
04617: }
04618: } else {
04619: {
04620: if (true)
04621: return longvalue;
04622: }
04623: }
04624: } catch (NumberFormatException nfe) {
04625: {
04626: if (true)
04627: throw StandardException.newException(
04628: SQLState.LANG_INVALID_INTEGER_LITERAL,
04629: longToken.image);
04630: }
04631: }
04632: throw new Error("Missing return statement in function");
04633: }
04634:
04635: /*
04636: * <A NAME="precision">precision</A>
04637: */
04638: final public int precision() throws ParseException,
04639: StandardException {
04640: int uintValue;
04641: uintValue = uint_value();
04642: {
04643: if (true)
04644: return uintValue;
04645: }
04646: throw new Error("Missing return statement in function");
04647: }
04648:
04649: /*
04650: * <A NAME="uint_value">uint_value</A>
04651: */
04652: final public int uint_value() throws ParseException,
04653: StandardException {
04654: Token uintToken;
04655: /*
04656: because the parser won't match to UINT, we use EXACT_NUMERIC.
04657: */
04658: uintToken = jj_consume_token(EXACT_NUMERIC);
04659: try {
04660: {
04661: if (true)
04662: return Integer.parseInt(uintToken.image);
04663: }
04664: } catch (NumberFormatException nfe) {
04665: {
04666: if (true)
04667: throw StandardException.newException(
04668: SQLState.LANG_INVALID_INTEGER_LITERAL,
04669: uintToken.image);
04670: }
04671: }
04672: throw new Error("Missing return statement in function");
04673: }
04674:
04675: /*
04676: * <A NAME="scale">scale</A>
04677: */
04678: final public int scale() throws ParseException, StandardException {
04679: int uintValue;
04680: uintValue = uint_value();
04681: {
04682: if (true)
04683: return uintValue;
04684: }
04685: throw new Error("Missing return statement in function");
04686: }
04687:
04688: /*
04689: * <A NAME="datetimeType">datetimeType</A>
04690: */
04691: final public DataTypeDescriptor datetimeType()
04692: throws ParseException, StandardException {
04693: Token tzTok = null;
04694: int prec = -1;
04695: switch (jj_nt.kind) {
04696: case DATE:
04697: jj_consume_token(DATE);
04698: {
04699: if (true)
04700: return DataTypeDescriptor
04701: .getBuiltInDataTypeDescriptor(Types.DATE);
04702: }
04703: break;
04704: case TIME:
04705: jj_consume_token(TIME);
04706: /*
04707: We do not try to set up a precision for time/timestamp
04708: values because this field gets mapped to the precision
04709: field in the JDBC driver that is for the number of
04710: decimal digits in the value. Precision for time is
04711: actually the scale of the seconds value.
04712:
04713: If/when precision for times is supported, we may need
04714: to migrate the system catalog information to fill in
04715: the default values appropriately (the default for
04716: time is 0, fortunately; but for timestamp it is
04717: actually 9 due to java.sql.Timestamp's precision).
04718: */
04719: {
04720: if (true)
04721: return DataTypeDescriptor
04722: .getBuiltInDataTypeDescriptor(Types.TIME);
04723: }
04724: break;
04725: case TIMESTAMP:
04726: jj_consume_token(TIMESTAMP);
04727: {
04728: if (true)
04729: return DataTypeDescriptor
04730: .getBuiltInDataTypeDescriptor(Types.TIMESTAMP);
04731: }
04732: break;
04733: default:
04734: jj_la1[77] = jj_gen;
04735: jj_consume_token(-1);
04736: throw new ParseException();
04737: }
04738: throw new Error("Missing return statement in function");
04739: }
04740:
04741: /*
04742: * <A NAME="timePrecision">timePrecision</A>
04743: */
04744: final public void qualifiedNameList(Vector list, int id_length_limit)
04745: throws ParseException, StandardException {
04746: qualifiedNameElement(list, id_length_limit);
04747: label_8: while (true) {
04748: switch (jj_nt.kind) {
04749: case COMMA:
04750: ;
04751: break;
04752: default:
04753: jj_la1[78] = jj_gen;
04754: break label_8;
04755: }
04756: jj_consume_token(COMMA);
04757: qualifiedNameElement(list, id_length_limit);
04758: }
04759: }
04760:
04761: final public void qualifiedNameElement(Vector list,
04762: int id_length_limit) throws ParseException,
04763: StandardException {
04764: TableName qualifiedName = null;
04765: qualifiedName = qualifiedName(id_length_limit);
04766: list.addElement(qualifiedName);
04767: }
04768:
04769: /*
04770: * <A NAME="qualifiedName">qualifiedName</A>
04771: */
04772: final public TableName qualifiedName(int nodeType,
04773: int id_length_limit) throws ParseException,
04774: StandardException {
04775: //String catalogName = null;
04776: String schemaName = null;
04777: String qualifiedId;
04778: String firstName = null;
04779: String secondName = null;
04780: firstName = identifier(Limits.MAX_IDENTIFIER_LENGTH, false);
04781: if (getToken(1).kind == PERIOD && getToken(2).kind != ASTERISK) {
04782: jj_consume_token(PERIOD);
04783: secondName = identifier(Limits.MAX_IDENTIFIER_LENGTH, false);
04784: } else {
04785: ;
04786: }
04787: if (secondName == null) {
04788: qualifiedId = firstName;
04789: } else {
04790: schemaName = firstName;
04791: qualifiedId = secondName;
04792: }
04793:
04794: //limit the qualifiedId to the id length limit passed to this method
04795: checkIdentifierLengthLimit(qualifiedId, id_length_limit);
04796: if (schemaName != null)
04797: checkIdentifierLengthLimit(schemaName,
04798: Limits.MAX_IDENTIFIER_LENGTH);
04799:
04800: {
04801: if (true)
04802: return (TableName) nodeFactory.getNode(nodeType,
04803: schemaName, qualifiedId, new Integer(
04804: lastIdentifierToken.beginOffset),
04805: new Integer(lastIdentifierToken.endOffset),
04806: getContextManager());
04807: }
04808: throw new Error("Missing return statement in function");
04809: }
04810:
04811: /*
04812: * <A NAME="queryExpression">queryExpression</A>
04813: *
04814: * We have to be carefull to get the associativity correct. According to the SQL spec
04815: * <non-join query expression> ::=
04816: * <non-join query term>
04817: * | <query expression body> UNION [ ALL ] <query term>
04818: * | <query expression body> EXCEPT [ ALL ] <query term>
04819: * Meaning that
04820: * t1 UNION ALL t2 UNION t3
04821: * is equivalent to
04822: * (t1 UNION ALL t2) UNION t3
04823: * However recursive descent parsers want recursion to be on the right, so this kind of associativity is unnatural
04824: * for our parser. The queryExpression method must know whether it is being called as the right hand side of a
04825: * set operator to produce a query tree with the correct associativity.
04826: */
04827: final public ResultSetNode queryExpression(ResultSetNode leftSide,
04828: int operatorType) throws ParseException, StandardException {
04829: ResultSetNode term;
04830: term = nonJoinQueryTerm(leftSide, operatorType);
04831: switch (jj_nt.kind) {
04832: case EXCEPT:
04833: case UNION:
04834: term = unionOrExcept(term);
04835: break;
04836: default:
04837: jj_la1[79] = jj_gen;
04838: ;
04839: }
04840: {
04841: if (true)
04842: return term;
04843: }
04844: throw new Error("Missing return statement in function");
04845: }
04846:
04847: /*
04848: * <A NAME="unionOrExcept">unionOrExcept</A>
04849: */
04850: final public ResultSetNode unionOrExcept(ResultSetNode term)
04851: throws ParseException, StandardException {
04852: ResultSetNode expression;
04853: Token tok = null;
04854: switch (jj_nt.kind) {
04855: case UNION:
04856: jj_consume_token(UNION);
04857: switch (jj_nt.kind) {
04858: case ALL:
04859: case DISTINCT:
04860: switch (jj_nt.kind) {
04861: case ALL:
04862: tok = jj_consume_token(ALL);
04863: break;
04864: case DISTINCT:
04865: jj_consume_token(DISTINCT);
04866: break;
04867: default:
04868: jj_la1[80] = jj_gen;
04869: jj_consume_token(-1);
04870: throw new ParseException();
04871: }
04872: break;
04873: default:
04874: jj_la1[81] = jj_gen;
04875: ;
04876: }
04877: expression = queryExpression(term,
04878: (tok != null) ? UNION_ALL_OP : UNION_OP);
04879: {
04880: if (true)
04881: return expression;
04882: }
04883: break;
04884: case EXCEPT:
04885: jj_consume_token(EXCEPT);
04886: switch (jj_nt.kind) {
04887: case ALL:
04888: case DISTINCT:
04889: switch (jj_nt.kind) {
04890: case ALL:
04891: tok = jj_consume_token(ALL);
04892: break;
04893: case DISTINCT:
04894: jj_consume_token(DISTINCT);
04895: break;
04896: default:
04897: jj_la1[82] = jj_gen;
04898: jj_consume_token(-1);
04899: throw new ParseException();
04900: }
04901: break;
04902: default:
04903: jj_la1[83] = jj_gen;
04904: ;
04905: }
04906: expression = queryExpression(term,
04907: (tok != null) ? EXCEPT_ALL_OP : EXCEPT_OP);
04908: {
04909: if (true)
04910: return expression;
04911: }
04912: break;
04913: default:
04914: jj_la1[84] = jj_gen;
04915: jj_consume_token(-1);
04916: throw new ParseException();
04917: }
04918: throw new Error("Missing return statement in function");
04919: }
04920:
04921: /*
04922: * <A NAME="nonJoinQueryTerm">nonJoinQueryTerm</A>
04923: *
04924: * Be careful with the associativity of INTERSECT. According to the SQL spec
04925: * t1 INTERSECT t2 INTERSECT ALL t3
04926: * is equivalent to
04927: * (t1 INTERSECT t2) INTERSECT ALL t3
04928: * which is not the same as
04929: * t1 INTERSECT (t2 INTERSECT ALL t3)
04930: * See the comment on queryExpression.
04931: */
04932: final public ResultSetNode nonJoinQueryTerm(ResultSetNode leftSide,
04933: int operatorType) throws ParseException, StandardException {
04934: ResultSetNode term;
04935: term = nonJoinQueryPrimary();
04936: switch (jj_nt.kind) {
04937: case INTERSECT:
04938: term = intersect(term);
04939: break;
04940: default:
04941: jj_la1[85] = jj_gen;
04942: ;
04943: }
04944: switch (operatorType) {
04945: case NO_SET_OP: {
04946: if (true)
04947: return term;
04948: }
04949:
04950: case UNION_OP: {
04951: if (true)
04952: return (ResultSetNode) nodeFactory.getNode(
04953: C_NodeTypes.UNION_NODE, leftSide, term,
04954: Boolean.FALSE, Boolean.FALSE, null,
04955: getContextManager());
04956: }
04957:
04958: case UNION_ALL_OP: {
04959: if (true)
04960: return (ResultSetNode) nodeFactory.getNode(
04961: C_NodeTypes.UNION_NODE, leftSide, term,
04962: Boolean.TRUE, Boolean.FALSE, null,
04963: getContextManager());
04964: }
04965:
04966: case EXCEPT_OP: {
04967: if (true)
04968: return (ResultSetNode) nodeFactory
04969: .getNode(
04970: C_NodeTypes.INTERSECT_OR_EXCEPT_NODE,
04971: ReuseFactory
04972: .getInteger(IntersectOrExceptNode.EXCEPT_OP),
04973: leftSide, term, Boolean.FALSE, null,
04974: getContextManager());
04975: }
04976:
04977: case EXCEPT_ALL_OP: {
04978: if (true)
04979: return (ResultSetNode) nodeFactory
04980: .getNode(
04981: C_NodeTypes.INTERSECT_OR_EXCEPT_NODE,
04982: ReuseFactory
04983: .getInteger(IntersectOrExceptNode.EXCEPT_OP),
04984: leftSide, term, Boolean.TRUE, null,
04985: getContextManager());
04986: }
04987:
04988: case INTERSECT_OP: {
04989: if (true)
04990: return (ResultSetNode) nodeFactory
04991: .getNode(
04992: C_NodeTypes.INTERSECT_OR_EXCEPT_NODE,
04993: ReuseFactory
04994: .getInteger(IntersectOrExceptNode.INTERSECT_OP),
04995: leftSide, term, Boolean.FALSE, null,
04996: getContextManager());
04997: }
04998:
04999: case INTERSECT_ALL_OP: {
05000: if (true)
05001: return (ResultSetNode) nodeFactory
05002: .getNode(
05003: C_NodeTypes.INTERSECT_OR_EXCEPT_NODE,
05004: ReuseFactory
05005: .getInteger(IntersectOrExceptNode.INTERSECT_OP),
05006: leftSide, term, Boolean.TRUE, null,
05007: getContextManager());
05008: }
05009:
05010: default:
05011: if (SanityManager.DEBUG) {
05012: SanityManager.THROWASSERT("Invalid set operator type: "
05013: + operatorType);
05014: }
05015: {
05016: if (true)
05017: return null;
05018: }
05019: }
05020: throw new Error("Missing return statement in function");
05021: }
05022:
05023: /*
05024: * <A NAME="intersect">intersect</A>
05025: */
05026: final public ResultSetNode intersect(ResultSetNode term)
05027: throws ParseException, StandardException {
05028: ResultSetNode expression;
05029: Token tok = null;
05030: jj_consume_token(INTERSECT);
05031: switch (jj_nt.kind) {
05032: case ALL:
05033: case DISTINCT:
05034: switch (jj_nt.kind) {
05035: case ALL:
05036: tok = jj_consume_token(ALL);
05037: break;
05038: case DISTINCT:
05039: jj_consume_token(DISTINCT);
05040: break;
05041: default:
05042: jj_la1[86] = jj_gen;
05043: jj_consume_token(-1);
05044: throw new ParseException();
05045: }
05046: break;
05047: default:
05048: jj_la1[87] = jj_gen;
05049: ;
05050: }
05051: expression = nonJoinQueryTerm(term,
05052: (tok != null) ? INTERSECT_ALL_OP : INTERSECT_OP);
05053: {
05054: if (true)
05055: return expression;
05056: }
05057: throw new Error("Missing return statement in function");
05058: }
05059:
05060: /*
05061: * <A NAME="nonJoinQueryPrimary">nonJoinQueryPrimary</A>
05062: */
05063: final public ResultSetNode nonJoinQueryPrimary()
05064: throws ParseException, StandardException {
05065: ResultSetNode primary;
05066: switch (jj_nt.kind) {
05067: case SELECT:
05068: case VALUES:
05069: primary = simpleTable();
05070: {
05071: if (true)
05072: return primary;
05073: }
05074: break;
05075: case LEFT_PAREN:
05076: jj_consume_token(LEFT_PAREN);
05077: primary = queryExpression(null, NO_SET_OP);
05078: jj_consume_token(RIGHT_PAREN);
05079: {
05080: if (true)
05081: return primary;
05082: }
05083: break;
05084: default:
05085: jj_la1[88] = jj_gen;
05086: jj_consume_token(-1);
05087: throw new ParseException();
05088: }
05089: throw new Error("Missing return statement in function");
05090: }
05091:
05092: /*
05093: * <A NAME="simpleTable">simpleTable</A>
05094: */
05095: final public ResultSetNode simpleTable() throws ParseException,
05096: StandardException {
05097: ResultSetNode resultSetNode;
05098: switch (jj_nt.kind) {
05099: case SELECT:
05100: resultSetNode = querySpecification();
05101: {
05102: if (true)
05103: return resultSetNode;
05104: }
05105: break;
05106: case VALUES:
05107: resultSetNode = tableValueConstructor();
05108: {
05109: if (true)
05110: return resultSetNode;
05111: }
05112: break;
05113: default:
05114: jj_la1[89] = jj_gen;
05115: jj_consume_token(-1);
05116: throw new ParseException();
05117: }
05118: throw new Error("Missing return statement in function");
05119: }
05120:
05121: /*
05122: * <A NAME="querySpecification">querySpecification</A>
05123: */
05124: final public ResultSetNode querySpecification()
05125: throws ParseException, StandardException {
05126: ResultColumnList selectList;
05127: SelectNode selectNode;
05128: boolean isDistinct = false;
05129: jj_consume_token(SELECT);
05130: if (jj_2_16(1)) {
05131: isDistinct = setQuantifier();
05132: } else {
05133: ;
05134: }
05135: selectList = selectList();
05136: selectNode = tableExpression(selectList);
05137: if (isDistinct)
05138: selectNode.makeDistinct();
05139: {
05140: if (true)
05141: return selectNode;
05142: }
05143: throw new Error("Missing return statement in function");
05144: }
05145:
05146: /*
05147: * <A NAME="setQuantifier">setQuantifier</A>
05148: */
05149: final public boolean setQuantifier() throws ParseException {
05150: if (getToken(1).kind == DISTINCT
05151: && !(getToken(2).kind == PERIOD || getToken(2).kind == DOUBLE_COLON)) {
05152: jj_consume_token(DISTINCT);
05153: {
05154: if (true)
05155: return true;
05156: }
05157: } else if (getToken(1).kind == ALL
05158: && !(getToken(2).kind == PERIOD || getToken(2).kind == DOUBLE_COLON)) {
05159: jj_consume_token(ALL);
05160: {
05161: if (true)
05162: return false;
05163: }
05164: } else {
05165: jj_consume_token(-1);
05166: throw new ParseException();
05167: }
05168: throw new Error("Missing return statement in function");
05169: }
05170:
05171: /*
05172: * <A NAME="selectList">selectList</A>
05173: */
05174: final public ResultColumnList selectList() throws ParseException,
05175: StandardException {
05176: ResultColumn allResultColumn;
05177: ResultColumnList resultColumns = (ResultColumnList) nodeFactory
05178: .getNode(C_NodeTypes.RESULT_COLUMN_LIST,
05179: getContextManager());
05180: switch (jj_nt.kind) {
05181: case ASTERISK:
05182: jj_consume_token(ASTERISK);
05183: allResultColumn = (ResultColumn) nodeFactory.getNode(
05184: C_NodeTypes.ALL_RESULT_COLUMN, null,
05185: getContextManager());
05186: /* Add the new AllResultColumn to the end of the list */
05187: resultColumns.addResultColumn(allResultColumn);
05188: {
05189: if (true)
05190: return resultColumns;
05191: }
05192: break;
05193: default:
05194: jj_la1[90] = jj_gen;
05195: if (jj_2_17(1)) {
05196: selectColumnList(resultColumns);
05197: {
05198: if (true)
05199: return resultColumns;
05200: }
05201: } else {
05202: jj_consume_token(-1);
05203: throw new ParseException();
05204: }
05205: }
05206: throw new Error("Missing return statement in function");
05207: }
05208:
05209: final public void selectColumnList(ResultColumnList resultColumns)
05210: throws ParseException, StandardException {
05211: selectSublist(resultColumns);
05212: label_9: while (true) {
05213: switch (jj_nt.kind) {
05214: case COMMA:
05215: ;
05216: break;
05217: default:
05218: jj_la1[91] = jj_gen;
05219: break label_9;
05220: }
05221: jj_consume_token(COMMA);
05222: selectSublist(resultColumns);
05223: }
05224: }
05225:
05226: /*
05227: * <A NAME="selectSublist">selectSublist</A>
05228: */
05229: final public void selectSublist(ResultColumnList resultColumns)
05230: throws ParseException, StandardException {
05231: ResultColumn resultColumn;
05232: ResultColumn allResultColumn;
05233: TableName tableName;
05234: if (getToken(2).kind == PERIOD
05235: && (getToken(3).kind == ASTERISK || (getToken(4).kind == PERIOD && getToken(5).kind == ASTERISK))) {
05236: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
05237: jj_consume_token(PERIOD);
05238: jj_consume_token(ASTERISK);
05239: allResultColumn = (ResultColumn) nodeFactory.getNode(
05240: C_NodeTypes.ALL_RESULT_COLUMN, tableName,
05241: getContextManager());
05242: /* Add the new AllResultColumn to the end of the list */
05243: resultColumns.addResultColumn(allResultColumn);
05244: } else if (jj_2_18(1)) {
05245: resultColumn = derivedColumn(resultColumns);
05246: /* Add the new ResultColumn to the end of the list */
05247: resultColumns.addResultColumn(resultColumn);
05248: } else {
05249: jj_consume_token(-1);
05250: throw new ParseException();
05251: }
05252: }
05253:
05254: /*
05255: * <A NAME="derivedColumn">derivedColumn</A>
05256: */
05257: final public ResultColumn derivedColumn(
05258: ResultColumnList resultColumns) throws ParseException,
05259: StandardException {
05260: ValueNode columnExpression;
05261: String columnName = null;
05262: //true to additiveExpression ensures that for the derived columns, we will not allow boolean values inside (),
05263: //eg (2 > 1) should be disallowed in the select clause
05264: columnExpression = additiveExpression(null, 0, true);
05265: switch (jj_nt.kind) {
05266: case AS:
05267: case BINARY:
05268: case COALESCE:
05269: case COUNT:
05270: case D:
05271: case MODULE:
05272: case T:
05273: case TS:
05274: case VALUE:
05275: case VARBINARY:
05276: case ABS:
05277: case ABSVAL:
05278: case ACTION:
05279: case ALWAYS:
05280: case BLOB:
05281: case C:
05282: case CALLED:
05283: case CLOB:
05284: case COBOL:
05285: case COMMITTED:
05286: case CONCAT:
05287: case CONTAINS:
05288: case DATA:
05289: case DATE:
05290: case DAY:
05291: case DYNAMIC:
05292: case FORTRAN:
05293: case GENERATED:
05294: case IDENTITY_VAL_LOCAL:
05295: case INCREMENT:
05296: case INITIAL:
05297: case INTERVAL:
05298: case LANGUAGE:
05299: case LARGE:
05300: case LENGTH:
05301: case LEVEL:
05302: case LOCKS:
05303: case LOCKSIZE:
05304: case LOGGED:
05305: case MOD:
05306: case MODIFIES:
05307: case MODIFY:
05308: case MONTH:
05309: case _MORE:
05310: case MUMPS:
05311: case NAME:
05312: case NCLOB:
05313: case NULLABLE:
05314: case NUMBER:
05315: case OBJECT:
05316: case PASCAL:
05317: case PLI:
05318: case PRECISION:
05319: case RELEASE:
05320: case REPEATABLE:
05321: case RESTART:
05322: case RETURNS:
05323: case ROW:
05324: case SAVEPOINT:
05325: case SCALE:
05326: case SERIALIZABLE:
05327: case SQL_TSI_FRAC_SECOND:
05328: case SQL_TSI_SECOND:
05329: case SQL_TSI_MINUTE:
05330: case SQL_TSI_HOUR:
05331: case SQL_TSI_DAY:
05332: case SQL_TSI_WEEK:
05333: case SQL_TSI_MONTH:
05334: case SQL_TSI_QUARTER:
05335: case SQL_TSI_YEAR:
05336: case START:
05337: case STATEMENT:
05338: case SYNONYM:
05339: case THEN:
05340: case TIME:
05341: case TIMESTAMP:
05342: case TIMESTAMPADD:
05343: case TIMESTAMPDIFF:
05344: case TRUNCATE:
05345: case TYPE:
05346: case UNCOMMITTED:
05347: case USAGE:
05348: case WHEN:
05349: case CURDATE:
05350: case CURTIME:
05351: case DATABASE:
05352: case LONG:
05353: case AFTER:
05354: case BEFORE:
05355: case CLASS:
05356: case COMPRESS:
05357: case CONTENT:
05358: case CS:
05359: case DB2SQL:
05360: case DIRTY:
05361: case DOCUMENT:
05362: case EACH:
05363: case EMPTY:
05364: case EXCLUSIVE:
05365: case FN:
05366: case INDEX:
05367: case JAVA:
05368: case LCASE:
05369: case LOCATE:
05370: case LOCK:
05371: case MESSAGE_LOCALE:
05372: case METHOD:
05373: case MODE:
05374: case NEW:
05375: case NEW_TABLE:
05376: case OJ:
05377: case OFF:
05378: case OLD:
05379: case OLD_TABLE:
05380: case PARAMETER:
05381: case PASSING:
05382: case PROPERTIES:
05383: case READS:
05384: case REF:
05385: case REFERENCING:
05386: case RENAME:
05387: case RESET:
05388: case RESULT:
05389: case RETAIN:
05390: case RETURNING:
05391: case RR:
05392: case RS:
05393: case SEQUENCE:
05394: case SEQUENTIAL:
05395: case SETS:
05396: case SHARE:
05397: case SQLID:
05398: case SPECIFIC:
05399: case SQRT:
05400: case STABILITY:
05401: case STRIP:
05402: case STYLE:
05403: case TRIGGER:
05404: case UCASE:
05405: case UR:
05406: case WHITESPACE:
05407: case IDENTIFIER:
05408: case DELIMITED_IDENTIFIER:
05409: columnName = asClause();
05410: break;
05411: default:
05412: jj_la1[92] = jj_gen;
05413: ;
05414: }
05415: /*
05416: ** If there is no AS clause, and the expression is a simple
05417: ** column, use the name of the column as the result column
05418: ** name.
05419: */
05420: if ((columnName == null)
05421: && (columnExpression instanceof ColumnReference)) {
05422: columnName = ((ColumnReference) columnExpression).columnName;
05423: }
05424:
05425: {
05426: if (true)
05427: return (ResultColumn) nodeFactory.getNode(
05428: C_NodeTypes.RESULT_COLUMN, columnName,
05429: columnExpression, getContextManager());
05430: }
05431: throw new Error("Missing return statement in function");
05432: }
05433:
05434: /*
05435: * <A NAME="asClause">asClause</A>
05436: */
05437: final public String asClause() throws ParseException,
05438: StandardException {
05439: String columnName;
05440: switch (jj_nt.kind) {
05441: case AS:
05442: jj_consume_token(AS);
05443: break;
05444: default:
05445: jj_la1[93] = jj_gen;
05446: ;
05447: }
05448: columnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
05449: {
05450: if (true)
05451: return columnName;
05452: }
05453: throw new Error("Missing return statement in function");
05454: }
05455:
05456: /*
05457: * <A NAME="valueExpression">valueExpression</A>
05458: *
05459: * @param inSelectClause will be true if this method got called while parsing the select or values clause
05460: * If in select or values clause, we do not want to allow boolean values.
05461: */
05462: final public ValueNode valueExpression(boolean inSelectClause)
05463: throws ParseException, StandardException {
05464: ValueNode leftOperand;
05465: leftOperand = orExpression(null, inSelectClause);
05466: label_10: while (true) {
05467: switch (jj_nt.kind) {
05468: case OR:
05469: ;
05470: break;
05471: default:
05472: jj_la1[94] = jj_gen;
05473: break label_10;
05474: }
05475: jj_consume_token(OR);
05476: leftOperand = orExpression(leftOperand, inSelectClause);
05477: }
05478: {
05479: if (true)
05480: return leftOperand;
05481: }
05482: throw new Error("Missing return statement in function");
05483: }
05484:
05485: /*
05486: * <A NAME="orExpression">orExpression</A>
05487: *
05488: * @param inSelectClause will be true if this method got called while parsing the select or values clause
05489: * If in select or values clause, we do not want to allow boolean values.
05490: */
05491: final public ValueNode orExpression(ValueNode farLeftOperand,
05492: boolean inSelectClause) throws ParseException,
05493: StandardException {
05494: ValueNode leftOperand;
05495: leftOperand = andExpression(null, inSelectClause);
05496: label_11: while (true) {
05497: switch (jj_nt.kind) {
05498: case AND:
05499: ;
05500: break;
05501: default:
05502: jj_la1[95] = jj_gen;
05503: break label_11;
05504: }
05505: jj_consume_token(AND);
05506: leftOperand = andExpression(leftOperand, inSelectClause);
05507: }
05508: if (farLeftOperand == null) {
05509: {
05510: if (true)
05511: return leftOperand;
05512: }
05513: } else {
05514: {
05515: if (true)
05516: return (ValueNode) nodeFactory.getNode(
05517: C_NodeTypes.OR_NODE, farLeftOperand,
05518: leftOperand, getContextManager());
05519: }
05520: }
05521: throw new Error("Missing return statement in function");
05522: }
05523:
05524: /*
05525: * <A NAME="andExpression">andExpression</A>
05526: *
05527: * @param inSelectClause will be true if this method got called while parsing the select or values clause
05528: * If in select or values clause, we do not want to allow boolean values.
05529: */
05530: final public ValueNode andExpression(ValueNode farLeftOperand,
05531: boolean inSelectClause) throws ParseException,
05532: StandardException {
05533: Token tok = null;
05534: ValueNode test;
05535: if (getToken(1).kind == NOT
05536: && !(getToken(2).kind == PERIOD || getToken(2).kind == DOUBLE_COLON)) {
05537: tok = jj_consume_token(NOT);
05538: } else {
05539: ;
05540: }
05541: test = isSearchCondition(inSelectClause);
05542: /* Put the NOT on top of test */
05543: if (tok != null) {
05544: test = (ValueNode) nodeFactory.getNode(
05545: C_NodeTypes.NOT_NODE, test, getContextManager());
05546: }
05547:
05548: if (farLeftOperand != null) {
05549: test = (ValueNode) nodeFactory.getNode(
05550: C_NodeTypes.AND_NODE, farLeftOperand, test,
05551: getContextManager());
05552: }
05553: {
05554: if (true)
05555: return test;
05556: }
05557: throw new Error("Missing return statement in function");
05558: }
05559:
05560: /*
05561: * <A NAME="isSearchCondition">isSearchCondition</A>
05562: *
05563: * @param inSelectClause will be true if this method got called while parsing the select or values clause
05564: * If in select or values clause, we do not want to allow boolean values.
05565: */
05566: final public ValueNode isSearchCondition(boolean inSelectClause)
05567: throws ParseException, StandardException {
05568: ValueNode result;
05569: ValueNode booleanPrimary;
05570: Token isToken = null;
05571: Token notToken = null;
05572: Token truthValue = null;
05573: booleanPrimary = booleanPrimary(inSelectClause);
05574: switch (jj_nt.kind) {
05575: case IS:
05576: isToken = jj_consume_token(IS);
05577: switch (jj_nt.kind) {
05578: case NOT:
05579: notToken = jj_consume_token(NOT);
05580: break;
05581: default:
05582: jj_la1[96] = jj_gen;
05583: ;
05584: }
05585: jj_consume_token(NULL);
05586: break;
05587: default:
05588: jj_la1[97] = jj_gen;
05589: ;
05590: }
05591: if (isToken != null) {
05592: result = (ValueNode) nodeFactory.getNode(
05593: C_NodeTypes.IS_NULL_NODE, booleanPrimary,
05594: getContextManager());
05595:
05596: /* Put the NOT on top of the tree */
05597: if (notToken != null) {
05598: result = (ValueNode) nodeFactory.getNode(
05599: C_NodeTypes.NOT_NODE, result,
05600: getContextManager());
05601: }
05602: } else {
05603: result = booleanPrimary;
05604: }
05605:
05606: {
05607: if (true)
05608: return result;
05609: }
05610: throw new Error("Missing return statement in function");
05611: }
05612:
05613: /*
05614: * <A NAME="booleanPrimary">booleanPrimary</A>
05615: *
05616: * @param inSelectClause will be true if this method got called while parsing the select or values clause
05617: * If in select or values clause, we do not want to allow boolean values.
05618: */
05619: final public ValueNode booleanPrimary(boolean inSelectClause)
05620: throws ParseException, StandardException {
05621: ValueNode primary;
05622: ValueNode searchCondition;
05623: primary = predicate(inSelectClause);
05624: {
05625: if (true)
05626: return primary;
05627: }
05628: throw new Error("Missing return statement in function");
05629: }
05630:
05631: /*
05632: * <A NAME="predicate">predicate</A>
05633: *
05634: * @param inSelectClause will be true if this method got called while parsing the select or values clause
05635: * If in select or values clause, we do not want to allow boolean values.
05636: */
05637: final public ValueNode predicate(boolean inSelectClause)
05638: throws ParseException, StandardException {
05639: ValueNode value;
05640: if (jj_2_19(1)) {
05641: value = additiveExpression(null, 0, inSelectClause);
05642: } else {
05643: switch (jj_nt.kind) {
05644: case EXISTS:
05645: value = existsExpression();
05646: break;
05647: default:
05648: jj_la1[98] = jj_gen;
05649: jj_consume_token(-1);
05650: throw new ParseException();
05651: }
05652: }
05653: label_12: while (true) {
05654: if (remainingPredicateFollows()) {
05655: ;
05656: } else {
05657: break label_12;
05658: }
05659: value = remainingPredicate(value, inSelectClause);
05660: }
05661: {
05662: if (true)
05663: return value;
05664: }
05665: throw new Error("Missing return statement in function");
05666: }
05667:
05668: /*
05669: * <A NAME="remainingPredicates">remainingPredicates</A>
05670: *
05671: * @param inSelectClause will be true if this method got called while parsing the select or values clause
05672: * If in select or values clause, we do not want to allow boolean values.
05673: */
05674: final public ValueNode remainingPredicate(ValueNode value,
05675: boolean inSelectClause) throws ParseException,
05676: StandardException {
05677: Token tok = null;
05678: switch (jj_nt.kind) {
05679: case LESS_THAN_OPERATOR:
05680: case LESS_THAN_OR_EQUALS_OPERATOR:
05681: case EQUALS_OPERATOR:
05682: case NOT_EQUALS_OPERATOR:
05683: case NOT_EQUALS_OPERATOR2:
05684: case GREATER_THAN_OPERATOR:
05685: case GREATER_THAN_OR_EQUALS_OPERATOR:
05686: value = remainingNonNegatablePredicate(value,
05687: inSelectClause);
05688: {
05689: if (true)
05690: return value;
05691: }
05692: break;
05693: case BETWEEN:
05694: case IN:
05695: case LIKE:
05696: case NOT:
05697: switch (jj_nt.kind) {
05698: case NOT:
05699: tok = jj_consume_token(NOT);
05700: break;
05701: default:
05702: jj_la1[99] = jj_gen;
05703: ;
05704: }
05705: value = remainingNegatablePredicate(value, inSelectClause);
05706: /* Put the NOT on top of the tree */
05707: if (tok != null) {
05708: value = (ValueNode) nodeFactory.getNode(
05709: C_NodeTypes.NOT_NODE, value,
05710: getContextManager());
05711: }
05712:
05713: {
05714: if (true)
05715: return value;
05716: }
05717: break;
05718: default:
05719: jj_la1[100] = jj_gen;
05720: jj_consume_token(-1);
05721: throw new ParseException();
05722: }
05723: throw new Error("Missing return statement in function");
05724: }
05725:
05726: /*
05727: * <A NAME="remainingNonNegatablePredicate">remainingNonNegatablePredicate</A>
05728: *
05729: * @param inSelectClause will be true if this method got called while parsing the select or values clause
05730: * If in select or values clause, we do not want to allow boolean values.
05731: */
05732: final public ValueNode remainingNonNegatablePredicate(
05733: ValueNode leftOperand, boolean inSelectClause)
05734: throws ParseException, StandardException {
05735: int operator;
05736: String javaClassName;
05737: Token tok = null;
05738: ValueNode tree = null;
05739: ValueNode likePattern;
05740: ValueNode betweenLeft;
05741: ValueNode betweenRight;
05742: operator = compOp();
05743: if ((getToken(1).kind == ALL || getToken(1).kind == ANY || getToken(1).kind == SOME)
05744: && getToken(2).kind == LEFT_PAREN) {
05745: operator = quantifier(operator);
05746: jj_consume_token(LEFT_PAREN);
05747: leftOperand = tableSubquery(operator, leftOperand);
05748: jj_consume_token(RIGHT_PAREN);
05749: } else if (jj_2_20(1)) {
05750: leftOperand = additiveExpression(leftOperand, operator,
05751: inSelectClause);
05752: } else {
05753: jj_consume_token(-1);
05754: throw new ParseException();
05755: }
05756: {
05757: if (true)
05758: return leftOperand;
05759: }
05760: throw new Error("Missing return statement in function");
05761: }
05762:
05763: /*
05764: * <A NAME="remainingNegatablePredicate">remainingNegatablePredicate</A>
05765: *
05766: * @param inSelectClause will be true if this method got called while parsing the select or values clause
05767: * If in select or values clause, we do not want to allow boolean values.
05768: */
05769: final public ValueNode remainingNegatablePredicate(
05770: ValueNode leftOperand, boolean inSelectClause)
05771: throws ParseException, StandardException {
05772: ValueNode tree = null;
05773: ValueNode likePattern;
05774: ValueNode betweenLeft;
05775: ValueNode betweenRight;
05776: ValueNode escapeValue = null;
05777: switch (jj_nt.kind) {
05778: case IN:
05779: jj_consume_token(IN);
05780: tree = inPredicateValue(leftOperand);
05781: {
05782: if (true)
05783: return tree;
05784: }
05785: break;
05786: case LIKE:
05787: jj_consume_token(LIKE);
05788: likePattern = additiveExpression(null, 0, inSelectClause);
05789: switch (jj_nt.kind) {
05790: case ESCAPE:
05791: case LEFT_BRACE:
05792: switch (jj_nt.kind) {
05793: case ESCAPE:
05794: jj_consume_token(ESCAPE);
05795: escapeValue = additiveExpression(null, 0,
05796: inSelectClause);
05797: break;
05798: case LEFT_BRACE:
05799: jj_consume_token(LEFT_BRACE);
05800: jj_consume_token(ESCAPE);
05801: escapeValue = additiveExpression(null, 0,
05802: inSelectClause);
05803: jj_consume_token(RIGHT_BRACE);
05804: break;
05805: default:
05806: jj_la1[101] = jj_gen;
05807: jj_consume_token(-1);
05808: throw new ParseException();
05809: }
05810: break;
05811: default:
05812: jj_la1[102] = jj_gen;
05813: ;
05814: }
05815: tree = (ValueNode) nodeFactory.getNode(
05816: C_NodeTypes.LIKE_OPERATOR_NODE, leftOperand,
05817: likePattern, escapeValue, getContextManager());
05818:
05819: {
05820: if (true)
05821: return tree;
05822: }
05823: break;
05824: case BETWEEN:
05825: jj_consume_token(BETWEEN);
05826: betweenLeft = additiveExpression(null, 0, inSelectClause);
05827: jj_consume_token(AND);
05828: betweenRight = additiveExpression(null, 0, inSelectClause);
05829: ValueNodeList betweenList = (ValueNodeList) nodeFactory
05830: .getNode(C_NodeTypes.VALUE_NODE_LIST,
05831: getContextManager());
05832: betweenList.addElement(betweenLeft);
05833: betweenList.addElement(betweenRight);
05834: tree = (ValueNode) nodeFactory.getNode(
05835: C_NodeTypes.BETWEEN_OPERATOR_NODE, leftOperand,
05836: betweenList, getContextManager());
05837:
05838: {
05839: if (true)
05840: return tree;
05841: }
05842: break;
05843: default:
05844: jj_la1[103] = jj_gen;
05845: jj_consume_token(-1);
05846: throw new ParseException();
05847: }
05848: throw new Error("Missing return statement in function");
05849: }
05850:
05851: /*
05852: * <A NAME="compOp">compOp</A>
05853: */
05854: final public int compOp() throws ParseException, StandardException {
05855: switch (jj_nt.kind) {
05856: case EQUALS_OPERATOR:
05857: jj_consume_token(EQUALS_OPERATOR);
05858: {
05859: if (true)
05860: return BinaryOperatorNode.EQ;
05861: }
05862: break;
05863: case NOT_EQUALS_OPERATOR:
05864: jj_consume_token(NOT_EQUALS_OPERATOR);
05865: {
05866: if (true)
05867: return BinaryOperatorNode.NE;
05868: }
05869: break;
05870: case NOT_EQUALS_OPERATOR2:
05871: jj_consume_token(NOT_EQUALS_OPERATOR2);
05872: {
05873: if (true)
05874: return BinaryOperatorNode.NE;
05875: }
05876: break;
05877: case LESS_THAN_OPERATOR:
05878: jj_consume_token(LESS_THAN_OPERATOR);
05879: {
05880: if (true)
05881: return BinaryOperatorNode.LT;
05882: }
05883: break;
05884: case GREATER_THAN_OPERATOR:
05885: jj_consume_token(GREATER_THAN_OPERATOR);
05886: {
05887: if (true)
05888: return BinaryOperatorNode.GT;
05889: }
05890: break;
05891: case LESS_THAN_OR_EQUALS_OPERATOR:
05892: jj_consume_token(LESS_THAN_OR_EQUALS_OPERATOR);
05893: {
05894: if (true)
05895: return BinaryOperatorNode.LE;
05896: }
05897: break;
05898: case GREATER_THAN_OR_EQUALS_OPERATOR:
05899: jj_consume_token(GREATER_THAN_OR_EQUALS_OPERATOR);
05900: {
05901: if (true)
05902: return BinaryOperatorNode.GE;
05903: }
05904: break;
05905: default:
05906: jj_la1[104] = jj_gen;
05907: jj_consume_token(-1);
05908: throw new ParseException();
05909: }
05910: throw new Error("Missing return statement in function");
05911: }
05912:
05913: /*
05914: * <A NAME="additiveExpression">additiveExpression</A>
05915: *
05916: * @param inSelectClause will be true if this method got called while parsing the select or values clause
05917: * If in select or values clause, we do not want to allow boolean values.
05918: */
05919: final public ValueNode additiveExpression(ValueNode farLeftOperand,
05920: int compOp, boolean inSelectClause) throws ParseException,
05921: StandardException {
05922: ValueNode leftOperand;
05923: int operator;
05924: int nodeType;
05925: leftOperand = multiplicativeExpression(null, 0, inSelectClause);
05926: label_13: while (true) {
05927: switch (jj_nt.kind) {
05928: case PLUS_SIGN:
05929: case MINUS_SIGN:
05930: ;
05931: break;
05932: default:
05933: jj_la1[105] = jj_gen;
05934: break label_13;
05935: }
05936: operator = additiveOperator();
05937: leftOperand = multiplicativeExpression(leftOperand,
05938: operator, inSelectClause);
05939: }
05940: if (farLeftOperand == null) {
05941: if (true)
05942: return leftOperand;
05943: }
05944:
05945: switch (compOp) {
05946: case BinaryOperatorNode.EQ:
05947: nodeType = C_NodeTypes.BINARY_EQUALS_OPERATOR_NODE;
05948: break;
05949:
05950: case BinaryOperatorNode.NE:
05951: nodeType = C_NodeTypes.BINARY_NOT_EQUALS_OPERATOR_NODE;
05952: break;
05953:
05954: case BinaryOperatorNode.LT:
05955: nodeType = C_NodeTypes.BINARY_LESS_THAN_OPERATOR_NODE;
05956: break;
05957:
05958: case BinaryOperatorNode.GT:
05959: nodeType = C_NodeTypes.BINARY_GREATER_THAN_OPERATOR_NODE;
05960: break;
05961:
05962: case BinaryOperatorNode.LE:
05963: nodeType = C_NodeTypes.BINARY_LESS_EQUALS_OPERATOR_NODE;
05964: break;
05965:
05966: case BinaryOperatorNode.GE:
05967: nodeType = C_NodeTypes.BINARY_GREATER_EQUALS_OPERATOR_NODE;
05968: break;
05969:
05970: default:
05971: if (SanityManager.DEBUG)
05972: SanityManager
05973: .THROWASSERT("Unknown comparison operator "
05974: + compOp);
05975: nodeType = 0;
05976: break;
05977: }
05978:
05979: {
05980: if (true)
05981: return (ValueNode) nodeFactory.getNode(nodeType,
05982: farLeftOperand, leftOperand,
05983: getContextManager());
05984: }
05985: throw new Error("Missing return statement in function");
05986: }
05987:
05988: /*
05989: * <A NAME="additiveOperator">additiveOperator</A>
05990: */
05991: final public int additiveOperator() throws ParseException,
05992: StandardException {
05993: Token tok;
05994: switch (jj_nt.kind) {
05995: case PLUS_SIGN:
05996: tok = jj_consume_token(PLUS_SIGN);
05997: {
05998: if (true)
05999: return BinaryOperatorNode.PLUS;
06000: }
06001: break;
06002: case MINUS_SIGN:
06003: tok = jj_consume_token(MINUS_SIGN);
06004: {
06005: if (true)
06006: return BinaryOperatorNode.MINUS;
06007: }
06008: break;
06009: default:
06010: jj_la1[106] = jj_gen;
06011: jj_consume_token(-1);
06012: throw new ParseException();
06013: }
06014: throw new Error("Missing return statement in function");
06015: }
06016:
06017: /*
06018: * <A NAME="multiplicativeExpression">multiplicativeExpression</A>
06019: *
06020: * @param inSelectClause will be true if this method got called while parsing the select or values clause
06021: * If in select or values clause, we do not want to allow boolean values.
06022: */
06023: final public ValueNode multiplicativeExpression(
06024: ValueNode farLeftOperand, int additiveOperator,
06025: boolean inSelectClause) throws ParseException,
06026: StandardException {
06027: ValueNode leftOperand;
06028: int multOp;
06029: leftOperand = unaryExpression(null, 0, inSelectClause);
06030: label_14: while (true) {
06031: switch (jj_nt.kind) {
06032: case ASTERISK:
06033: case SOLIDUS:
06034: case CONCATENATION_OPERATOR:
06035: ;
06036: break;
06037: default:
06038: jj_la1[107] = jj_gen;
06039: break label_14;
06040: }
06041: multOp = multiplicativeOperator();
06042: leftOperand = unaryExpression(leftOperand, multOp,
06043: inSelectClause);
06044: }
06045: if (farLeftOperand == null) {
06046: if (true)
06047: return leftOperand;
06048: }
06049:
06050: switch (additiveOperator) {
06051: case BinaryOperatorNode.PLUS: {
06052: if (true)
06053: return (ValueNode) nodeFactory.getNode(
06054: C_NodeTypes.BINARY_PLUS_OPERATOR_NODE,
06055: farLeftOperand, leftOperand,
06056: getContextManager());
06057: }
06058:
06059: case BinaryOperatorNode.MINUS: {
06060: if (true)
06061: return (ValueNode) nodeFactory.getNode(
06062: C_NodeTypes.BINARY_MINUS_OPERATOR_NODE,
06063: farLeftOperand, leftOperand,
06064: getContextManager());
06065: }
06066:
06067: default:
06068: if (SanityManager.DEBUG)
06069: SanityManager
06070: .THROWASSERT("Unexpected operator value of "
06071: + additiveOperator);
06072: {
06073: if (true)
06074: return null;
06075: }
06076: }
06077: throw new Error("Missing return statement in function");
06078: }
06079:
06080: /*
06081: * <A NAME="multiplicativeOperator">multiplicativeOperator</A>
06082: */
06083: final public int multiplicativeOperator() throws ParseException,
06084: StandardException {
06085: switch (jj_nt.kind) {
06086: case ASTERISK:
06087: jj_consume_token(ASTERISK);
06088: {
06089: if (true)
06090: return BinaryOperatorNode.TIMES;
06091: }
06092: break;
06093: case SOLIDUS:
06094: jj_consume_token(SOLIDUS);
06095: {
06096: if (true)
06097: return BinaryOperatorNode.DIVIDE;
06098: }
06099: break;
06100: case CONCATENATION_OPERATOR:
06101: jj_consume_token(CONCATENATION_OPERATOR);
06102: {
06103: if (true)
06104: return BinaryOperatorNode.CONCATENATE;
06105: }
06106: break;
06107: default:
06108: jj_la1[108] = jj_gen;
06109: jj_consume_token(-1);
06110: throw new ParseException();
06111: }
06112: throw new Error("Missing return statement in function");
06113: }
06114:
06115: /*
06116: * <A NAME="unaryExpression">unaryExpression</A>
06117: *
06118: * @param inSelectClause will be true if this method got called while parsing the select or values clause
06119: * If in select or values clause, we do not want to allow boolean values.
06120: */
06121: final public ValueNode unaryExpression(ValueNode farLeftOperand,
06122: int multiplicativeOperator, boolean inSelectClause)
06123: throws ParseException, StandardException {
06124: ValueNode value;
06125: String sign = null;
06126: int tokKind1;
06127: int tokKind2;
06128: if (((tokKind1 = getToken(1).kind) == PLUS_SIGN || tokKind1 == MINUS_SIGN)
06129: && ((tokKind2 = getToken(2).kind) != EXACT_NUMERIC && tokKind2 != APPROXIMATE_NUMERIC)) {
06130: sign = sign();
06131: } else {
06132: ;
06133: }
06134: value = primaryExpression(inSelectClause);
06135: if ("-".equals(sign)) {
06136: value = (ValueNode) nodeFactory.getNode(
06137: C_NodeTypes.UNARY_MINUS_OPERATOR_NODE, value,
06138: getContextManager());
06139: } else if ("+".equals(sign)) {
06140: value = (ValueNode) nodeFactory.getNode(
06141: C_NodeTypes.UNARY_PLUS_OPERATOR_NODE, value,
06142: getContextManager());
06143: } else if (SanityManager.DEBUG) {
06144: if (sign != null) {
06145: SanityManager.THROWASSERT("Unknown unary operator '"
06146: + sign + "'");
06147: }
06148: }
06149:
06150: {
06151: if (true)
06152: return multOp(farLeftOperand, value,
06153: multiplicativeOperator);
06154: }
06155: throw new Error("Missing return statement in function");
06156: }
06157:
06158: /*
06159: * <A NAME="sign">sign</A>
06160: */
06161: final public String sign() throws ParseException {
06162: Token s;
06163: switch (jj_nt.kind) {
06164: case PLUS_SIGN:
06165: s = jj_consume_token(PLUS_SIGN);
06166: {
06167: if (true)
06168: return s.image;
06169: }
06170: break;
06171: case MINUS_SIGN:
06172: s = jj_consume_token(MINUS_SIGN);
06173: {
06174: if (true)
06175: return s.image;
06176: }
06177: break;
06178: default:
06179: jj_la1[109] = jj_gen;
06180: jj_consume_token(-1);
06181: throw new ParseException();
06182: }
06183: throw new Error("Missing return statement in function");
06184: }
06185:
06186: /*
06187: * <A NAME="primaryExpressionXX">primaryExpressionXX</A>
06188: *
06189: * @param inSelectClause will be true if this method got called while parsing the select or values clause
06190: * If in select or values clause, we do not want to allow boolean values.
06191: */
06192: final public ValueNode primaryExpressionXX(boolean inSelectClause)
06193: throws ParseException, StandardException {
06194: ValueNode value;
06195: value = primary(inSelectClause);
06196: label_15: while (true) {
06197: if (jj_2_21(1)) {
06198: ;
06199: } else {
06200: break label_15;
06201: }
06202: value = nonStaticMethodCallOrFieldAccess(value);
06203: }
06204: {
06205: if (true)
06206: return value;
06207: }
06208: throw new Error("Missing return statement in function");
06209: }
06210:
06211: final public ValueNode nonStaticMethodCallOrFieldAccess(
06212: ValueNode receiver) throws ParseException,
06213: StandardException {
06214: ValueNode value;
06215: value = nonStaticMethodInvocation(receiver);
06216: {
06217: if (true)
06218: return value;
06219: }
06220: throw new Error("Missing return statement in function");
06221: }
06222:
06223: /*
06224: * <A NAME="nonStaticMethodInvocation">nonStaticMethodInvocation</A>
06225: */
06226: final public ValueNode nonStaticMethodInvocation(ValueNode receiver)
06227: throws ParseException, StandardException {
06228: Vector parameterList = new Vector();
06229: MethodCallNode methodNode;
06230: ParameterNode parameterNode;
06231: if (getToken(3).kind == LEFT_PAREN) {
06232: switch (jj_nt.kind) {
06233: case FIELD_REFERENCE:
06234: jj_consume_token(FIELD_REFERENCE);
06235: break;
06236: case PERIOD:
06237: jj_consume_token(PERIOD);
06238: break;
06239: default:
06240: jj_la1[110] = jj_gen;
06241: jj_consume_token(-1);
06242: throw new ParseException();
06243: }
06244: methodNode = methodName(receiver);
06245: methodCallParameterList(parameterList);
06246: /*
06247: ** ? parameters are not allowed for the receiver --
06248: ** unless the receiver is standing in for a named parameter,
06249: ** whose type is therefore known.
06250: */
06251: if (receiver instanceof ParameterNode) {
06252: {
06253: if (true)
06254: throw StandardException.newException(
06255: SQLState.LANG_PARAMETER_RECEIVER,
06256: methodNode.getMethodName());
06257: }
06258: }
06259:
06260: methodNode.addParms(parameterList);
06261:
06262: /*
06263: ** Assume this is being returned to the SQL domain. If it turns
06264: ** out that this is being returned to the Java domain, we will
06265: ** get rid of this node.
06266: */
06267: {
06268: if (true)
06269: return (ValueNode) nodeFactory.getNode(
06270: C_NodeTypes.JAVA_TO_SQL_VALUE_NODE,
06271: methodNode, getContextManager());
06272: }
06273: } else {
06274: switch (jj_nt.kind) {
06275: case PERIOD:
06276: jj_consume_token(PERIOD);
06277: methodNode = methodName(receiver);
06278: /*
06279: ** ? parameters are not allowed for the receiver --
06280: ** unless the receiver is standing in for a named parameter,
06281: ** whose type is therefore known.
06282: */
06283: if (receiver instanceof ParameterNode) {
06284: {
06285: if (true)
06286: throw StandardException.newException(
06287: SQLState.LANG_PARAMETER_RECEIVER,
06288: methodNode.getMethodName());
06289: }
06290: }
06291:
06292: methodNode.addParms(parameterList);
06293:
06294: /*
06295: ** Assume this is being returned to the SQL domain. If it turns
06296: ** out that this is being returned to the Java domain, we will
06297: ** get rid of this node.
06298: */
06299: {
06300: if (true)
06301: return (ValueNode) nodeFactory.getNode(
06302: C_NodeTypes.JAVA_TO_SQL_VALUE_NODE,
06303: methodNode, getContextManager());
06304: }
06305: break;
06306: default:
06307: jj_la1[111] = jj_gen;
06308: jj_consume_token(-1);
06309: throw new ParseException();
06310: }
06311: }
06312: throw new Error("Missing return statement in function");
06313: }
06314:
06315: /*
06316: * <A NAME="methodName">methodName</A>
06317: */
06318: final public MethodCallNode methodName(ValueNode receiver)
06319: throws ParseException, StandardException {
06320: String methodName;
06321: /*
06322: ** NOTE: allowing a delimited identifier as a method name is necessary,
06323: ** because Java is case-sensitive. But this also allows identifiers that
06324: ** do not match Java syntax. This will probably not cause a problem
06325: ** in later phases, like binding and code generation.
06326: */
06327: methodName = caseSensitiveIdentifierPlusReservedWords();
06328: {
06329: if (true)
06330: return (MethodCallNode) nodeFactory.getNode(
06331: C_NodeTypes.NON_STATIC_METHOD_CALL_NODE,
06332: methodName, receiver, getContextManager());
06333: }
06334: throw new Error("Missing return statement in function");
06335: }
06336:
06337: /*
06338: * <A NAME="staticMethodName">staticMethodName</A>
06339: */
06340: final public MethodCallNode staticMethodName(String javaClassName)
06341: throws ParseException, StandardException {
06342: String methodName;
06343: /*
06344: ** NOTE: allowing a delimited identifier as a method name is necessary,
06345: ** because Java is case-sensitive. But this also allows identifiers that
06346: ** do not match Java syntax. This will probably not cause a problem
06347: ** in later phases, like binding and code generation.
06348: */
06349: methodName = caseSensitiveIdentifierPlusReservedWords();
06350: {
06351: if (true)
06352: return (MethodCallNode) nodeFactory.getNode(
06353: C_NodeTypes.STATIC_METHOD_CALL_NODE,
06354: methodName, javaClassName, getContextManager());
06355: }
06356: throw new Error("Missing return statement in function");
06357: }
06358:
06359: /*
06360: * <A NAME="methodParameter">methodParameter</A>
06361: */
06362: final public void methodParameter(Vector parameterList)
06363: throws ParseException, StandardException {
06364: ValueNode parameter;
06365: if (jj_2_22(1)) {
06366: parameter = additiveExpression(null, 0, false);
06367: parameterList.addElement(parameter);
06368: } else {
06369: switch (jj_nt.kind) {
06370: case NULL:
06371: parameter = nullSpecification();
06372: parameterList.addElement(parameter);
06373: break;
06374: default:
06375: jj_la1[112] = jj_gen;
06376: jj_consume_token(-1);
06377: throw new ParseException();
06378: }
06379: }
06380: }
06381:
06382: /*
06383: * <A NAME="primary">primary</A>
06384: *
06385: * @param inSelectClause will be true if this method got called while parsing the select or values clause
06386: * If in select or values clause, we do not want to allow boolean values.
06387: */
06388: final public ValueNode primary(boolean inSelectClause)
06389: throws ParseException, StandardException {
06390: String javaClassName;
06391: ValueNode value;
06392: if (javaClassFollows()) {
06393: value = staticClassReference();
06394: {
06395: if (true)
06396: return value;
06397: }
06398: } else if (jj_2_23(1)) {
06399: value = valueExpressionPrimary(inSelectClause);
06400: {
06401: if (true)
06402: return value;
06403: }
06404: } else {
06405: jj_consume_token(-1);
06406: throw new ParseException();
06407: }
06408: throw new Error("Missing return statement in function");
06409: }
06410:
06411: /*
06412: * <A NAME="staticClassReference">staticClassReference</A>
06413: */
06414: final public ValueNode staticClassReference()
06415: throws ParseException, StandardException {
06416: String javaClassName;
06417: ValueNode value;
06418: javaClassName = javaClass();
06419: jj_consume_token(DOUBLE_COLON);
06420: value = staticClassReferenceType(javaClassName);
06421: {
06422: if (true)
06423: return value;
06424: }
06425: throw new Error("Missing return statement in function");
06426: }
06427:
06428: /*
06429: * <A NAME="staticClassReferenceType">staticClassReferenceType</A>
06430: */
06431: final public ValueNode staticClassReferenceType(String javaClassName)
06432: throws ParseException, StandardException {
06433: ValueNode value;
06434: if ((getToken(2).kind == LEFT_PAREN)) {
06435: value = staticMethodInvocation(javaClassName);
06436: {
06437: if (true)
06438: return value;
06439: }
06440: } else {
06441: switch (jj_nt.kind) {
06442: case ADD:
06443: case ALL:
06444: case ALLOCATE:
06445: case ALTER:
06446: case AND:
06447: case ANY:
06448: case ARE:
06449: case AS:
06450: case ASC:
06451: case ASSERTION:
06452: case AT:
06453: case AUTHORIZATION:
06454: case AVG:
06455: case BEGIN:
06456: case BETWEEN:
06457: case BINARY:
06458: case BIT:
06459: case BOTH:
06460: case BY:
06461: case CASCADE:
06462: case CASCADED:
06463: case CASE:
06464: case CAST:
06465: case CHAR:
06466: case CHARACTER:
06467: case CHECK:
06468: case CLOSE:
06469: case COALESCE:
06470: case COLLATE:
06471: case COLLATION:
06472: case COLUMN:
06473: case COMMIT:
06474: case CONNECT:
06475: case CONNECTION:
06476: case CONSTRAINT:
06477: case CONSTRAINTS:
06478: case CONTINUE:
06479: case CONVERT:
06480: case CORRESPONDING:
06481: case COUNT:
06482: case CREATE:
06483: case CURRENT:
06484: case CURRENT_DATE:
06485: case CURRENT_TIME:
06486: case CURRENT_TIMESTAMP:
06487: case CURRENT_USER:
06488: case CURSOR:
06489: case D:
06490: case DEALLOCATE:
06491: case DEC:
06492: case DECIMAL:
06493: case DECLARE:
06494: case _DEFAULT:
06495: case DEFERRABLE:
06496: case DEFERRED:
06497: case DELETE:
06498: case DESC:
06499: case DESCRIBE:
06500: case DIAGNOSTICS:
06501: case DISCONNECT:
06502: case DISTINCT:
06503: case DOUBLE:
06504: case DROP:
06505: case ELSE:
06506: case END:
06507: case ENDEXEC:
06508: case ESCAPE:
06509: case EXCEPT:
06510: case EXCEPTION:
06511: case EXEC:
06512: case EXECUTE:
06513: case EXISTS:
06514: case EXTERNAL:
06515: case FALSE:
06516: case FETCH:
06517: case FIRST:
06518: case FLOAT:
06519: case FOR:
06520: case FOREIGN:
06521: case FOUND:
06522: case FROM:
06523: case FULL:
06524: case FUNCTION:
06525: case GET:
06526: case GLOBAL:
06527: case GO:
06528: case GOTO:
06529: case GRANT:
06530: case GROUP:
06531: case HAVING:
06532: case HOUR:
06533: case IDENTITY:
06534: case IMMEDIATE:
06535: case IN:
06536: case INDICATOR:
06537: case INITIALLY:
06538: case INNER:
06539: case INPUT:
06540: case INSENSITIVE:
06541: case INSERT:
06542: case INT:
06543: case INTEGER:
06544: case INTERSECT:
06545: case INTO:
06546: case IS:
06547: case ISOLATION:
06548: case JOIN:
06549: case KEY:
06550: case LAST:
06551: case LEFT:
06552: case LIKE:
06553: case LOWER:
06554: case MATCH:
06555: case MAX:
06556: case MIN:
06557: case MINUTE:
06558: case MODULE:
06559: case NATIONAL:
06560: case NATURAL:
06561: case NCHAR:
06562: case NEXT:
06563: case NO:
06564: case NOT:
06565: case NULL:
06566: case NULLIF:
06567: case NUMERIC:
06568: case OF:
06569: case ON:
06570: case ONLY:
06571: case OPEN:
06572: case OPTION:
06573: case OR:
06574: case ORDER:
06575: case OUTER:
06576: case OUTPUT:
06577: case OVERLAPS:
06578: case PAD:
06579: case PARTIAL:
06580: case PREPARE:
06581: case PRESERVE:
06582: case PRIMARY:
06583: case PRIOR:
06584: case PRIVILEGES:
06585: case PROCEDURE:
06586: case PUBLIC:
06587: case READ:
06588: case REAL:
06589: case REFERENCES:
06590: case RELATIVE:
06591: case RESTRICT:
06592: case REVOKE:
06593: case RIGHT:
06594: case ROLLBACK:
06595: case ROWS:
06596: case SCHEMA:
06597: case SCROLL:
06598: case SECOND:
06599: case SELECT:
06600: case SESSION_USER:
06601: case SET:
06602: case SMALLINT:
06603: case SOME:
06604: case SPACE:
06605: case SQL:
06606: case SQLCODE:
06607: case SQLERROR:
06608: case SQLSTATE:
06609: case SUBSTRING:
06610: case SUM:
06611: case SYSTEM_USER:
06612: case T:
06613: case TABLE:
06614: case TEMPORARY:
06615: case TIMEZONE_HOUR:
06616: case TIMEZONE_MINUTE:
06617: case TO:
06618: case TRANSACTION:
06619: case TRANSLATE:
06620: case TRANSLATION:
06621: case TRUE:
06622: case TS:
06623: case UNION:
06624: case UNIQUE:
06625: case UNKNOWN:
06626: case UPDATE:
06627: case UPPER:
06628: case USER:
06629: case USING:
06630: case VALUE:
06631: case VALUES:
06632: case VARBINARY:
06633: case VARCHAR:
06634: case VARYING:
06635: case VIEW:
06636: case WHENEVER:
06637: case WHERE:
06638: case WITH:
06639: case WORK:
06640: case WRITE:
06641: case YEAR:
06642: case ABS:
06643: case ABSVAL:
06644: case ACTION:
06645: case ALWAYS:
06646: case BLOB:
06647: case C:
06648: case CALLED:
06649: case CLOB:
06650: case COBOL:
06651: case COMMITTED:
06652: case CONCAT:
06653: case CONTAINS:
06654: case DATA:
06655: case DATE:
06656: case DAY:
06657: case DYNAMIC:
06658: case FORTRAN:
06659: case GENERATED:
06660: case IDENTITY_VAL_LOCAL:
06661: case INCREMENT:
06662: case INITIAL:
06663: case INOUT:
06664: case INTERVAL:
06665: case LANGUAGE:
06666: case LARGE:
06667: case LENGTH:
06668: case LEVEL:
06669: case LOCKS:
06670: case LOCKSIZE:
06671: case LOGGED:
06672: case MOD:
06673: case MODIFIES:
06674: case MODIFY:
06675: case MONTH:
06676: case _MORE:
06677: case MUMPS:
06678: case NAME:
06679: case NCLOB:
06680: case NULLABLE:
06681: case NUMBER:
06682: case OBJECT:
06683: case PASCAL:
06684: case PLI:
06685: case PRECISION:
06686: case RELEASE:
06687: case REPEATABLE:
06688: case RESTART:
06689: case RETURNS:
06690: case ROW:
06691: case SAVEPOINT:
06692: case SCALE:
06693: case SERIALIZABLE:
06694: case SQL_TSI_FRAC_SECOND:
06695: case SQL_TSI_SECOND:
06696: case SQL_TSI_MINUTE:
06697: case SQL_TSI_HOUR:
06698: case SQL_TSI_DAY:
06699: case SQL_TSI_WEEK:
06700: case SQL_TSI_MONTH:
06701: case SQL_TSI_QUARTER:
06702: case SQL_TSI_YEAR:
06703: case START:
06704: case STATEMENT:
06705: case SYNONYM:
06706: case THEN:
06707: case TIME:
06708: case TIMESTAMP:
06709: case TIMESTAMPADD:
06710: case TIMESTAMPDIFF:
06711: case TRUNCATE:
06712: case TYPE:
06713: case UNCOMMITTED:
06714: case USAGE:
06715: case WHEN:
06716: case BOOLEAN:
06717: case CALL:
06718: case CURDATE:
06719: case CURTIME:
06720: case DATABASE:
06721: case GET_CURRENT_CONNECTION:
06722: case EXPLAIN:
06723: case LONGINT:
06724: case LONG:
06725: case LTRIM:
06726: case RTRIM:
06727: case SUBSTR:
06728: case XML:
06729: case XMLEXISTS:
06730: case XMLPARSE:
06731: case XMLQUERY:
06732: case XMLSERIALIZE:
06733: case AFTER:
06734: case BEFORE:
06735: case CLASS:
06736: case COMPRESS:
06737: case CONTENT:
06738: case CS:
06739: case DB2SQL:
06740: case DIRTY:
06741: case DOCUMENT:
06742: case EACH:
06743: case EMPTY:
06744: case EXCLUSIVE:
06745: case FN:
06746: case INDEX:
06747: case JAVA:
06748: case LCASE:
06749: case LOCATE:
06750: case LOCK:
06751: case MESSAGE_LOCALE:
06752: case METHOD:
06753: case MODE:
06754: case NEW:
06755: case NEW_TABLE:
06756: case NVARCHAR:
06757: case OJ:
06758: case OFF:
06759: case OLD:
06760: case OLD_TABLE:
06761: case OUT:
06762: case PARAMETER:
06763: case PASSING:
06764: case PROPERTIES:
06765: case READS:
06766: case REF:
06767: case REFERENCING:
06768: case RENAME:
06769: case RESET:
06770: case RESULT:
06771: case RETAIN:
06772: case RETURNING:
06773: case RR:
06774: case RS:
06775: case SEQUENCE:
06776: case SEQUENTIAL:
06777: case SETS:
06778: case SHARE:
06779: case SQLID:
06780: case SPECIFIC:
06781: case SQRT:
06782: case STABILITY:
06783: case STRIP:
06784: case STYLE:
06785: case TRIGGER:
06786: case UCASE:
06787: case UR:
06788: case WHITESPACE:
06789: case IDENTIFIER:
06790: case DELIMITED_IDENTIFIER:
06791: value = staticClassFieldReference(javaClassName);
06792: {
06793: if (true)
06794: return value;
06795: }
06796: break;
06797: default:
06798: jj_la1[113] = jj_gen;
06799: jj_consume_token(-1);
06800: throw new ParseException();
06801: }
06802: }
06803: throw new Error("Missing return statement in function");
06804: }
06805:
06806: /*
06807: * <A NAME="staticClassFieldReference">staticClassFieldReference</A>
06808: */
06809: final public ValueNode staticClassFieldReference(
06810: String javaClassName) throws ParseException,
06811: StandardException {
06812: String fieldName = null;
06813: fieldName = caseSensitiveIdentifierPlusReservedWords();
06814: {
06815: if (true)
06816: return (ValueNode) nodeFactory
06817: .getNode(
06818: C_NodeTypes.JAVA_TO_SQL_VALUE_NODE,
06819: nodeFactory
06820: .getNode(
06821: C_NodeTypes.STATIC_CLASS_FIELD_REFERENCE_NODE,
06822: javaClassName,
06823: fieldName,
06824: nextToLastTokenDelimitedIdentifier,
06825: getContextManager()),
06826: getContextManager());
06827: }
06828: throw new Error("Missing return statement in function");
06829: }
06830:
06831: /*
06832: * <A NAME="nonSecondDatetimeField">nonSecondDatetimeField</A>
06833: */
06834: final public int nonSecondDatetimeField() throws ParseException {
06835: switch (jj_nt.kind) {
06836: case YEAR:
06837: jj_consume_token(YEAR);
06838: {
06839: if (true)
06840: return DateTimeDataValue.YEAR_FIELD;
06841: }
06842: break;
06843: case MONTH:
06844: jj_consume_token(MONTH);
06845: {
06846: if (true)
06847: return DateTimeDataValue.MONTH_FIELD;
06848: }
06849: break;
06850: case DAY:
06851: jj_consume_token(DAY);
06852: {
06853: if (true)
06854: return DateTimeDataValue.DAY_FIELD;
06855: }
06856: break;
06857: case HOUR:
06858: jj_consume_token(HOUR);
06859: {
06860: if (true)
06861: return DateTimeDataValue.HOUR_FIELD;
06862: }
06863: break;
06864: case MINUTE:
06865: jj_consume_token(MINUTE);
06866: {
06867: if (true)
06868: return DateTimeDataValue.MINUTE_FIELD;
06869: }
06870: break;
06871: default:
06872: jj_la1[114] = jj_gen;
06873: jj_consume_token(-1);
06874: throw new ParseException();
06875: }
06876: throw new Error("Missing return statement in function");
06877: }
06878:
06879: final public ValueNode escapedValueFunction()
06880: throws ParseException, StandardException {
06881: ValueNode value;
06882: ValueNode str1;
06883: ValueNode str2;
06884: ValueNode startPosition;
06885: ValueNode length = null;
06886: if (jj_2_24(1)) {
06887: value = miscBuiltinsCore(true /* is JDBC escape */);
06888: {
06889: if (true)
06890: return value;
06891: }
06892: } else {
06893: switch (jj_nt.kind) {
06894: case SUBSTRING:
06895: jj_consume_token(SUBSTRING);
06896: jj_consume_token(LEFT_PAREN);
06897: value = additiveExpression(null, 0, false);
06898: jj_consume_token(COMMA);
06899: startPosition = additiveExpression(null, 0, false);
06900: switch (jj_nt.kind) {
06901: case COMMA:
06902: jj_consume_token(COMMA);
06903: length = additiveExpression(null, 0, false);
06904: break;
06905: default:
06906: jj_la1[115] = jj_gen;
06907: ;
06908: }
06909: jj_consume_token(RIGHT_PAREN);
06910: {
06911: if (true)
06912: return getSubstringNode(value, startPosition,
06913: length, Boolean.FALSE);
06914: }
06915: break;
06916: case CURDATE:
06917: jj_consume_token(CURDATE);
06918: jj_consume_token(LEFT_PAREN);
06919: jj_consume_token(RIGHT_PAREN);
06920: {
06921: if (true)
06922: return (ValueNode) nodeFactory
06923: .getNode(
06924: C_NodeTypes.CURRENT_DATETIME_OPERATOR_NODE,
06925: ReuseFactory
06926: .getInteger(CurrentDatetimeOperatorNode.CURRENT_DATE),
06927: getContextManager());
06928: }
06929: break;
06930: case CURTIME:
06931: jj_consume_token(CURTIME);
06932: jj_consume_token(LEFT_PAREN);
06933: jj_consume_token(RIGHT_PAREN);
06934: {
06935: if (true)
06936: return (ValueNode) nodeFactory
06937: .getNode(
06938: C_NodeTypes.CURRENT_DATETIME_OPERATOR_NODE,
06939: ReuseFactory
06940: .getInteger(CurrentDatetimeOperatorNode.CURRENT_TIME),
06941: getContextManager());
06942: }
06943: break;
06944: case CONCAT:
06945: jj_consume_token(CONCAT);
06946: jj_consume_token(LEFT_PAREN);
06947: str1 = additiveExpression(null, 0, false);
06948: jj_consume_token(COMMA);
06949: str2 = additiveExpression(null, 0, false);
06950: jj_consume_token(RIGHT_PAREN);
06951: {
06952: if (true)
06953: return (ValueNode) nodeFactory
06954: .getNode(
06955: C_NodeTypes.CONCATENATION_OPERATOR_NODE,
06956: str1, str2, getContextManager());
06957: }
06958: break;
06959: case CURRENT_USER:
06960: case SESSION_USER:
06961: case USER:
06962: /* Method versions of USER special registers
06963: * are ODBC remnants. Only supported
06964: * when escaped.
06965: */
06966: value = userNode();
06967: jj_consume_token(LEFT_PAREN);
06968: jj_consume_token(RIGHT_PAREN);
06969: {
06970: if (true)
06971: return value;
06972: }
06973: break;
06974: case TIMESTAMPADD:
06975: case TIMESTAMPDIFF:
06976: value = timestampArithmeticFuncion();
06977: {
06978: if (true)
06979: return value;
06980: }
06981: break;
06982: default:
06983: jj_la1[116] = jj_gen;
06984: if (getEscapedSYSFUN(getToken(1).image) != null) {
06985: value = escapedSYSFUNFunction();
06986: {
06987: if (true)
06988: return value;
06989: }
06990: } else {
06991: jj_consume_token(-1);
06992: throw new ParseException();
06993: }
06994: }
06995: }
06996: throw new Error("Missing return statement in function");
06997: }
06998:
06999: /*
07000: * <A NAME="numericValueFunction">numericValueFunction</A>
07001: */
07002: final public ValueNode escapedSYSFUNFunction()
07003: throws ParseException, StandardException {
07004: Vector parameterList = new Vector();
07005: Token tok;
07006: tok = jj_consume_token(IDENTIFIER);
07007: methodCallParameterList(parameterList);
07008: String sysFunName = getEscapedSYSFUN(tok.image);
07009:
07010: TableName functionName = (TableName) nodeFactory.getNode(
07011: C_NodeTypes.TABLE_NAME,
07012: SchemaDescriptor.IBM_SYSTEM_FUN_SCHEMA_NAME,
07013: sysFunName, new Integer(0), new Integer(0),
07014: getContextManager());
07015:
07016: MethodCallNode methodNode = (MethodCallNode) nodeFactory
07017: .getNode(C_NodeTypes.STATIC_METHOD_CALL_NODE,
07018: functionName, null, getContextManager());
07019:
07020: methodNode.addParms(parameterList);
07021:
07022: /*
07023: ** Assume this is being returned to the SQL domain. If it turns
07024: ** out that this is being returned to the Java domain, we will
07025: ** get rid of this node.
07026: */
07027: {
07028: if (true)
07029: return (ValueNode) nodeFactory.getNode(
07030: C_NodeTypes.JAVA_TO_SQL_VALUE_NODE, methodNode,
07031: getContextManager());
07032: }
07033: throw new Error("Missing return statement in function");
07034: }
07035:
07036: /*
07037: * <A NAME="timestampArithmeticFuncion">timestampArithmeticFuncion</A>
07038: */
07039: final public ValueNode timestampArithmeticFuncion()
07040: throws ParseException, StandardException {
07041: ValueNode intervalType;
07042: ValueNode tstamp1;
07043: ValueNode tstamp2;
07044: ValueNode count;
07045: switch (jj_nt.kind) {
07046: case TIMESTAMPADD:
07047: jj_consume_token(TIMESTAMPADD);
07048: jj_consume_token(LEFT_PAREN);
07049: intervalType = jdbcIntervalType();
07050: jj_consume_token(COMMA);
07051: count = additiveExpression(null, 0, false);
07052: jj_consume_token(COMMA);
07053: tstamp1 = additiveExpression(null, 0, false);
07054: jj_consume_token(RIGHT_PAREN);
07055: {
07056: if (true)
07057: return (ValueNode) nodeFactory
07058: .getNode(
07059: C_NodeTypes.TIMESTAMP_ADD_FN_NODE,
07060: tstamp1,
07061: intervalType,
07062: count,
07063: ReuseFactory
07064: .getInteger(TernaryOperatorNode.TIMESTAMPADD),
07065: null, getContextManager());
07066: }
07067: break;
07068: case TIMESTAMPDIFF:
07069: jj_consume_token(TIMESTAMPDIFF);
07070: jj_consume_token(LEFT_PAREN);
07071: intervalType = jdbcIntervalType();
07072: jj_consume_token(COMMA);
07073: tstamp1 = additiveExpression(null, 0, false);
07074: jj_consume_token(COMMA);
07075: tstamp2 = additiveExpression(null, 0, false);
07076: jj_consume_token(RIGHT_PAREN);
07077: {
07078: if (true)
07079: return (ValueNode) nodeFactory
07080: .getNode(
07081: C_NodeTypes.TIMESTAMP_DIFF_FN_NODE,
07082: tstamp2,
07083: intervalType,
07084: tstamp1,
07085: ReuseFactory
07086: .getInteger(TernaryOperatorNode.TIMESTAMPDIFF),
07087: null, getContextManager());
07088: }
07089: break;
07090: default:
07091: jj_la1[117] = jj_gen;
07092: jj_consume_token(-1);
07093: throw new ParseException();
07094: }
07095: throw new Error("Missing return statement in function");
07096: }
07097:
07098: /*
07099: * <A NAME="jdbcIntervalType">jdbcIntervalType</A>
07100: */
07101: final public ValueNode jdbcIntervalType() throws ParseException,
07102: StandardException {
07103: switch (jj_nt.kind) {
07104: case SQL_TSI_FRAC_SECOND:
07105: jj_consume_token(SQL_TSI_FRAC_SECOND);
07106: {
07107: if (true)
07108: return getJdbcIntervalNode(DateTimeDataValue.FRAC_SECOND_INTERVAL);
07109: }
07110: break;
07111: case SQL_TSI_SECOND:
07112: jj_consume_token(SQL_TSI_SECOND);
07113: {
07114: if (true)
07115: return getJdbcIntervalNode(DateTimeDataValue.SECOND_INTERVAL);
07116: }
07117: break;
07118: case SQL_TSI_MINUTE:
07119: jj_consume_token(SQL_TSI_MINUTE);
07120: {
07121: if (true)
07122: return getJdbcIntervalNode(DateTimeDataValue.MINUTE_INTERVAL);
07123: }
07124: break;
07125: case SQL_TSI_HOUR:
07126: jj_consume_token(SQL_TSI_HOUR);
07127: {
07128: if (true)
07129: return getJdbcIntervalNode(DateTimeDataValue.HOUR_INTERVAL);
07130: }
07131: break;
07132: case SQL_TSI_DAY:
07133: jj_consume_token(SQL_TSI_DAY);
07134: {
07135: if (true)
07136: return getJdbcIntervalNode(DateTimeDataValue.DAY_INTERVAL);
07137: }
07138: break;
07139: case SQL_TSI_WEEK:
07140: jj_consume_token(SQL_TSI_WEEK);
07141: {
07142: if (true)
07143: return getJdbcIntervalNode(DateTimeDataValue.WEEK_INTERVAL);
07144: }
07145: break;
07146: case SQL_TSI_MONTH:
07147: jj_consume_token(SQL_TSI_MONTH);
07148: {
07149: if (true)
07150: return getJdbcIntervalNode(DateTimeDataValue.MONTH_INTERVAL);
07151: }
07152: break;
07153: case SQL_TSI_QUARTER:
07154: jj_consume_token(SQL_TSI_QUARTER);
07155: {
07156: if (true)
07157: return getJdbcIntervalNode(DateTimeDataValue.QUARTER_INTERVAL);
07158: }
07159: break;
07160: case SQL_TSI_YEAR:
07161: jj_consume_token(SQL_TSI_YEAR);
07162: {
07163: if (true)
07164: return getJdbcIntervalNode(DateTimeDataValue.YEAR_INTERVAL);
07165: }
07166: break;
07167: default:
07168: jj_la1[118] = jj_gen;
07169: jj_consume_token(-1);
07170: throw new ParseException();
07171: }
07172: throw new Error("Missing return statement in function");
07173: }
07174:
07175: /*
07176: * <A NAME="numericValueFunction">numericValueFunction</A>
07177: */
07178: final public ValueNode numericValueFunction()
07179: throws ParseException, StandardException {
07180: ValueNode value;
07181: int field;
07182: switch (jj_nt.kind) {
07183: case ABS:
07184: jj_consume_token(ABS);
07185: value = absFunction();
07186: {
07187: if (true)
07188: return value;
07189: }
07190: break;
07191: case ABSVAL:
07192: jj_consume_token(ABSVAL);
07193: value = absFunction();
07194: {
07195: if (true)
07196: return value;
07197: }
07198: break;
07199: case SQRT:
07200: jj_consume_token(SQRT);
07201: jj_consume_token(LEFT_PAREN);
07202: value = additiveExpression(null, 0, false);
07203: jj_consume_token(RIGHT_PAREN);
07204: {
07205: if (true)
07206: return (ValueNode) nodeFactory.getNode(
07207: C_NodeTypes.SQRT_OPERATOR_NODE, value,
07208: getContextManager());
07209: }
07210: break;
07211: case MOD:
07212: jj_consume_token(MOD);
07213: value = modFunction();
07214: {
07215: if (true)
07216: return value;
07217: }
07218: break;
07219: case IDENTITY_VAL_LOCAL:
07220: jj_consume_token(IDENTITY_VAL_LOCAL);
07221: jj_consume_token(LEFT_PAREN);
07222: jj_consume_token(RIGHT_PAREN);
07223: {
07224: if (true)
07225: return (ValueNode) nodeFactory.getNode(
07226: C_NodeTypes.IDENTITY_VAL_NODE,
07227: getContextManager());
07228: }
07229: break;
07230: default:
07231: jj_la1[119] = jj_gen;
07232: jj_consume_token(-1);
07233: throw new ParseException();
07234: }
07235: throw new Error("Missing return statement in function");
07236: }
07237:
07238: /*
07239: * <A NAME="coalesceFunction">coalesceFunction</A>
07240: */
07241: final public ValueNode coalesceFunction(String coalesceOrValue)
07242: throws ParseException, StandardException {
07243: ValueNodeList expressionList = (ValueNodeList) nodeFactory
07244: .getNode(C_NodeTypes.VALUE_NODE_LIST,
07245: getContextManager());
07246: jj_consume_token(LEFT_PAREN);
07247: coalesceExpression(expressionList);
07248: label_16: while (true) {
07249: switch (jj_nt.kind) {
07250: case COMMA:
07251: ;
07252: break;
07253: default:
07254: jj_la1[120] = jj_gen;
07255: break label_16;
07256: }
07257: jj_consume_token(COMMA);
07258: coalesceExpression(expressionList);
07259: }
07260: jj_consume_token(RIGHT_PAREN);
07261: {
07262: if (true)
07263: return (ValueNode) nodeFactory.getNode(
07264: C_NodeTypes.COALESCE_FUNCTION_NODE,
07265: coalesceOrValue, expressionList,
07266: getContextManager());
07267: }
07268: throw new Error("Missing return statement in function");
07269: }
07270:
07271: /*
07272: * <A NAME="coalesceExpression">coalesceExpression</A>
07273: */
07274: final public void coalesceExpression(ValueNodeList expressionList)
07275: throws ParseException, StandardException {
07276: ValueNode expression;
07277: expression = additiveExpression(null, 0, false);
07278: expressionList.addElement(expression);
07279: }
07280:
07281: /*
07282: * <A NAME="absFunction">absFunction</A>
07283: */
07284: final public ValueNode absFunction() throws ParseException,
07285: StandardException {
07286: ValueNode value;
07287: jj_consume_token(LEFT_PAREN);
07288: value = additiveExpression(null, 0, false);
07289: jj_consume_token(RIGHT_PAREN);
07290: {
07291: if (true)
07292: return (ValueNode) nodeFactory.getNode(
07293: C_NodeTypes.ABSOLUTE_OPERATOR_NODE, value,
07294: getContextManager());
07295: }
07296: throw new Error("Missing return statement in function");
07297: }
07298:
07299: /*
07300: * <A NAME="modFunction">modFunction</A>
07301: */
07302: final public ValueNode modFunction() throws ParseException,
07303: StandardException {
07304: ValueNode int1;
07305: ValueNode int2;
07306: jj_consume_token(LEFT_PAREN);
07307: int1 = additiveExpression(null, 0, false);
07308: jj_consume_token(COMMA);
07309: int2 = additiveExpression(null, 0, false);
07310: jj_consume_token(RIGHT_PAREN);
07311: {
07312: if (true)
07313: return (ValueNode) nodeFactory.getNode(
07314: C_NodeTypes.MOD_OPERATOR_NODE, int1, int2,
07315: getContextManager());
07316: }
07317: throw new Error("Missing return statement in function");
07318: }
07319:
07320: /*
07321: * <A NAME="datetimeField">datetimeField</A>
07322: */
07323: final public int datetimeField() throws ParseException {
07324: int field;
07325: switch (jj_nt.kind) {
07326: case HOUR:
07327: case MINUTE:
07328: case YEAR:
07329: case DAY:
07330: case MONTH:
07331: field = nonSecondDatetimeField();
07332: {
07333: if (true)
07334: return field;
07335: }
07336: break;
07337: case SECOND:
07338: jj_consume_token(SECOND);
07339: {
07340: if (true)
07341: return DateTimeDataValue.SECOND_FIELD;
07342: }
07343: break;
07344: default:
07345: jj_la1[121] = jj_gen;
07346: jj_consume_token(-1);
07347: throw new ParseException();
07348: }
07349: throw new Error("Missing return statement in function");
07350: }
07351:
07352: final public ValueNode characterValueFunction()
07353: throws ParseException, StandardException {
07354: ValueNode value = null;
07355: ValueNode str1;
07356: ValueNode str2;
07357: Token upperTok = null;
07358: Token lowerTok = null;
07359: ValueNode startPosition;
07360: ValueNode length = null;
07361: switch (jj_nt.kind) {
07362: case SUBSTR:
07363: jj_consume_token(SUBSTR);
07364: jj_consume_token(LEFT_PAREN);
07365: value = additiveExpression(null, 0, false);
07366: jj_consume_token(COMMA);
07367: startPosition = additiveExpression(null, 0, false);
07368: switch (jj_nt.kind) {
07369: case COMMA:
07370: jj_consume_token(COMMA);
07371: length = additiveExpression(null, 0, false);
07372: break;
07373: default:
07374: jj_la1[122] = jj_gen;
07375: ;
07376: }
07377: jj_consume_token(RIGHT_PAREN);
07378: {
07379: if (true)
07380: return getSubstringNode(value, startPosition,
07381: length, Boolean.FALSE);
07382: }
07383: break;
07384: case LOWER:
07385: case UPPER:
07386: switch (jj_nt.kind) {
07387: case UPPER:
07388: upperTok = jj_consume_token(UPPER);
07389: break;
07390: case LOWER:
07391: lowerTok = jj_consume_token(LOWER);
07392: break;
07393: default:
07394: jj_la1[123] = jj_gen;
07395: jj_consume_token(-1);
07396: throw new ParseException();
07397: }
07398: jj_consume_token(LEFT_PAREN);
07399: value = additiveExpression(null, 0, false);
07400: jj_consume_token(RIGHT_PAREN);
07401: {
07402: if (true)
07403: return (ValueNode) nodeFactory.getNode(
07404: C_NodeTypes.SIMPLE_STRING_OPERATOR_NODE,
07405: value, (upperTok != null) ? "upper"
07406: : "lower", getContextManager());
07407: }
07408: break;
07409: case LCASE:
07410: case UCASE:
07411: switch (jj_nt.kind) {
07412: case UCASE:
07413: upperTok = jj_consume_token(UCASE);
07414: break;
07415: case LCASE:
07416: lowerTok = jj_consume_token(LCASE);
07417: break;
07418: default:
07419: jj_la1[124] = jj_gen;
07420: jj_consume_token(-1);
07421: throw new ParseException();
07422: }
07423: jj_consume_token(LEFT_PAREN);
07424: value = additiveExpression(null, 0, false);
07425: jj_consume_token(RIGHT_PAREN);
07426: {
07427: if (true)
07428: return (ValueNode) nodeFactory.getNode(
07429: C_NodeTypes.SIMPLE_STRING_OPERATOR_NODE,
07430: value, (upperTok != null) ? "upper"
07431: : "lower", getContextManager());
07432: }
07433: break;
07434: case LTRIM:
07435: case RTRIM:
07436: value = trimFunction();
07437: {
07438: if (true)
07439: return value;
07440: }
07441: break;
07442: case LOCATE:
07443: jj_consume_token(LOCATE);
07444: jj_consume_token(LEFT_PAREN);
07445: str1 = additiveExpression(null, 0, false);
07446: jj_consume_token(COMMA);
07447: str2 = additiveExpression(null, 0, false);
07448: switch (jj_nt.kind) {
07449: case COMMA:
07450: jj_consume_token(COMMA);
07451: value = additiveExpression(null, 0, false);
07452: break;
07453: default:
07454: jj_la1[125] = jj_gen;
07455: ;
07456: }
07457: jj_consume_token(RIGHT_PAREN);
07458: // if start is missing, start is equal to 1
07459: {
07460: if (true)
07461: return (ValueNode) nodeFactory
07462: .getNode(
07463: C_NodeTypes.LOCATE_FUNCTION_NODE,
07464: str1,
07465: str2,
07466: (value == null) ? getNodeFactory()
07467: .getNode(
07468: C_NodeTypes.INT_CONSTANT_NODE,
07469: ReuseFactory
07470: .getInteger(1),
07471: getContextManager())
07472: : value,
07473: ReuseFactory
07474: .getInteger(TernaryOperatorNode.LOCATE),
07475: null, getContextManager());
07476: }
07477: break;
07478: default:
07479: jj_la1[126] = jj_gen;
07480: jj_consume_token(-1);
07481: throw new ParseException();
07482: }
07483: throw new Error("Missing return statement in function");
07484: }
07485:
07486: final public ValueNode trimFunction() throws ParseException,
07487: StandardException {
07488: ValueNode source;
07489: Integer trimType;
07490: trimType = trimType();
07491: jj_consume_token(LEFT_PAREN);
07492: source = additiveExpression(null, 0, false);
07493: jj_consume_token(RIGHT_PAREN);
07494: {
07495: if (true)
07496: return (ValueNode) nodeFactory.getNode(
07497: C_NodeTypes.TRIM_OPERATOR_NODE, source, source,
07498: null, ReuseFactory
07499: .getInteger(TernaryOperatorNode.TRIM),
07500: trimType, getContextManager());
07501: }
07502: throw new Error("Missing return statement in function");
07503: }
07504:
07505: final public Integer trimType() throws ParseException {
07506: switch (jj_nt.kind) {
07507: case RTRIM:
07508: jj_consume_token(RTRIM);
07509: {
07510: if (true)
07511: return ReuseFactory
07512: .getInteger(StringDataValue.TRAILING);
07513: }
07514: break;
07515: case LTRIM:
07516: jj_consume_token(LTRIM);
07517: {
07518: if (true)
07519: return ReuseFactory
07520: .getInteger(StringDataValue.LEADING);
07521: }
07522: break;
07523: default:
07524: jj_la1[127] = jj_gen;
07525: jj_consume_token(-1);
07526: throw new ParseException();
07527: }
07528: throw new Error("Missing return statement in function");
07529: }
07530:
07531: /*
07532: * <A NAME="valueExpressionPrimary">valueExpressionPrimary</A>
07533: *
07534: * @param inSelectClause will be true if this method got called while parsing the select or values clause
07535: * If in select or values clause, we do not want to allow boolean values.
07536: */
07537: final public ValueNode valueExpressionPrimary(boolean inSelectClause)
07538: throws ParseException, StandardException {
07539: ValueNode value;
07540: int tokKind;
07541: if (escapedValueFunctionFollows()) {
07542: jj_consume_token(LEFT_BRACE);
07543: jj_consume_token(FN);
07544: value = escapedValueFunction();
07545: jj_consume_token(RIGHT_BRACE);
07546: {
07547: if (true)
07548: return value;
07549: }
07550: } else if (getToken(2).kind == SCHEMA
07551: || getToken(2).kind == SQLID) {
07552: jj_consume_token(CURRENT);
07553: switch (jj_nt.kind) {
07554: case SCHEMA:
07555: jj_consume_token(SCHEMA);
07556: break;
07557: case SQLID:
07558: jj_consume_token(SQLID);
07559: break;
07560: default:
07561: jj_la1[128] = jj_gen;
07562: jj_consume_token(-1);
07563: throw new ParseException();
07564: }
07565: {
07566: if (true)
07567: return (ValueNode) nodeFactory.getNode(
07568: C_NodeTypes.CURRENT_SCHEMA_NODE,
07569: getContextManager());
07570: }
07571: } else if (getToken(2).kind == ISOLATION) {
07572: jj_consume_token(CURRENT);
07573: jj_consume_token(ISOLATION);
07574: {
07575: if (true)
07576: return (ValueNode) nodeFactory.getNode(
07577: C_NodeTypes.CURRENT_ISOLATION_NODE,
07578: getContextManager());
07579: }
07580: } else {
07581: switch (jj_nt.kind) {
07582: case CASE:
07583: case CURRENT_USER:
07584: case FALSE:
07585: case NULLIF:
07586: case SESSION_USER:
07587: case TRUE:
07588: case USER:
07589: case LEFT_BRACE:
07590: case PLUS_SIGN:
07591: case MINUS_SIGN:
07592: case QUESTION_MARK:
07593: case EXACT_NUMERIC:
07594: case STRING:
07595: case HEX_STRING:
07596: case APPROXIMATE_NUMERIC:
07597: /* Omitted "case_expression" */
07598: value = valueSpecification();
07599: {
07600: if (true)
07601: return value;
07602: }
07603: break;
07604: default:
07605: jj_la1[129] = jj_gen;
07606: if (newInvocationFollows(1)) {
07607: value = newInvocation();
07608: {
07609: if (true)
07610: return value;
07611: }
07612: } else if (aggregateFollows()) {
07613: value = aggregateNode();
07614: {
07615: if (true)
07616: return value;
07617: }
07618: } else if (miscBuiltinFollows()) {
07619: value = miscBuiltins();
07620: {
07621: if (true)
07622: return value;
07623: }
07624: } else {
07625: switch (jj_nt.kind) {
07626: case BINARY:
07627: case COALESCE:
07628: case COUNT:
07629: case D:
07630: case MODULE:
07631: case T:
07632: case TS:
07633: case VALUE:
07634: case VARBINARY:
07635: case ABS:
07636: case ABSVAL:
07637: case ACTION:
07638: case ALWAYS:
07639: case BLOB:
07640: case C:
07641: case CALLED:
07642: case CLOB:
07643: case COBOL:
07644: case COMMITTED:
07645: case CONCAT:
07646: case CONTAINS:
07647: case DATA:
07648: case DATE:
07649: case DAY:
07650: case DYNAMIC:
07651: case FORTRAN:
07652: case GENERATED:
07653: case IDENTITY_VAL_LOCAL:
07654: case INCREMENT:
07655: case INITIAL:
07656: case INTERVAL:
07657: case LANGUAGE:
07658: case LARGE:
07659: case LENGTH:
07660: case LEVEL:
07661: case LOCKS:
07662: case LOCKSIZE:
07663: case LOGGED:
07664: case MOD:
07665: case MODIFIES:
07666: case MODIFY:
07667: case MONTH:
07668: case _MORE:
07669: case MUMPS:
07670: case NAME:
07671: case NCLOB:
07672: case NULLABLE:
07673: case NUMBER:
07674: case OBJECT:
07675: case PASCAL:
07676: case PLI:
07677: case PRECISION:
07678: case RELEASE:
07679: case REPEATABLE:
07680: case RESTART:
07681: case RETURNS:
07682: case ROW:
07683: case SAVEPOINT:
07684: case SCALE:
07685: case SERIALIZABLE:
07686: case SQL_TSI_FRAC_SECOND:
07687: case SQL_TSI_SECOND:
07688: case SQL_TSI_MINUTE:
07689: case SQL_TSI_HOUR:
07690: case SQL_TSI_DAY:
07691: case SQL_TSI_WEEK:
07692: case SQL_TSI_MONTH:
07693: case SQL_TSI_QUARTER:
07694: case SQL_TSI_YEAR:
07695: case START:
07696: case STATEMENT:
07697: case SYNONYM:
07698: case THEN:
07699: case TIME:
07700: case TIMESTAMP:
07701: case TIMESTAMPADD:
07702: case TIMESTAMPDIFF:
07703: case TRUNCATE:
07704: case TYPE:
07705: case UNCOMMITTED:
07706: case USAGE:
07707: case WHEN:
07708: case CURDATE:
07709: case CURTIME:
07710: case DATABASE:
07711: case LONG:
07712: case AFTER:
07713: case BEFORE:
07714: case CLASS:
07715: case COMPRESS:
07716: case CONTENT:
07717: case CS:
07718: case DB2SQL:
07719: case DIRTY:
07720: case DOCUMENT:
07721: case EACH:
07722: case EMPTY:
07723: case EXCLUSIVE:
07724: case FN:
07725: case INDEX:
07726: case JAVA:
07727: case LCASE:
07728: case LOCATE:
07729: case LOCK:
07730: case MESSAGE_LOCALE:
07731: case METHOD:
07732: case MODE:
07733: case NEW:
07734: case NEW_TABLE:
07735: case OJ:
07736: case OFF:
07737: case OLD:
07738: case OLD_TABLE:
07739: case PARAMETER:
07740: case PASSING:
07741: case PROPERTIES:
07742: case READS:
07743: case REF:
07744: case REFERENCING:
07745: case RENAME:
07746: case RESET:
07747: case RESULT:
07748: case RETAIN:
07749: case RETURNING:
07750: case RR:
07751: case RS:
07752: case SEQUENCE:
07753: case SEQUENTIAL:
07754: case SETS:
07755: case SHARE:
07756: case SQLID:
07757: case SPECIFIC:
07758: case SQRT:
07759: case STABILITY:
07760: case STRIP:
07761: case STYLE:
07762: case TRIGGER:
07763: case UCASE:
07764: case UR:
07765: case WHITESPACE:
07766: case IDENTIFIER:
07767: case DELIMITED_IDENTIFIER:
07768: value = columnReference();
07769: {
07770: if (true)
07771: return value;
07772: }
07773: break;
07774: case LEFT_PAREN:
07775: jj_consume_token(LEFT_PAREN);
07776: if (getToken(1).kind == SELECT
07777: || getToken(1).kind == VALUES) {
07778: value = subquery(
07779: SubqueryNode.EXPRESSION_SUBQUERY,
07780: null);
07781: } else if (inSelectClause) {
07782: value = additiveExpression(null, 0,
07783: inSelectClause);
07784: } else if (jj_2_25(1)) {
07785: //following will happen if we are not coming here for select/values clause
07786: value = valueExpression(inSelectClause);
07787: } else {
07788: jj_consume_token(-1);
07789: throw new ParseException();
07790: }
07791: jj_consume_token(RIGHT_PAREN);
07792: {
07793: if (true)
07794: return value;
07795: }
07796: break;
07797: case CAST:
07798: value = castSpecification();
07799: {
07800: if (true)
07801: return value;
07802: }
07803: break;
07804: default:
07805: jj_la1[130] = jj_gen;
07806: jj_consume_token(-1);
07807: throw new ParseException();
07808: }
07809: }
07810: }
07811: }
07812: throw new Error("Missing return statement in function");
07813: }
07814:
07815: /*
07816: * <A NAME="miscBuiltins">miscBuiltins</A>
07817: */
07818: final public ValueNode miscBuiltins() throws ParseException,
07819: StandardException {
07820: ValueNode value;
07821: if (((getToken(1).kind == GET_CURRENT_CONNECTION
07822: || getToken(1).kind == ABS
07823: || getToken(1).kind == ABSVAL
07824: || getToken(1).kind == SQRT || getToken(1).kind == MOD
07825: || getToken(1).kind == COALESCE
07826: || getToken(1).kind == VALUE
07827: || getToken(1).kind == IDENTITY_VAL_LOCAL
07828: || getToken(1).kind == SUBSTRING
07829: || getToken(1).kind == SUBSTR
07830: || getToken(1).kind == UPPER
07831: || getToken(1).kind == LOWER
07832: || getToken(1).kind == UCASE
07833: || getToken(1).kind == LCASE
07834: || getToken(1).kind == LTRIM
07835: || getToken(1).kind == RTRIM
07836: || getToken(1).kind == DATE || getToken(1).kind == TIME
07837: || getToken(1).kind == TIMESTAMP
07838: || getToken(1).kind == DOUBLE
07839: || getToken(1).kind == CHAR
07840: || getToken(1).kind == VARCHAR
07841: || getToken(1).kind == INTEGER
07842: || getToken(1).kind == INT
07843: || getToken(1).kind == SMALLINT
07844: || getToken(1).kind == LONGINT
07845: || getToken(1).kind == YEAR
07846: || getToken(1).kind == MONTH || getToken(1).kind == DAY
07847: || getToken(1).kind == HOUR
07848: || getToken(1).kind == MINUTE
07849: || getToken(1).kind == SECOND
07850: || getToken(1).kind == LENGTH
07851: || getToken(1).kind == LOCATE
07852: || getToken(1).kind == XMLPARSE
07853: || getToken(1).kind == XMLSERIALIZE
07854: || getToken(1).kind == XMLEXISTS || getToken(1).kind == XMLQUERY) && getToken(2).kind == LEFT_PAREN)) {
07855: /* miscBuiltins() are composed of the core
07856: * system, string and numeric functions,
07857: * date functions
07858: * and static method calls.
07859: */
07860: value = miscBuiltinsCore(false /* not JDBC escape */);
07861: {
07862: if (true)
07863: return value;
07864: }
07865: } else if (jj_2_26(1)) {
07866: value = datetimeValueFunction();
07867: {
07868: if (true)
07869: return value;
07870: }
07871: } else {
07872: switch (jj_nt.kind) {
07873: case BINARY:
07874: case COALESCE:
07875: case COUNT:
07876: case D:
07877: case MODULE:
07878: case T:
07879: case TS:
07880: case VALUE:
07881: case VARBINARY:
07882: case ABS:
07883: case ABSVAL:
07884: case ACTION:
07885: case ALWAYS:
07886: case BLOB:
07887: case C:
07888: case CALLED:
07889: case CLOB:
07890: case COBOL:
07891: case COMMITTED:
07892: case CONCAT:
07893: case CONTAINS:
07894: case DATA:
07895: case DATE:
07896: case DAY:
07897: case DYNAMIC:
07898: case FORTRAN:
07899: case GENERATED:
07900: case IDENTITY_VAL_LOCAL:
07901: case INCREMENT:
07902: case INITIAL:
07903: case INTERVAL:
07904: case LANGUAGE:
07905: case LARGE:
07906: case LENGTH:
07907: case LEVEL:
07908: case LOCKS:
07909: case LOCKSIZE:
07910: case LOGGED:
07911: case MOD:
07912: case MODIFIES:
07913: case MODIFY:
07914: case MONTH:
07915: case _MORE:
07916: case MUMPS:
07917: case NAME:
07918: case NCLOB:
07919: case NULLABLE:
07920: case NUMBER:
07921: case OBJECT:
07922: case PASCAL:
07923: case PLI:
07924: case PRECISION:
07925: case RELEASE:
07926: case REPEATABLE:
07927: case RESTART:
07928: case RETURNS:
07929: case ROW:
07930: case SAVEPOINT:
07931: case SCALE:
07932: case SERIALIZABLE:
07933: case SQL_TSI_FRAC_SECOND:
07934: case SQL_TSI_SECOND:
07935: case SQL_TSI_MINUTE:
07936: case SQL_TSI_HOUR:
07937: case SQL_TSI_DAY:
07938: case SQL_TSI_WEEK:
07939: case SQL_TSI_MONTH:
07940: case SQL_TSI_QUARTER:
07941: case SQL_TSI_YEAR:
07942: case START:
07943: case STATEMENT:
07944: case SYNONYM:
07945: case THEN:
07946: case TIME:
07947: case TIMESTAMP:
07948: case TIMESTAMPADD:
07949: case TIMESTAMPDIFF:
07950: case TRUNCATE:
07951: case TYPE:
07952: case UNCOMMITTED:
07953: case USAGE:
07954: case WHEN:
07955: case CURDATE:
07956: case CURTIME:
07957: case DATABASE:
07958: case LONG:
07959: case AFTER:
07960: case BEFORE:
07961: case CLASS:
07962: case COMPRESS:
07963: case CONTENT:
07964: case CS:
07965: case DB2SQL:
07966: case DIRTY:
07967: case DOCUMENT:
07968: case EACH:
07969: case EMPTY:
07970: case EXCLUSIVE:
07971: case FN:
07972: case INDEX:
07973: case JAVA:
07974: case LCASE:
07975: case LOCATE:
07976: case LOCK:
07977: case MESSAGE_LOCALE:
07978: case METHOD:
07979: case MODE:
07980: case NEW:
07981: case NEW_TABLE:
07982: case OJ:
07983: case OFF:
07984: case OLD:
07985: case OLD_TABLE:
07986: case PARAMETER:
07987: case PASSING:
07988: case PROPERTIES:
07989: case READS:
07990: case REF:
07991: case REFERENCING:
07992: case RENAME:
07993: case RESET:
07994: case RESULT:
07995: case RETAIN:
07996: case RETURNING:
07997: case RR:
07998: case RS:
07999: case SEQUENCE:
08000: case SEQUENTIAL:
08001: case SETS:
08002: case SHARE:
08003: case SQLID:
08004: case SPECIFIC:
08005: case SQRT:
08006: case STABILITY:
08007: case STRIP:
08008: case STYLE:
08009: case TRIGGER:
08010: case UCASE:
08011: case UR:
08012: case WHITESPACE:
08013: case IDENTIFIER:
08014: case DELIMITED_IDENTIFIER:
08015: /* This is where we build a node for static method aliases */
08016: value = routineInvocation();
08017: {
08018: if (true)
08019: return value;
08020: }
08021: break;
08022: default:
08023: jj_la1[131] = jj_gen;
08024: jj_consume_token(-1);
08025: throw new ParseException();
08026: }
08027: }
08028: throw new Error("Missing return statement in function");
08029: }
08030:
08031: final public ValueNode miscBuiltinsCore(boolean isJDBCEscape)
08032: throws ParseException, StandardException {
08033: ValueNode value;
08034: switch (jj_nt.kind) {
08035: case GET_CURRENT_CONNECTION:
08036: jj_consume_token(GET_CURRENT_CONNECTION);
08037: jj_consume_token(LEFT_PAREN);
08038: jj_consume_token(RIGHT_PAREN);
08039: checkInternalFeature("GETCURRENTCONNECTION()");
08040: {
08041: if (true)
08042: return (ValueNode) nodeFactory
08043: .getNode(
08044: C_NodeTypes.JAVA_TO_SQL_VALUE_NODE,
08045: nodeFactory
08046: .getNode(
08047: C_NodeTypes.GET_CURRENT_CONNECTION_NODE,
08048: getContextManager()),
08049: getContextManager());
08050: }
08051: break;
08052: case ABS:
08053: case ABSVAL:
08054: case IDENTITY_VAL_LOCAL:
08055: case MOD:
08056: case SQRT:
08057: value = numericValueFunction();
08058: {
08059: if (true)
08060: return value;
08061: }
08062: break;
08063: case LOWER:
08064: case UPPER:
08065: case LTRIM:
08066: case RTRIM:
08067: case SUBSTR:
08068: case LCASE:
08069: case LOCATE:
08070: case UCASE:
08071: value = characterValueFunction();
08072: {
08073: if (true)
08074: return value;
08075: }
08076: break;
08077: default:
08078: jj_la1[132] = jj_gen;
08079: if (jj_2_27(1)) {
08080: value = dataTypeScalarFunction();
08081: {
08082: if (true)
08083: return value;
08084: }
08085: } else {
08086: switch (jj_nt.kind) {
08087: case COALESCE:
08088: jj_consume_token(COALESCE);
08089: value = coalesceFunction("COALESCE");
08090: {
08091: if (true)
08092: return value;
08093: }
08094: break;
08095: case VALUE:
08096: jj_consume_token(VALUE);
08097: value = coalesceFunction("VALUE");
08098: {
08099: if (true)
08100: return value;
08101: }
08102: break;
08103: case LENGTH:
08104: jj_consume_token(LENGTH);
08105: jj_consume_token(LEFT_PAREN);
08106: value = additiveExpression(null, 0, false);
08107: jj_consume_token(RIGHT_PAREN);
08108: ContextManager localCM = getContextManager();
08109: if (isJDBCEscape) {
08110: if (true)
08111: return (ValueNode) nodeFactory
08112: .getNode(
08113: C_NodeTypes.CHAR_LENGTH_OPERATOR_NODE,
08114: (ValueNode) nodeFactory
08115: .getNode(
08116: C_NodeTypes.TRIM_OPERATOR_NODE,
08117: value,
08118: value,
08119: null,
08120: ReuseFactory
08121: .getInteger(TernaryOperatorNode.TRIM),
08122: ReuseFactory
08123: .getInteger(StringDataValue.TRAILING),
08124: localCM),
08125: localCM);
08126: }
08127: {
08128: if (true)
08129: return (ValueNode) nodeFactory
08130: .getNode(
08131: C_NodeTypes.DB2_LENGTH_OPERATOR_NODE,
08132: value, localCM);
08133: }
08134: break;
08135: case XMLEXISTS:
08136: case XMLPARSE:
08137: case XMLQUERY:
08138: case XMLSERIALIZE:
08139: value = xmlFunction();
08140: {
08141: if (true)
08142: return value;
08143: }
08144: break;
08145: default:
08146: jj_la1[133] = jj_gen;
08147: jj_consume_token(-1);
08148: throw new ParseException();
08149: }
08150: }
08151: }
08152: throw new Error("Missing return statement in function");
08153: }
08154:
08155: /*
08156: * <A NAME="dataTypeScalarFunction">dataTypeScalarFunction</A>
08157: */
08158: final public ValueNode dataTypeScalarFunction()
08159: throws ParseException, StandardException {
08160: DataTypeDescriptor dts;
08161: ValueNode value; //converted result
08162: ValueNode operand;
08163: int charType;
08164: int length = -1;
08165: switch (jj_nt.kind) {
08166: case HOUR:
08167: case MINUTE:
08168: case SECOND:
08169: case YEAR:
08170: case DATE:
08171: case DAY:
08172: case MONTH:
08173: case TIME:
08174: case TIMESTAMP:
08175: //Note: When you add a new data type function, in addition to adding it
08176: // here, you need to add it to miscBuiltins()
08177: value = dateTimeScalarFunction();
08178: {
08179: if (true)
08180: return value;
08181: }
08182: break;
08183: default:
08184: jj_la1[135] = jj_gen;
08185: if (jj_2_28(1)) {
08186: dts = numericFunctionType();
08187: jj_consume_token(LEFT_PAREN);
08188: operand = additiveExpression(null, 0, false);
08189: jj_consume_token(RIGHT_PAREN);
08190: value = (ValueNode) nodeFactory.getNode(
08191: C_NodeTypes.CAST_NODE, operand, dts,
08192: getContextManager());
08193: ((CastNode) value).setForDataTypeFunction(true);
08194:
08195: {
08196: if (true)
08197: return value;
08198: }
08199: } else {
08200: switch (jj_nt.kind) {
08201: case CHAR:
08202: case VARCHAR:
08203: charType = charOrVarchar();
08204: jj_consume_token(LEFT_PAREN);
08205: operand = additiveExpression(null, 0, false);
08206: switch (jj_nt.kind) {
08207: case COMMA:
08208: jj_consume_token(COMMA);
08209: length = length();
08210: break;
08211: default:
08212: jj_la1[134] = jj_gen;
08213: ;
08214: }
08215: jj_consume_token(RIGHT_PAREN);
08216: // Always check db2 limits for this function. It's new
08217: checkTypeLimits(charType, length);
08218: value = (ValueNode) nodeFactory.getNode(
08219: C_NodeTypes.CAST_NODE, operand,
08220: new Integer(charType), new Integer(length),
08221: getContextManager());
08222:
08223: ((CastNode) value).setForDataTypeFunction(true);
08224: {
08225: if (true)
08226: return value;
08227: }
08228: break;
08229: default:
08230: jj_la1[136] = jj_gen;
08231: jj_consume_token(-1);
08232: throw new ParseException();
08233: }
08234: }
08235: }
08236: throw new Error("Missing return statement in function");
08237: }
08238:
08239: /*
08240: * <A NAME="xmlFunction">xmlFunction</A>
08241: *
08242: * This method parses the built-in functions used with
08243: * the XML datatype.
08244: *
08245: */
08246: final public ValueNode xmlFunction() throws ParseException,
08247: StandardException {
08248: ValueNode value;
08249: checkVersion(DataDictionary.DD_VERSION_DERBY_10_1, "XML");
08250:
08251: // We only allow XML operations if the classpath has all
08252: // of the required external classes (namley, JAXP and Xalan).
08253: org.apache.derby.iapi.types.XML.checkXMLRequirements();
08254: switch (jj_nt.kind) {
08255: case XMLPARSE:
08256: jj_consume_token(XMLPARSE);
08257: jj_consume_token(LEFT_PAREN);
08258: xmlDocOrContent();
08259: value = xmlParseValue();
08260: jj_consume_token(RIGHT_PAREN);
08261: {
08262: if (true)
08263: return value;
08264: }
08265: break;
08266: case XMLSERIALIZE:
08267: jj_consume_token(XMLSERIALIZE);
08268: jj_consume_token(LEFT_PAREN);
08269: value = xmlSerializeValue();
08270: jj_consume_token(RIGHT_PAREN);
08271: {
08272: if (true)
08273: return value;
08274: }
08275: break;
08276: case XMLEXISTS:
08277: jj_consume_token(XMLEXISTS);
08278: jj_consume_token(LEFT_PAREN);
08279: value = xmlQueryValue(true);
08280: jj_consume_token(RIGHT_PAREN);
08281: {
08282: if (true)
08283: return value;
08284: }
08285: break;
08286: case XMLQUERY:
08287: jj_consume_token(XMLQUERY);
08288: jj_consume_token(LEFT_PAREN);
08289: value = xmlQueryValue(false);
08290: jj_consume_token(RIGHT_PAREN);
08291: {
08292: if (true)
08293: return value;
08294: }
08295: break;
08296: default:
08297: jj_la1[137] = jj_gen;
08298: jj_consume_token(-1);
08299: throw new ParseException();
08300: }
08301: throw new Error("Missing return statement in function");
08302: }
08303:
08304: /*
08305: * <A NAME="xmlParseValue">xmlParseValue</A>
08306: *
08307: * Syntax is as follows:
08308: *
08309: * XMLPARSE( DOCUMENT <string-value-expression> PRESERVE WHITESPACE )
08310: *
08311: * The result of this operation will be an XML value, which can either
08312: * be used transiently or else can be stored persistently in a table that
08313: * has an XML column. For example:
08314: *
08315: * ij> CREATE TABLE x_table (id INT, xdoc XML);
08316: * 0 rows inserted/updated/deleted
08317: * ij> INSERT INTO x_table VALUES (1, XMLPARSE(DOCUMENT '<simp> doc </simp>'
08318: * PRESERVE WHITESPACE));
08319: * 1 row inserted/updated/deleted
08320: *
08321: * We only allow XML documents (as opposed to XML content) to be
08322: * parsed into XML values. Note that we require the "PRESERVE WHITESPACE"
08323: * keyword to be explicit; this is because the SQL/XML (2003) spec says that
08324: * if no whitespace option is given, the default is "STRIP WHITESPACE", which
08325: * we don't support (yet).
08326: *
08327: * By the time we get to this method, the "DOCUMENT" keyword has already
08328: * been parsed.
08329: *
08330: */
08331: final public ValueNode xmlParseValue() throws ParseException,
08332: StandardException {
08333: ValueNode value;
08334: boolean wsOption;
08335: value = additiveExpression(null, 0, false);
08336: wsOption = xmlPreserveWhitespace();
08337: {
08338: if (true)
08339: return (ValueNode) nodeFactory
08340: .getNode(
08341: C_NodeTypes.XML_PARSE_OPERATOR_NODE,
08342: value,
08343: ReuseFactory
08344: .getInteger(UnaryOperatorNode.XMLPARSE_OP),
08345: new Object[] { (wsOption ? Boolean.TRUE
08346: : Boolean.FALSE) },
08347: getContextManager());
08348: }
08349: throw new Error("Missing return statement in function");
08350: }
08351:
08352: /*
08353: * <A NAME="xmlPreserveWhitespace">xmlPreserveWhitespace</A>
08354: *
08355: * For now, we only support the PRESERVE WHITESPACE option.
08356: *
08357: */
08358: final public boolean xmlPreserveWhitespace() throws ParseException,
08359: StandardException {
08360: if ((getToken(1).kind != STRIP)
08361: && (getToken(1).kind != PRESERVE)) {
08362: {
08363: if (true)
08364: throw StandardException
08365: .newException(
08366: SQLState.LANG_XML_KEYWORD_MISSING,
08367: "PRESERVE WHITESPACE",
08368: ReuseFactory
08369: .getInteger(getToken(1).beginLine),
08370: ReuseFactory
08371: .getInteger(getToken(1).beginColumn));
08372: }
08373: } else {
08374: switch (jj_nt.kind) {
08375: case STRIP:
08376: jj_consume_token(STRIP);
08377: jj_consume_token(WHITESPACE);
08378: // don't preserve whitespace.
08379: {
08380: if (true)
08381: throw StandardException.newException(
08382: SQLState.LANG_UNSUPPORTED_XML_FEATURE,
08383: "STRIP WHITESPACE");
08384: }
08385: break;
08386: case PRESERVE:
08387: jj_consume_token(PRESERVE);
08388: jj_consume_token(WHITESPACE);
08389: // must preserve whitespace.
08390: {
08391: if (true)
08392: return true;
08393: }
08394: break;
08395: default:
08396: jj_la1[138] = jj_gen;
08397: jj_consume_token(-1);
08398: throw new ParseException();
08399: }
08400: }
08401: throw new Error("Missing return statement in function");
08402: }
08403:
08404: /*
08405: * <A NAME="xmlSerializeValue">xmlSerializeValue</A>
08406: *
08407: * Syntax is as follows:
08408: *
08409: * XMLSERIALIZE( <xml-value-expression> AS <string-data-type> )
08410: *
08411: * The result of this operation will be a string value with the type specified
08412: * by the user. For example:
08413: *
08414: * ij> SELECT id, XMLSERIALIZE(xdoc AS varchar(30)) FROM x_table;
08415: * ID |2
08416: * ------------------------------------------
08417: * 1 |<simp> doc </simp>
08418: *
08419: */
08420: final public ValueNode xmlSerializeValue() throws ParseException,
08421: StandardException {
08422: ValueNode value;
08423: DataTypeDescriptor targetType;
08424: value = additiveExpression(null, 0, false);
08425: targetType = xmlSerializeTargetType();
08426: {
08427: if (true)
08428: return (ValueNode) nodeFactory
08429: .getNode(
08430: C_NodeTypes.XML_SERIALIZE_OPERATOR_NODE,
08431: value,
08432: ReuseFactory
08433: .getInteger(UnaryOperatorNode.XMLSERIALIZE_OP),
08434: new Object[] { targetType },
08435: getContextManager());
08436: }
08437: throw new Error("Missing return statement in function");
08438: }
08439:
08440: /*
08441: * <A NAME="xmlSerializeTargetType">xmlSerializeTargetType</A>
08442: *
08443: * Parse the target type of an XMLSERIALIZE operation.
08444: *
08445: */
08446: final public DataTypeDescriptor xmlSerializeTargetType()
08447: throws ParseException, StandardException {
08448: DataTypeDescriptor targetType;
08449: if ((getToken(1).kind != AS)) {
08450: {
08451: if (true)
08452: throw StandardException
08453: .newException(
08454: SQLState.LANG_XML_KEYWORD_MISSING,
08455: "AS",
08456: ReuseFactory
08457: .getInteger(getToken(1).beginLine),
08458: ReuseFactory
08459: .getInteger(getToken(1).beginColumn));
08460: }
08461: } else {
08462: switch (jj_nt.kind) {
08463: case AS:
08464: jj_consume_token(AS);
08465: targetType = dataTypeDDL();
08466: {
08467: if (true)
08468: return targetType;
08469: }
08470: break;
08471: default:
08472: jj_la1[139] = jj_gen;
08473: jj_consume_token(-1);
08474: throw new ParseException();
08475: }
08476: }
08477: throw new Error("Missing return statement in function");
08478: }
08479:
08480: /*
08481: * <A NAME="xmlQueryValue">xmlQueryValue</A>
08482: *
08483: * This method is used for parsing the XMLEXISTS and XMLQUERY operators
08484: * (which operator depends on the received boolean parameter).
08485: *
08486: * For XMLEXISTS, the syntax is as follows:
08487: *
08488: * XMLEXISTS( <xpath-expression> PASSING BY REF <xml-value-expression> )
08489: *
08490: * The result of this operation will be a boolean true/false/unknown value:
08491: * -- Unknown if either <xquery-expression> or <xml-value-expression> is null;
08492: * -- True if evaluation of the given query expression against the
08493: * given xml-value returns at least one node.
08494: * -- False otherwise.
08495: *
08496: * For example:
08497: *
08498: * ij> SELECT id FROM x_table WHERE XMLEXISTS('/simple' PASSING BY REF xdoc);
08499: * ID
08500: * -----------
08501: * 1
08502: *
08503: * ====
08504: *
08505: * For XMLQUERY, the syntax is as follows:
08506: *
08507: * XMLQUERY( <xquery-expression>
08508: * PASSING BY REF <xml-value-expression>
08509: * [ RETURNING SEQUENCE [ BY REF ] ]
08510: * EMPTY ON EMPTY
08511: * )
08512: *
08513: * The result of this operation will be an XMLDataValue.
08514: *
08515: * For example:
08516: *
08517: * ij> SELECT XMLSERIALIZE(
08518: * XMLQUERY('/simple' PASSING BY REF xdoc EMPTY ON EMPTY) AS CHAR(100));
08519: * ID
08520: * -----------
08521: * <simp> doc </simp>
08522: *
08523: */
08524: final public ValueNode xmlQueryValue(boolean existsOnly)
08525: throws ParseException, StandardException {
08526: // The query expression (currently must be an expression
08527: // supported by Xalan--i.e. XPath only).
08528: ValueNode xqueryExpr = null;
08529:
08530: // Context item for the query; not required by SQL/XML spec,
08531: // but required by Derby for now.
08532: ValueNode xmlValue = null;
08533:
08534: // User-specified default passing mechanism. Since Derby only
08535: // supports one type of passing mechanism--BY REF--this value
08536: // isn't currently used.
08537: short defaultPassingMech = -1;
08538: xqueryExpr = additiveExpression(null, 0, false);
08539: jj_consume_token(PASSING);
08540: defaultPassingMech = xmlPassingMechanism();
08541: xmlValue = xqVarList();
08542: if (!existsOnly) {
08543: if (jj_2_30(1)) {
08544: xqReturningClause();
08545: if (jj_2_29(1)) {
08546: xmlPassingMechanism();
08547: } else {
08548: ;
08549: }
08550: } else {
08551: ;
08552: }
08553: xqEmptyHandlingClause();
08554:
08555: } else if (existsOnly) {
08556:
08557: } else {
08558: jj_consume_token(-1);
08559: throw new ParseException();
08560: }
08561: ValueNode vNode = (ValueNode) nodeFactory
08562: .getNode(
08563: (existsOnly ? C_NodeTypes.XML_EXISTS_OPERATOR_NODE
08564: : C_NodeTypes.XML_QUERY_OPERATOR_NODE),
08565: xqueryExpr,
08566: xmlValue,
08567: (existsOnly ? ReuseFactory
08568: .getInteger(BinaryOperatorNode.XMLEXISTS_OP)
08569: : ReuseFactory
08570: .getInteger(BinaryOperatorNode.XMLQUERY_OP)),
08571: getContextManager());
08572:
08573: {
08574: if (true)
08575: return vNode;
08576: }
08577: throw new Error("Missing return statement in function");
08578: }
08579:
08580: /**
08581: * <A NAME="xqVarList">xqVarList</A>
08582: *
08583: * Parse a list of XML query variables, which can include at most one
08584: * XML value to be used as the "context item" for the query. If
08585: * such a context item was found, return that item; for all other
08586: * variable declarations we currently throw a "not supported" error
08587: * because Xalan doesn't allowing binding of variables.
08588: */
08589: final public ValueNode xqVarList() throws ParseException,
08590: StandardException {
08591: // Placeholder for the XML context item as we parse the
08592: // argument list.
08593: ValueNode[] xmlValue = new ValueNode[] { (ValueNode) null };
08594: xqVariable(xmlValue);
08595: label_17: while (true) {
08596: switch (jj_nt.kind) {
08597: case COMMA:
08598: ;
08599: break;
08600: default:
08601: jj_la1[140] = jj_gen;
08602: break label_17;
08603: }
08604: jj_consume_token(COMMA);
08605: xqVariable(xmlValue);
08606: }
08607: {
08608: if (true)
08609: return xmlValue[0];
08610: }
08611: throw new Error("Missing return statement in function");
08612: }
08613:
08614: /**
08615: * <A NAME="xqVariable">xqVariable</A>
08616: *
08617: * Parse an XML query variable. If the argument is an XML value
08618: * to be used as the "context item" for a query, then store the
08619: * value in the first slot of the received ValueNode array;
08620: * otherwise, throw a "not supported" errror (for now).
08621: */
08622: final public void xqVariable(ValueNode[] xmlVal)
08623: throws ParseException, StandardException {
08624: ValueNode curVal;
08625: String varName = null;
08626: short passingMech = -1;
08627: curVal = additiveExpression(null, 0, false);
08628: if (getToken(1).kind == AS) {
08629: jj_consume_token(AS);
08630: varName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
08631: /* From XQuery 1.0: "The <identifier> I contained in XQV
08632: * shall be an XML 1.1 NCName." From XML 1.1:
08633: *
08634: * [4] NCName ::= (Letter | '_') (NCNameChar)*
08635: * [5] NCNameChar ::= Letter | Digit | '.' | '-' | '_' |
08636: * CombiningChar | Extender
08637: *
08638: * Since Derby's definition of an "identifier" is a subset
08639: * of NCName, we just use Derby's definition. This means
08640: * that some valid NCNames won't be recognized by Derby--
08641: * but since the ones we _do_ recognize are all still valid
08642: * NCNames, we're not breaking any rules.
08643: */
08644:
08645: /* All of that said, since we use Xalan as the underlying
08646: * query engine and Xalan doesn't support variable binding,
08647: * there's no point in letting the user specify variables
08648: * right now. So we disallow it. In the future we'll have
08649: * to add logic here to store the variables and pass them
08650: * to the correct operator for binding/execution.
08651: */
08652: {
08653: if (true)
08654: throw StandardException.newException(
08655: SQLState.LANG_UNSUPPORTED_XML_FEATURE,
08656: "PASSING ... AS");
08657: }
08658: } else {
08659: ;
08660: }
08661: if (jj_2_31(1)) {
08662: passingMech = xmlPassingMechanism();
08663: } else {
08664: ;
08665: }
08666: if (varName == null) {
08667: /* We get here if we just parsed an XML context item.
08668: * That said, if we already have one (xmlVal[0] is not
08669: * null) then we can't allow second one, per SQL/XML[2006]
08670: * (6.17: Syntax Rules:5.b.i): "XMQ shall contain exactly
08671: * one <XML query context item> XQCI."
08672: */
08673: if (xmlVal[0] != null) {
08674: {
08675: if (true)
08676: throw StandardException
08677: .newException(SQLState.LANG_MULTIPLE_XML_CONTEXT_ITEMS);
08678: }
08679: }
08680:
08681: xmlVal[0] = curVal;
08682:
08683: /* Note: It's possible that a passing mechanism was
08684: * specified for the context item; if so its value is
08685: * stored in passingMech. However, we don't actually
08686: * store that passing mechanism anywhere because we
08687: * (currently) only support BY REF, so we know what
08688: * it has to be. If we add support for other passing
08689: * mechanisms (namely, BY VALUE) in the future, we'll
08690: * have to store the passing mechanism provided by
08691: * the user and process it at compilation/execution
08692: * time.
08693: */
08694: }
08695:
08696: }
08697:
08698: /*
08699: * <A NAME="xmlPassingMechanism">xmlPassingMechanism</A>
08700: *
08701: * For now, we only support the BY REF option because
08702: * that gives us better performance (allows us to avoid
08703: * performing potentially deep copies of XML nodes). This
08704: * means that if the same XML value is passed BY REF into
08705: * two different XML arguments for a single operator, then
08706: * every node in the first XML argument must have an
08707: * identical node in the second XML argument, and the
08708: * ids for both nodes must be the same. That said,
08709: * since we don't support variable binding yet, this
08710: * becomes a non-issue because we can't pass XML values.
08711: * In the future, though, we may choose to support the
08712: * passing/binding of variables (the only reason we
08713: * don't now is because Xalan doesn't support it) and
08714: * if we do, BY REF should provide better performance
08715: * due to lack of deep copying.
08716: */
08717: final public short xmlPassingMechanism() throws ParseException,
08718: StandardException {
08719: if (getToken(2).kind == REF) {
08720: jj_consume_token(BY);
08721: jj_consume_token(REF);
08722: // pass the XML value by reference
08723: {
08724: if (true)
08725: return org.apache.derby.iapi.types.XML.XQ_PASS_BY_REF;
08726: }
08727: } else {
08728: switch (jj_nt.kind) {
08729: case BY:
08730: jj_consume_token(BY);
08731: jj_consume_token(VALUE);
08732: // pass a 'copy' of the XML value.
08733: {
08734: if (true)
08735: throw StandardException.newException(
08736: SQLState.LANG_UNSUPPORTED_XML_FEATURE,
08737: "BY VALUE");
08738: }
08739: break;
08740: default:
08741: jj_la1[141] = jj_gen;
08742: jj_consume_token(-1);
08743: throw new ParseException();
08744: }
08745: }
08746: throw new Error("Missing return statement in function");
08747: }
08748:
08749: /*
08750: * <A NAME="xqReturningClause">xqReturningClause</A>
08751: *
08752: * For now we only support "RETURNING SEQUENCE". The reason
08753: * is that this applies to the XMLQUERY operator and the
08754: * results of evaluating a query expression in Xalan against
08755: * an XML value can be an arbritary sequence of items--including
08756: * atomic values. For simplicity we just return the values
08757: * as they are, without doing any further work. SQL/XML[2006]
08758: * says that if we supported RETURNING CONTENT then we'd have
08759: * to construct an XQuery document from the results--but we don't
08760: * do that extra work for now, so we just say that we return
08761: * SEQUENCE.
08762: *
08763: * NOTE: This means that we may not be able to store the results
08764: * of an XMLQUERY operation into a Derby XML column. Right now
08765: * an XML column can only hold valid DOCUMENT nodes, which we
08766: * we define as an XML value whose serialized form can be parsed
08767: * by a JAXP DocumentBuilder (because that's what Derby's XMLPARSE
08768: * operator uses and the result is always a Document node).
08769: * Internally this means that we can only store a sequence if it
08770: * contains exactly one org.w3c.dom.Node that is an instance of
08771: * org.w3c.dom.Document. If the result of an XMLQUERY operation
08772: * does not fit this criteria then it will *not* be storable into
08773: * Derby XML columns.
08774: */
08775: final public short xqReturningClause() throws ParseException,
08776: StandardException {
08777: if (getToken(2).kind == SEQUENCE) {
08778: jj_consume_token(RETURNING);
08779: jj_consume_token(SEQUENCE);
08780: // XMLQUERY should return result as a sequence.
08781: // NOTE: since Derby XML columns only allow DOCUMENT(UNTYPED),
08782: // the result of an XMLQUERY operator that returns SEQUENCE
08783: // might not be storable into an XML column.
08784: {
08785: if (true)
08786: return org.apache.derby.iapi.types.XML.XQ_RETURN_SEQUENCE;
08787: }
08788: } else {
08789: switch (jj_nt.kind) {
08790: case RETURNING:
08791: jj_consume_token(RETURNING);
08792: jj_consume_token(CONTENT);
08793: // XMLQUERY should return 'content'.
08794: {
08795: if (true)
08796: throw StandardException.newException(
08797: SQLState.LANG_UNSUPPORTED_XML_FEATURE,
08798: "RETURNING CONTENT");
08799: }
08800: break;
08801: default:
08802: jj_la1[142] = jj_gen;
08803: jj_consume_token(-1);
08804: throw new ParseException();
08805: }
08806: }
08807: throw new Error("Missing return statement in function");
08808: }
08809:
08810: /*
08811: * <A NAME="xqEmptyHandlingClause">xqEmptyHandlingClause</A>
08812: *
08813: * Defines what the behavior should be when an XMLQUERY operator
08814: * results in an empty sequence. For now we just return the
08815: * empty sequence.
08816: */
08817: final public short xqEmptyHandlingClause() throws ParseException,
08818: StandardException {
08819: if (getToken(1).kind == EMPTY) {
08820: jj_consume_token(EMPTY);
08821: jj_consume_token(ON);
08822: jj_consume_token(EMPTY);
08823: // XMLQUERY should return an empty sequence when result of
08824: // the query is an empty sequence (i.e. when there are no
08825: // results).
08826: {
08827: if (true)
08828: return org.apache.derby.iapi.types.XML.XQ_EMPTY_ON_EMPTY;
08829: }
08830: } else {
08831: switch (jj_nt.kind) {
08832: case NULL:
08833: jj_consume_token(NULL);
08834: jj_consume_token(ON);
08835: jj_consume_token(EMPTY);
08836: // XMLQUERY should return a null XML value when result of
08837: // the query is an empty sequence (i.e. when there are no
08838: // results).
08839: {
08840: if (true)
08841: throw StandardException.newException(
08842: SQLState.LANG_UNSUPPORTED_XML_FEATURE,
08843: "NULL ON EMPTY");
08844: }
08845: break;
08846: default:
08847: jj_la1[143] = jj_gen;
08848: jj_consume_token(-1);
08849: throw new ParseException();
08850: }
08851: }
08852: throw new Error("Missing return statement in function");
08853: }
08854:
08855: /*
08856: * <A NAME="numericFunctionType">numericFunctionType</A>
08857: */
08858: final public DataTypeDescriptor numericFunctionType()
08859: throws ParseException, StandardException {
08860: DataTypeDescriptor dts;
08861: if (jj_2_32(1)) {
08862: dts = doubleType();
08863: {
08864: if (true)
08865: return dts;
08866: }
08867: } else {
08868: switch (jj_nt.kind) {
08869: case INT:
08870: case INTEGER:
08871: case SMALLINT:
08872: case LONGINT:
08873: dts = exactIntegerType();
08874: {
08875: if (true)
08876: return dts;
08877: }
08878: break;
08879: default:
08880: jj_la1[144] = jj_gen;
08881: jj_consume_token(-1);
08882: throw new ParseException();
08883: }
08884: }
08885: throw new Error("Missing return statement in function");
08886: }
08887:
08888: /*
08889: * <A NAME="dateTimeScalarFunction">dateTimeScalarFunction</A>
08890: */
08891: final public ValueNode dateTimeScalarFunction()
08892: throws ParseException, StandardException {
08893: ValueNode value;
08894: ValueNode timestampNode;
08895: int field;
08896: switch (jj_nt.kind) {
08897: case TIME:
08898: jj_consume_token(TIME);
08899: jj_consume_token(LEFT_PAREN);
08900: value = additiveExpression(null, 0, false);
08901: jj_consume_token(RIGHT_PAREN);
08902: {
08903: if (true)
08904: return (ValueNode) nodeFactory
08905: .getNode(
08906: C_NodeTypes.CAST_NODE,
08907: value,
08908: DataTypeDescriptor
08909: .getBuiltInDataTypeDescriptor(Types.TIME),
08910: getContextManager());
08911: }
08912: break;
08913: case DATE:
08914: jj_consume_token(DATE);
08915: jj_consume_token(LEFT_PAREN);
08916: value = additiveExpression(null, 0, false);
08917: jj_consume_token(RIGHT_PAREN);
08918: {
08919: if (true)
08920: return (ValueNode) nodeFactory
08921: .getNode(
08922: C_NodeTypes.UNARY_DATE_TIMESTAMP_OPERATOR_NODE,
08923: value,
08924: DataTypeDescriptor
08925: .getBuiltInDataTypeDescriptor(Types.DATE),
08926: getContextManager());
08927: }
08928: break;
08929: case TIMESTAMP:
08930: jj_consume_token(TIMESTAMP);
08931: jj_consume_token(LEFT_PAREN);
08932: value = additiveExpression(null, 0, false);
08933: timestampNode = timestampFunctionCompletion(value);
08934: {
08935: if (true)
08936: return timestampNode;
08937: }
08938: break;
08939: case HOUR:
08940: case MINUTE:
08941: case SECOND:
08942: case YEAR:
08943: case DAY:
08944: case MONTH:
08945: field = datetimeField();
08946: jj_consume_token(LEFT_PAREN);
08947: value = additiveExpression(null, 0, false);
08948: jj_consume_token(RIGHT_PAREN);
08949: {
08950: if (true)
08951: return (ValueNode) nodeFactory.getNode(
08952: C_NodeTypes.EXTRACT_OPERATOR_NODE,
08953: ReuseFactory.getInteger(field), value,
08954: getContextManager());
08955: }
08956: break;
08957: default:
08958: jj_la1[145] = jj_gen;
08959: jj_consume_token(-1);
08960: throw new ParseException();
08961: }
08962: throw new Error("Missing return statement in function");
08963: }
08964:
08965: /*
08966: * <A NAME="timestampFunctionCompletion">timestampFunctionCompletion</A>
08967: */
08968: final public ValueNode timestampFunctionCompletion(
08969: ValueNode firstArg) throws ParseException,
08970: StandardException {
08971: ValueNode timeValue;
08972: switch (jj_nt.kind) {
08973: case RIGHT_PAREN:
08974: jj_consume_token(RIGHT_PAREN);
08975: {
08976: if (true)
08977: return (ValueNode) nodeFactory
08978: .getNode(
08979: C_NodeTypes.UNARY_DATE_TIMESTAMP_OPERATOR_NODE,
08980: firstArg,
08981: DataTypeDescriptor
08982: .getBuiltInDataTypeDescriptor(Types.TIMESTAMP),
08983: getContextManager());
08984: }
08985: break;
08986: case COMMA:
08987: jj_consume_token(COMMA);
08988: timeValue = additiveExpression(null, 0, false);
08989: jj_consume_token(RIGHT_PAREN);
08990: {
08991: if (true)
08992: return (ValueNode) nodeFactory.getNode(
08993: C_NodeTypes.TIMESTAMP_OPERATOR_NODE,
08994: firstArg, timeValue, getContextManager());
08995: }
08996: break;
08997: default:
08998: jj_la1[146] = jj_gen;
08999: jj_consume_token(-1);
09000: throw new ParseException();
09001: }
09002: throw new Error("Missing return statement in function");
09003: }
09004:
09005: /*
09006: * <A NAME="booleanLiteral">booleanLiteral</A>
09007: */
09008: final public Token booleanLiteral() throws ParseException {
09009: Token tok;
09010: switch (jj_nt.kind) {
09011: case TRUE:
09012: tok = jj_consume_token(TRUE);
09013: {
09014: if (true)
09015: return tok;
09016: }
09017: break;
09018: case FALSE:
09019: tok = jj_consume_token(FALSE);
09020: {
09021: if (true)
09022: return tok;
09023: }
09024: break;
09025: default:
09026: jj_la1[147] = jj_gen;
09027: jj_consume_token(-1);
09028: throw new ParseException();
09029: }
09030: throw new Error("Missing return statement in function");
09031: }
09032:
09033: /*
09034: * <A NAME="generalValueSpecification">generalValueSpecification</A>
09035: */
09036: final public ValueNode generalValueSpecification()
09037: throws ParseException, StandardException {
09038: ValueNode parm;
09039: switch (jj_nt.kind) {
09040: case QUESTION_MARK:
09041: parm = dynamicParameterSpecification();
09042: {
09043: if (true)
09044: return parm;
09045: }
09046: break;
09047: case CURRENT_USER:
09048: case SESSION_USER:
09049: case USER:
09050: parm = userNode();
09051: {
09052: if (true)
09053: return parm;
09054: }
09055: break;
09056: default:
09057: jj_la1[148] = jj_gen;
09058: jj_consume_token(-1);
09059: throw new ParseException();
09060: }
09061: throw new Error("Missing return statement in function");
09062: }
09063:
09064: final public ValueNode userNode() throws ParseException,
09065: StandardException {
09066: switch (jj_nt.kind) {
09067: case USER:
09068: jj_consume_token(USER);
09069: {
09070: if (true)
09071: return (ValueNode) nodeFactory.getNode(
09072: C_NodeTypes.USER_NODE, getContextManager());
09073: }
09074: break;
09075: case CURRENT_USER:
09076: jj_consume_token(CURRENT_USER);
09077: {
09078: if (true)
09079: return (ValueNode) nodeFactory.getNode(
09080: C_NodeTypes.CURRENT_USER_NODE,
09081: getContextManager());
09082: }
09083: break;
09084: case SESSION_USER:
09085: jj_consume_token(SESSION_USER);
09086: {
09087: if (true)
09088: return (ValueNode) nodeFactory.getNode(
09089: C_NodeTypes.SESSION_USER_NODE,
09090: getContextManager());
09091: }
09092: break;
09093: default:
09094: jj_la1[149] = jj_gen;
09095: jj_consume_token(-1);
09096: throw new ParseException();
09097: }
09098: throw new Error("Missing return statement in function");
09099: }
09100:
09101: /*
09102: * <A NAME="newInvocation">newInvocation</A>
09103: */
09104: final public JavaToSQLValueNode newInvocation()
09105: throws ParseException, StandardException {
09106: QueryTreeNode newNode;
09107: Vector parameterList = new Vector();
09108: String javaClassName;
09109: jj_consume_token(NEW);
09110: javaClassName = javaClassName();
09111: methodCallParameterList(parameterList);
09112: if (!javaClassName.startsWith("org.apache.derby.diag.")
09113: && !javaClassName
09114: .startsWith("org.apache.derby.catalog.")
09115: && !javaClassName.startsWith("com.ibm.db2j.")) {
09116: checkInternalFeature(javaClassName);
09117: }
09118: newNode = nodeFactory.getNode(C_NodeTypes.NEW_INVOCATION_NODE,
09119: javaClassName, parameterList,
09120: lastTokenDelimitedIdentifier, getContextManager());
09121:
09122: /*
09123: ** Assume this is being returned to the SQL domain. If it turns
09124: ** out that this is being returned to the Java domain, we will
09125: ** get rid of this node.
09126: */
09127: {
09128: if (true)
09129: return (JavaToSQLValueNode) nodeFactory.getNode(
09130: C_NodeTypes.JAVA_TO_SQL_VALUE_NODE, newNode,
09131: getContextManager());
09132: }
09133: throw new Error("Missing return statement in function");
09134: }
09135:
09136: /*
09137: * <A NAME="staticMethodInvocation">staticMethodInvocation</A>
09138: */
09139: final public ValueNode staticMethodInvocation(String javaClassName)
09140: throws ParseException, StandardException {
09141: Vector parameterList = new Vector();
09142: MethodCallNode methodNode;
09143: methodNode = staticMethodName(javaClassName);
09144: methodCallParameterList(parameterList);
09145: methodNode.addParms(parameterList);
09146:
09147: /*
09148: ** Assume this is being returned to the SQL domain. If it turns
09149: ** out that this is being returned to the Java domain, we will
09150: ** get rid of this node.
09151: */
09152: {
09153: if (true)
09154: return (ValueNode) nodeFactory.getNode(
09155: C_NodeTypes.JAVA_TO_SQL_VALUE_NODE, methodNode,
09156: getContextManager());
09157: }
09158: throw new Error("Missing return statement in function");
09159: }
09160:
09161: /**
09162: * <A NAME="methodCallParameterList">methodCallParameterList</A>
09163: */
09164: final public void methodCallParameterList(Vector parameterList)
09165: throws ParseException, StandardException {
09166: jj_consume_token(LEFT_PAREN);
09167: if (jj_2_33(1)) {
09168: methodParameter(parameterList);
09169: label_18: while (true) {
09170: switch (jj_nt.kind) {
09171: case COMMA:
09172: ;
09173: break;
09174: default:
09175: jj_la1[150] = jj_gen;
09176: break label_18;
09177: }
09178: jj_consume_token(COMMA);
09179: methodParameter(parameterList);
09180: }
09181: } else {
09182: ;
09183: }
09184: jj_consume_token(RIGHT_PAREN);
09185: }
09186:
09187: /*
09188: * <A NAME="routineInvocation">routineInvocation</A>
09189: */
09190: final public ValueNode routineInvocation() throws ParseException,
09191: StandardException {
09192: Vector parameterList = new Vector();
09193: TableName routineName;
09194: MethodCallNode methodNode;
09195: routineName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
09196: methodCallParameterList(parameterList);
09197: methodNode = (MethodCallNode) nodeFactory.getNode(
09198: C_NodeTypes.STATIC_METHOD_CALL_NODE, routineName, null,
09199: getContextManager());
09200:
09201: methodNode.addParms(parameterList);
09202:
09203: /*
09204: ** Assume this is being returned to the SQL domain. If it turns
09205: ** out that this is being returned to the Java domain, we will
09206: ** get rid of this node.
09207: */
09208: {
09209: if (true)
09210: return (ValueNode) nodeFactory.getNode(
09211: C_NodeTypes.JAVA_TO_SQL_VALUE_NODE, methodNode,
09212: getContextManager());
09213: }
09214: throw new Error("Missing return statement in function");
09215: }
09216:
09217: /*
09218: * <A NAME="javaClass">javaClass</A>
09219: */
09220: final public String javaClass() throws ParseException,
09221: StandardException {
09222: String javaClassName;
09223: javaClassName = javaClassName();
09224: {
09225: if (true)
09226: return javaClassName;
09227: }
09228: throw new Error("Missing return statement in function");
09229: }
09230:
09231: /*
09232: * <A NAME="columnMethodInvocation">columnMethodInvocation</A>
09233: */
09234: final public ValueNode columnMethodInvocation()
09235: throws ParseException, StandardException {
09236: ValueNode columnReference;
09237: ValueNode methodNode;
09238: columnReference = columnNameForInvocation();
09239: methodNode = nonStaticMethodInvocation(columnReference);
09240: {
09241: if (true)
09242: return methodNode;
09243: }
09244: throw new Error("Missing return statement in function");
09245: }
09246:
09247: /*
09248: * <A NAME="columnNameForInvocation">columnNameForInvocation</A>
09249: */
09250: final public ValueNode columnNameForInvocation()
09251: throws ParseException, StandardException {
09252: String firstName;
09253: String secondName = null;
09254: String thirdName = null;
09255: String columnName = null;
09256: String tableName = null;
09257: String schemaName = null;
09258: TableName tabName = null;
09259: ValueNode retval;
09260: firstName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
09261: if (getToken(1).kind == PERIOD && getToken(3).kind == PERIOD) {
09262: jj_consume_token(PERIOD);
09263: secondName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
09264: if (getToken(1).kind == PERIOD
09265: && getToken(3).kind == PERIOD) {
09266: jj_consume_token(PERIOD);
09267: thirdName = identifier(Limits.MAX_IDENTIFIER_LENGTH,
09268: true);
09269: } else {
09270: ;
09271: }
09272: } else {
09273: ;
09274: }
09275: // Figure out what each identifier stands for
09276: if (thirdName == null) {
09277: if (secondName == null) {
09278: // There's only one identifier, so it must be a column name
09279: columnName = firstName;
09280: } else {
09281: // There are two identifiers, so they are table and column names
09282: tableName = firstName;
09283: columnName = secondName;
09284: }
09285: } else {
09286: // There are three identifiers,
09287: // so they are schema, table, and column names
09288: schemaName = firstName;
09289: tableName = secondName;
09290: columnName = thirdName;
09291: }
09292:
09293: if (tableName != null) {
09294: // There is a table name, so get a TableName node
09295: tabName = (TableName) nodeFactory.getNode(
09296: C_NodeTypes.TABLE_NAME, schemaName, tableName,
09297: new Integer(nextToLastIdentifierToken.beginOffset),
09298: new Integer(nextToLastIdentifierToken.endOffset),
09299: getContextManager());
09300: }
09301:
09302: // Get the column reference
09303: retval = (ValueNode) nodeFactory.getNode(
09304: C_NodeTypes.COLUMN_REFERENCE, columnName, tabName,
09305: new Integer(lastIdentifierToken.beginOffset),
09306: new Integer(lastIdentifierToken.endOffset),
09307: getContextManager());
09308:
09309: {
09310: if (true)
09311: return retval;
09312: }
09313: throw new Error("Missing return statement in function");
09314: }
09315:
09316: /*
09317: * <A NAME="columnReference">columnReference</A>
09318: */
09319: final public ColumnReference columnReference()
09320: throws ParseException, StandardException {
09321: String firstName;
09322: String secondName = null;
09323: String thirdName = null;
09324: String columnName = null;
09325: String tableName = null;
09326: String schemaName = null;
09327: TableName tabName = null;
09328: firstName = identifier(Limits.MAX_IDENTIFIER_LENGTH, false);
09329: if (getToken(1).kind == PERIOD
09330: && getToken(3).kind != LEFT_PAREN) {
09331: jj_consume_token(PERIOD);
09332: secondName = identifier(Limits.MAX_IDENTIFIER_LENGTH, false);
09333: if (getToken(1).kind == PERIOD
09334: && getToken(3).kind != LEFT_PAREN) {
09335: jj_consume_token(PERIOD);
09336: thirdName = identifier(Limits.MAX_IDENTIFIER_LENGTH,
09337: false);
09338: } else {
09339: ;
09340: }
09341: } else {
09342: ;
09343: }
09344: // Figure out what each name stands for
09345: if (thirdName == null) {
09346: if (secondName == null) {
09347: // Only one name, must be column name
09348: columnName = firstName;
09349: } else {
09350: // Two names: table.column
09351: tableName = firstName;
09352: columnName = secondName;
09353: }
09354: } else {
09355: // Three names: schema.table.column
09356: schemaName = firstName;
09357: tableName = secondName;
09358: columnName = thirdName;
09359: }
09360:
09361: checkIdentifierLengthLimit(columnName,
09362: Limits.MAX_IDENTIFIER_LENGTH);
09363: if (schemaName != null)
09364: checkIdentifierLengthLimit(schemaName,
09365: Limits.MAX_IDENTIFIER_LENGTH);
09366: if (tableName != null)
09367: checkIdentifierLengthLimit(tableName,
09368: Limits.MAX_IDENTIFIER_LENGTH);
09369:
09370: if (tableName != null) {
09371: tabName = (TableName) nodeFactory.getNode(
09372: C_NodeTypes.TABLE_NAME, schemaName, tableName,
09373: new Integer(nextToLastIdentifierToken.beginOffset),
09374: new Integer(nextToLastIdentifierToken.endOffset),
09375: getContextManager());
09376: }
09377:
09378: {
09379: if (true)
09380: return (ColumnReference) nodeFactory.getNode(
09381: C_NodeTypes.COLUMN_REFERENCE, columnName,
09382: tabName, new Integer(
09383: lastIdentifierToken.beginOffset),
09384: new Integer(lastIdentifierToken.endOffset),
09385: getContextManager());
09386: }
09387: throw new Error("Missing return statement in function");
09388: }
09389:
09390: /*
09391: void
09392: columnReference() throws StandardException :
09393: {}
09394: {
09395: /*
09396: **
09397: ** I re-wrote the above rule because it caused a grammar ambiguitity.
09398: ** The problem is that we are parsing a dot-separated list of identifiers,
09399: ** and the grammar doesn't know what the identifiers stand for, but the
09400: ** syntax assumed that it did. For example, in schema.table.column,
09401: ** the grammar doesn't know when it parses the first identifier whether
09402: ** it will be a catalog name, schema name, table name, or column name.
09403: **
09404: ** I think this problem could be solved by increasing the lookahead.
09405: ** I will try that solution next. I like that solution better because,
09406: ** if it works, it will be easier for the grammar to figure out what
09407: ** each identifier stands for.
09408: **
09409:
09410: [ <MODULE> <PERIOD> <IDENTIFIER> |
09411: [ [ [ <IDENTIFIER> <PERIOD> ] <IDENTIFIER> <PERIOD> ] <IDENTIFIER> <PERIOD> ]
09412: ]
09413: <IDENTIFIER>
09414: }
09415: */
09416: final public OrderByList orderByClause() throws ParseException,
09417: StandardException {
09418: OrderByList orderCols;
09419: jj_consume_token(ORDER);
09420: jj_consume_token(BY);
09421: orderCols = sortSpecificationList();
09422: {
09423: if (true)
09424: return orderCols;
09425: }
09426: throw new Error("Missing return statement in function");
09427: }
09428:
09429: final public int atIsolationLevel() throws ParseException,
09430: StandardException {
09431: int isolationLevel;
09432: jj_consume_token(WITH);
09433: isolationLevel = isolationLevelDB2Abbrev();
09434: {
09435: if (true)
09436: return isolationLevel;
09437: }
09438: throw new Error("Missing return statement in function");
09439: }
09440:
09441: final public OrderByList sortSpecificationList()
09442: throws ParseException, StandardException {
09443: OrderByList orderCols = (OrderByList) nodeFactory.getNode(
09444: C_NodeTypes.ORDER_BY_LIST, getContextManager());
09445: sortSpecification(orderCols);
09446: label_19: while (true) {
09447: switch (jj_nt.kind) {
09448: case COMMA:
09449: ;
09450: break;
09451: default:
09452: jj_la1[151] = jj_gen;
09453: break label_19;
09454: }
09455: jj_consume_token(COMMA);
09456: sortSpecification(orderCols);
09457: }
09458: {
09459: if (true)
09460: return orderCols;
09461: }
09462: throw new Error("Missing return statement in function");
09463: }
09464:
09465: final public void sortSpecification(OrderByList orderCols)
09466: throws ParseException, StandardException {
09467: OrderByColumn orderCol;
09468: orderCol = sortKey();
09469: switch (jj_nt.kind) {
09470: case ASC:
09471: case DESC:
09472: orderingSpecification(orderCol);
09473: break;
09474: default:
09475: jj_la1[152] = jj_gen;
09476: ;
09477: }
09478: orderCols.addOrderByColumn(orderCol);
09479: }
09480:
09481: final public OrderByColumn sortKey() throws ParseException,
09482: StandardException {
09483: ValueNode columnExpression;
09484: columnExpression = additiveExpression(null, 0, true);
09485: {
09486: if (true)
09487: return (OrderByColumn) nodeFactory.getNode(
09488: C_NodeTypes.ORDER_BY_COLUMN, columnExpression,
09489: getContextManager());
09490: }
09491: throw new Error("Missing return statement in function");
09492: }
09493:
09494: final public void orderingSpecification(OrderByColumn orderCol)
09495: throws ParseException {
09496: switch (jj_nt.kind) {
09497: case ASC:
09498: jj_consume_token(ASC);
09499: break;
09500: case DESC:
09501: jj_consume_token(DESC);
09502: orderCol.setDescending();
09503: break;
09504: default:
09505: jj_la1[153] = jj_gen;
09506: jj_consume_token(-1);
09507: throw new ParseException();
09508: }
09509: }
09510:
09511: /*
09512: * <A NAME="forUpdateClause">forUpdateClause</A>
09513: */
09514: final public int forUpdateClause(Vector columnList)
09515: throws ParseException, StandardException {
09516: int retval;
09517: switch (jj_nt.kind) {
09518: case UPDATE:
09519: jj_consume_token(UPDATE);
09520: switch (jj_nt.kind) {
09521: case OF:
09522: jj_consume_token(OF);
09523: forUpdateColumnList(columnList);
09524: break;
09525: default:
09526: jj_la1[154] = jj_gen;
09527: ;
09528: }
09529: {
09530: if (true)
09531: return CursorNode.UPDATE;
09532: }
09533: break;
09534: case READ:
09535: jj_consume_token(READ);
09536: jj_consume_token(ONLY);
09537: {
09538: if (true)
09539: return CursorNode.READ_ONLY;
09540: }
09541: break;
09542: case FETCH:
09543: jj_consume_token(FETCH);
09544: jj_consume_token(ONLY);
09545: {
09546: if (true)
09547: return CursorNode.READ_ONLY;
09548: }
09549: break;
09550: default:
09551: jj_la1[155] = jj_gen;
09552: jj_consume_token(-1);
09553: throw new ParseException();
09554: }
09555: throw new Error("Missing return statement in function");
09556: }
09557:
09558: /*
09559: * <A NAME="forUpdateColumnList">forUpdateColumnList</A>
09560: */
09561: final public void forUpdateColumnList(Vector columnList)
09562: throws ParseException, StandardException {
09563: forUpdateColumn(columnList);
09564: label_20: while (true) {
09565: switch (jj_nt.kind) {
09566: case COMMA:
09567: ;
09568: break;
09569: default:
09570: jj_la1[156] = jj_gen;
09571: break label_20;
09572: }
09573: jj_consume_token(COMMA);
09574: forUpdateColumn(columnList);
09575: }
09576: }
09577:
09578: /*
09579: * <A NAME="forUpdateColumn">forUpdateColumn</A>
09580: */
09581: final public void forUpdateColumn(Vector columnList)
09582: throws ParseException, StandardException {
09583: String columnName;
09584: /* identifier() used to be columnName() */
09585: columnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
09586: columnList.addElement(columnName);
09587: }
09588:
09589: /*
09590: * <A NAME="setClauseList">setClauseList</A>
09591: */
09592: final public ResultColumnList setClauseList()
09593: throws ParseException, StandardException {
09594: ResultColumnList columnList = (ResultColumnList) nodeFactory
09595: .getNode(C_NodeTypes.RESULT_COLUMN_LIST,
09596: getContextManager());
09597: setClause(columnList);
09598: label_21: while (true) {
09599: switch (jj_nt.kind) {
09600: case COMMA:
09601: ;
09602: break;
09603: default:
09604: jj_la1[157] = jj_gen;
09605: break label_21;
09606: }
09607: jj_consume_token(COMMA);
09608: setClause(columnList);
09609: }
09610: {
09611: if (true)
09612: return columnList;
09613: }
09614: throw new Error("Missing return statement in function");
09615: }
09616:
09617: /*
09618: * <A NAME="setClause">setClause</A>
09619: */
09620: final public void setClause(ResultColumnList columnList)
09621: throws ParseException, StandardException {
09622: ResultColumn resultColumn;
09623: ColumnReference columnName;
09624: ValueNode valueNode;
09625: /* identifier() used to be objectColumn() */
09626: /*
09627: SQL92 only wants identifiers here (column names)
09628: but JBuilder expects table.column, so we allow the
09629: general form.
09630: */
09631: columnName = columnReference();
09632: jj_consume_token(EQUALS_OPERATOR);
09633: valueNode = updateSource(columnName.getColumnName());
09634: resultColumn = (ResultColumn) nodeFactory.getNode(
09635: C_NodeTypes.RESULT_COLUMN, columnName, valueNode,
09636: getContextManager());
09637: columnList.addResultColumn(resultColumn);
09638: }
09639:
09640: /*
09641: * <A NAME="updateSource">updateSource</A>
09642: */
09643: final public ValueNode updateSource(String columnName)
09644: throws ParseException, StandardException {
09645: ValueNode valueNode;
09646: if (jj_2_34(1)) {
09647: valueNode = additiveExpression(null, 0, false);
09648: {
09649: if (true)
09650: return valueNode;
09651: }
09652: } else {
09653: switch (jj_nt.kind) {
09654: case NULL:
09655: valueNode = nullSpecification();
09656: {
09657: if (true)
09658: return valueNode;
09659: }
09660: break;
09661: case _DEFAULT:
09662: jj_consume_token(_DEFAULT);
09663: {
09664: if (true)
09665: return (ValueNode) nodeFactory.getNode(
09666: C_NodeTypes.DEFAULT_NODE, columnName,
09667: getContextManager());
09668: }
09669: break;
09670: default:
09671: jj_la1[158] = jj_gen;
09672: jj_consume_token(-1);
09673: throw new ParseException();
09674: }
09675: }
09676: throw new Error("Missing return statement in function");
09677: }
09678:
09679: /*
09680: * <A NAME="nullSpecification">nullSpecification</A>
09681: */
09682: final public ValueNode nullSpecification() throws ParseException,
09683: StandardException {
09684: jj_consume_token(NULL);
09685: {
09686: if (true)
09687: return (ValueNode) nodeFactory.getNode(
09688: C_NodeTypes.UNTYPED_NULL_CONSTANT_NODE,
09689: getContextManager());
09690: }
09691: throw new Error("Missing return statement in function");
09692: }
09693:
09694: /*
09695: * <A NAME="insertColumnsAndSource">insertColumnsAndSource</A>
09696: */
09697: final public QueryTreeNode insertColumnsAndSource(
09698: QueryTreeNode targetTable) throws ParseException,
09699: StandardException {
09700: Properties targetProperties = null;
09701: ResultSetNode queryExpression;
09702: ResultColumnList columnList = null;
09703: if (getToken(1).kind == LEFT_PAREN && !subqueryFollows()) {
09704: jj_consume_token(LEFT_PAREN);
09705: columnList = insertColumnList();
09706: jj_consume_token(RIGHT_PAREN);
09707: } else {
09708: ;
09709: }
09710: switch (jj_nt.kind) {
09711: case DERBYDASHPROPERTIES:
09712: targetProperties = propertyList(false);
09713: jj_consume_token(CHECK_PROPERTIES);
09714: break;
09715: default:
09716: jj_la1[159] = jj_gen;
09717: ;
09718: }
09719: queryExpression = queryExpression(null, NO_SET_OP);
09720: {
09721: if (true)
09722: return (QueryTreeNode) nodeFactory.getNode(
09723: C_NodeTypes.INSERT_NODE, targetTable,
09724: columnList, queryExpression, targetProperties,
09725: getContextManager());
09726: }
09727: throw new Error("Missing return statement in function");
09728: }
09729:
09730: /*
09731: * <A NAME="insertColumnList">insertColumnList</A>
09732: */
09733: final public ResultColumnList insertColumnList()
09734: throws ParseException, StandardException {
09735: ResultColumnList columnList = (ResultColumnList) nodeFactory
09736: .getNode(C_NodeTypes.RESULT_COLUMN_LIST,
09737: getContextManager());
09738: columnQualifiedNameList(columnList);
09739: {
09740: if (true)
09741: return columnList;
09742: }
09743: throw new Error("Missing return statement in function");
09744: }
09745:
09746: /*
09747: * <A NAME="columnQualifiedNameList">columnQualifiedNameList</A>
09748: */
09749: final public void columnQualifiedNameList(
09750: ResultColumnList columnList) throws ParseException,
09751: StandardException {
09752: columnQualifiedNameItem(columnList);
09753: label_22: while (true) {
09754: switch (jj_nt.kind) {
09755: case COMMA:
09756: ;
09757: break;
09758: default:
09759: jj_la1[160] = jj_gen;
09760: break label_22;
09761: }
09762: jj_consume_token(COMMA);
09763: columnQualifiedNameItem(columnList);
09764: }
09765: }
09766:
09767: /*
09768: * <A NAME="columnQualifiedNameItem">columnQualifiedNameItem</A>
09769: */
09770: final public void columnQualifiedNameItem(
09771: ResultColumnList columnList) throws ParseException,
09772: StandardException {
09773: ColumnReference columnRef;
09774: ResultColumn resultColumn;
09775: /*
09776: SQL92 only wants identifiers here (column names)
09777: but JBuilder expects table.column, so we allow the
09778: general form.
09779: */
09780: columnRef = columnReference();
09781: /*
09782: ** Store the column names for the result columns in the
09783: ** result column list. We don't know yet what valueNodes
09784: ** should be hooked up to each result column, so set that
09785: ** to null for now.
09786: */
09787: resultColumn = (ResultColumn) nodeFactory.getNode(
09788: C_NodeTypes.RESULT_COLUMN, columnRef, null,
09789: getContextManager());
09790: columnList.addResultColumn(resultColumn);
09791: }
09792:
09793: /*
09794: * <A NAME="rowValueConstructor">rowValueConstructor</A>
09795: */
09796: final public ResultSetNode rowValueConstructor(ResultSetNode leftRSN)
09797: throws ParseException, StandardException {
09798: ResultColumnList resultColumns = (ResultColumnList) nodeFactory
09799: .getNode(C_NodeTypes.RESULT_COLUMN_LIST,
09800: getContextManager());
09801: ResultSetNode newRSN;
09802: if (rowValueConstructorListFollows()) {
09803: jj_consume_token(LEFT_PAREN);
09804: rowValueConstructorList(resultColumns);
09805: jj_consume_token(RIGHT_PAREN);
09806: /* If leftRSN is null, simply return the newRSN, else generate and
09807: * return a UNION ALL above the 2 RSNs, after verifying that the size()
09808: * of both RSNs RCLs is the same.
09809: */
09810: newRSN = (ResultSetNode) nodeFactory.getNode(
09811: C_NodeTypes.ROW_RESULT_SET_NODE, resultColumns,
09812: null, getContextManager());
09813: if (leftRSN != null) {
09814: if (leftRSN.getResultColumns().size() != newRSN
09815: .getResultColumns().size()) {
09816: {
09817: if (true)
09818: throw StandardException
09819: .newException(SQLState.LANG_ROW_VALUE_CONSTRUCTOR_UNMATCHED_COLUMNS);
09820: }
09821: }
09822:
09823: newRSN = (ResultSetNode) nodeFactory.getNode(
09824: C_NodeTypes.UNION_NODE, leftRSN, newRSN,
09825: Boolean.TRUE, Boolean.TRUE, null,
09826: getContextManager());
09827: }
09828: {
09829: if (true)
09830: return newRSN;
09831: }
09832: } else {
09833: rowValueConstructorElement(resultColumns);
09834: /* If leftRSN is null, simply return the newRSN, else generate and
09835: * return a UNION ALL above the 2 RSNs, after verifying that the size()
09836: * of both RSNs RCLs is the same.
09837: */
09838: newRSN = (ResultSetNode) nodeFactory.getNode(
09839: C_NodeTypes.ROW_RESULT_SET_NODE, resultColumns,
09840: null, getContextManager());
09841: if (leftRSN != null) {
09842: if (leftRSN.getResultColumns().size() != newRSN
09843: .getResultColumns().size()) {
09844: {
09845: if (true)
09846: throw StandardException
09847: .newException(SQLState.LANG_ROW_VALUE_CONSTRUCTOR_UNMATCHED_COLUMNS);
09848: }
09849: }
09850:
09851: newRSN = (ResultSetNode) nodeFactory.getNode(
09852: C_NodeTypes.UNION_NODE, leftRSN, newRSN,
09853: Boolean.TRUE, Boolean.TRUE, null,
09854: getContextManager());
09855: }
09856: {
09857: if (true)
09858: return newRSN;
09859: }
09860: }
09861: throw new Error("Missing return statement in function");
09862: }
09863:
09864: /*
09865: * <A NAME="rowValueConstructorElement">rowValueConstructorElement</A>
09866: */
09867: final public void rowValueConstructorElement(
09868: ResultColumnList resultColumns) throws ParseException,
09869: StandardException {
09870: ValueNode value;
09871: if (jj_2_35(1)) {
09872: value = additiveExpression(null, 0, true);
09873: resultColumns.addResultColumn((ResultColumn) nodeFactory
09874: .getNode(C_NodeTypes.RESULT_COLUMN, null, value,
09875: getContextManager()));
09876: } else {
09877: switch (jj_nt.kind) {
09878: case NULL:
09879: value = nullSpecification();
09880: resultColumns
09881: .addResultColumn((ResultColumn) nodeFactory
09882: .getNode(C_NodeTypes.RESULT_COLUMN,
09883: null, value,
09884: getContextManager()));
09885: break;
09886: case _DEFAULT:
09887: jj_consume_token(_DEFAULT);
09888: resultColumns
09889: .addResultColumn((ResultColumn) nodeFactory
09890: .getNode(
09891: C_NodeTypes.RESULT_COLUMN,
09892: null,
09893: (ValueNode) nodeFactory
09894: .getNode(
09895: C_NodeTypes.DEFAULT_NODE,
09896: null,
09897: getContextManager()),
09898: getContextManager()));
09899: break;
09900: default:
09901: jj_la1[161] = jj_gen;
09902: {
09903: if (true)
09904: throw StandardException
09905: .newException(SQLState.LANG_EMPTY_VALUES_CLAUSE);
09906: }
09907: }
09908: }
09909: }
09910:
09911: /*
09912: * <A NAME="rowValueConstructorList">rowValueConstructorList</A>
09913: */
09914: final public void rowValueConstructorList(
09915: ResultColumnList resultColumns) throws ParseException,
09916: StandardException {
09917: rowValueConstructorElement(resultColumns);
09918: label_23: while (true) {
09919: switch (jj_nt.kind) {
09920: case COMMA:
09921: ;
09922: break;
09923: default:
09924: jj_la1[162] = jj_gen;
09925: break label_23;
09926: }
09927: jj_consume_token(COMMA);
09928: rowValueConstructorElement(resultColumns);
09929: }
09930: }
09931:
09932: /*
09933: * <A NAME="tableSubquery">tableSubquery</A>
09934: */
09935: final public SubqueryNode tableSubquery(int subqueryType,
09936: ValueNode leftOperand) throws ParseException,
09937: StandardException {
09938: SubqueryNode subqueryNode;
09939: subqueryNode = subquery(subqueryType, leftOperand);
09940: {
09941: if (true)
09942: return subqueryNode;
09943: }
09944: throw new Error("Missing return statement in function");
09945: }
09946:
09947: /*
09948: * <A NAME="subquery">subquery</A>
09949: */
09950: final public SubqueryNode subquery(int subqueryType,
09951: ValueNode leftOperand) throws ParseException,
09952: StandardException {
09953: ResultSetNode queryExpression;
09954: SubqueryNode subqueryNode;
09955: queryExpression = queryExpression(null, NO_SET_OP);
09956: subqueryNode = (SubqueryNode) nodeFactory.getNode(
09957: C_NodeTypes.SUBQUERY_NODE, queryExpression,
09958: ReuseFactory.getInteger(subqueryType), leftOperand,
09959: getContextManager());
09960: {
09961: if (true)
09962: return subqueryNode;
09963: }
09964: throw new Error("Missing return statement in function");
09965: }
09966:
09967: /*
09968: * <A NAME="inPredicateValue">inPredicateValue</A>
09969: */
09970: final public ValueNode inPredicateValue(ValueNode leftOperand)
09971: throws ParseException, StandardException {
09972: ValueNode retval;
09973: int tokKind;
09974: jj_consume_token(LEFT_PAREN);
09975: if (subqueryFollows()) {
09976: retval = tableSubquery(SubqueryNode.IN_SUBQUERY,
09977: leftOperand);
09978: } else if (jj_2_36(1)) {
09979: retval = inValueList(leftOperand);
09980: } else {
09981: jj_consume_token(-1);
09982: throw new ParseException();
09983: }
09984: jj_consume_token(RIGHT_PAREN);
09985: {
09986: if (true)
09987: return retval;
09988: }
09989: throw new Error("Missing return statement in function");
09990: }
09991:
09992: /*
09993: * <A NAME="inValueList">inValueList</A>
09994: */
09995: final public ValueNode inValueList(ValueNode leftOperand)
09996: throws ParseException, StandardException {
09997: ValueNodeList inList = (ValueNodeList) nodeFactory.getNode(
09998: C_NodeTypes.VALUE_NODE_LIST, getContextManager());
09999: inElement(inList);
10000: label_24: while (true) {
10001: switch (jj_nt.kind) {
10002: case COMMA:
10003: ;
10004: break;
10005: default:
10006: jj_la1[163] = jj_gen;
10007: break label_24;
10008: }
10009: jj_consume_token(COMMA);
10010: inElement(inList);
10011: }
10012: {
10013: if (true)
10014: return (ValueNode) nodeFactory.getNode(
10015: C_NodeTypes.IN_LIST_OPERATOR_NODE, leftOperand,
10016: inList, getContextManager());
10017: }
10018: throw new Error("Missing return statement in function");
10019: }
10020:
10021: /*
10022: * <A NAME="inElement">inElement</A>
10023: */
10024: final public void inElement(ValueNodeList inList)
10025: throws ParseException, StandardException {
10026: ValueNode valueNode;
10027: valueNode = additiveExpression(null, 0, false);
10028: inList.addElement(valueNode);
10029: }
10030:
10031: /*
10032: * <A NAME="quantifier">quantifier</A>
10033: */
10034: final public int quantifier(int opType) throws ParseException,
10035: StandardException {
10036: int retval = 0;
10037: switch (jj_nt.kind) {
10038: case ALL:
10039: jj_consume_token(ALL);
10040: switch (opType) {
10041: case BinaryOperatorNode.EQ:
10042: retval = SubqueryNode.EQ_ALL_SUBQUERY;
10043: break;
10044:
10045: case BinaryOperatorNode.NE:
10046: retval = SubqueryNode.NE_ALL_SUBQUERY;
10047: break;
10048:
10049: case BinaryOperatorNode.LE:
10050: retval = SubqueryNode.LE_ALL_SUBQUERY;
10051: break;
10052:
10053: case BinaryOperatorNode.LT:
10054: retval = SubqueryNode.LT_ALL_SUBQUERY;
10055: break;
10056:
10057: case BinaryOperatorNode.GE:
10058: retval = SubqueryNode.GE_ALL_SUBQUERY;
10059: break;
10060:
10061: case BinaryOperatorNode.GT:
10062: retval = SubqueryNode.GT_ALL_SUBQUERY;
10063: break;
10064:
10065: default:
10066: if (SanityManager.DEBUG)
10067: SanityManager
10068: .THROWASSERT("Invalid value for opType ("
10069: + opType
10070: + ") passed to quantifier()");
10071: }
10072: {
10073: if (true)
10074: return retval;
10075: }
10076: break;
10077: case ANY:
10078: case SOME:
10079: some();
10080: switch (opType) {
10081: case BinaryOperatorNode.EQ:
10082: retval = SubqueryNode.EQ_ANY_SUBQUERY;
10083: break;
10084:
10085: case BinaryOperatorNode.NE:
10086: retval = SubqueryNode.NE_ANY_SUBQUERY;
10087: break;
10088:
10089: case BinaryOperatorNode.LE:
10090: retval = SubqueryNode.LE_ANY_SUBQUERY;
10091: break;
10092:
10093: case BinaryOperatorNode.LT:
10094: retval = SubqueryNode.LT_ANY_SUBQUERY;
10095: break;
10096:
10097: case BinaryOperatorNode.GE:
10098: retval = SubqueryNode.GE_ANY_SUBQUERY;
10099: break;
10100:
10101: case BinaryOperatorNode.GT:
10102: retval = SubqueryNode.GT_ANY_SUBQUERY;
10103: break;
10104:
10105: default:
10106: if (SanityManager.DEBUG)
10107: SanityManager
10108: .THROWASSERT("Invalid value for opType ("
10109: + opType
10110: + ") passed to quantifier()");
10111: }
10112: {
10113: if (true)
10114: return retval;
10115: }
10116: break;
10117: default:
10118: jj_la1[164] = jj_gen;
10119: jj_consume_token(-1);
10120: throw new ParseException();
10121: }
10122: throw new Error("Missing return statement in function");
10123: }
10124:
10125: /*
10126: * <A NAME="some">some</A>
10127: */
10128: final public void some() throws ParseException, StandardException {
10129: switch (jj_nt.kind) {
10130: case SOME:
10131: jj_consume_token(SOME);
10132: break;
10133: case ANY:
10134: jj_consume_token(ANY);
10135: break;
10136: default:
10137: jj_la1[165] = jj_gen;
10138: jj_consume_token(-1);
10139: throw new ParseException();
10140: }
10141: }
10142:
10143: /*
10144: * <A NAME="existsExpression">existsExpression</A>
10145: */
10146: final public SubqueryNode existsExpression() throws ParseException,
10147: StandardException {
10148: SubqueryNode subqueryNode;
10149: jj_consume_token(EXISTS);
10150: jj_consume_token(LEFT_PAREN);
10151: subqueryNode = tableSubquery(SubqueryNode.EXISTS_SUBQUERY, null);
10152: jj_consume_token(RIGHT_PAREN);
10153: {
10154: if (true)
10155: return subqueryNode;
10156: }
10157: throw new Error("Missing return statement in function");
10158: }
10159:
10160: /*
10161: * <A NAME="tableExpression">tableExpression</A>
10162: */
10163: final public SelectNode tableExpression(ResultColumnList selectList)
10164: throws ParseException, StandardException {
10165: SelectNode selectNode;
10166: FromList fromList;
10167: ValueNode whereClause = null;
10168: GroupByList groupByList = null;
10169: ValueNode havingClause = null;
10170: Token whereToken;
10171: fromList = fromClause();
10172: switch (jj_nt.kind) {
10173: case WHERE:
10174: whereToken = jj_consume_token(WHERE);
10175: whereClause = whereClause(whereToken);
10176: break;
10177: default:
10178: jj_la1[166] = jj_gen;
10179: ;
10180: }
10181: switch (jj_nt.kind) {
10182: case GROUP:
10183: groupByList = groupByClause();
10184: break;
10185: default:
10186: jj_la1[167] = jj_gen;
10187: ;
10188: }
10189: switch (jj_nt.kind) {
10190: case HAVING:
10191: havingClause = havingClause();
10192: break;
10193: default:
10194: jj_la1[168] = jj_gen;
10195: ;
10196: }
10197: selectNode = (SelectNode) nodeFactory
10198: .getNode(C_NodeTypes.SELECT_NODE, selectList, null, /* AGGREGATE list */
10199: fromList, whereClause, groupByList, getContextManager());
10200:
10201: /* A SELECT with a GROUP BY or HAVING clause is the one instance where the
10202: * parser will generate a tree that does not exactly match the query.
10203: * The resulting tree is an outer SelectNode with the HAVING clause
10204: * as its WHERE clause and a FromList containing a single FromSubquery -
10205: * the user SELECT, minus the HAVING clause.
10206: * The outer SELECT gets a SELECT *.
10207: * The FromSubquery will have a null name, something that the user cannot do,
10208: * to enable the binding of any correlated columns in the HAVING clause.
10209: */
10210: if (groupByList != null || havingClause != null) {
10211: vetSelectList280(selectList);
10212:
10213: FromSubquery fromSubquery;
10214: ResultColumnList outerRCL = (ResultColumnList) nodeFactory
10215: .getNode(C_NodeTypes.RESULT_COLUMN_LIST,
10216: getContextManager());
10217:
10218: /* Wrap the user SELECT in a FromSubquery */
10219: fromList = (FromList) nodeFactory.getNode(
10220: C_NodeTypes.FROM_LIST, getNodeFactory()
10221: .doJoinOrderOptimization(),
10222: getContextManager());
10223: fromSubquery = (FromSubquery) nodeFactory.getNode(
10224: C_NodeTypes.FROM_SUBQUERY, selectNode, null, null,
10225: null, getContextManager());
10226: fromList.addElement(fromSubquery);
10227:
10228: /* Pull any aggregates out of the HAVING clause and append them to
10229: * SELECT list in the user's select, replacing the aggregates in
10230: * the HAVING clause with ColumnReferences to the aggregate.
10231: * Do NOT replace anything below a ResultSetNode. This means that
10232: * we'll replace
10233: * FROM x HAVING max(x.x) > 2
10234: * but not
10235: * FROM x HAVING x.x = (select max(y.y) from y)
10236: * Aggregates under a SELECT are all fixed up correctly
10237: * later, but here we need to get the aggregates that
10238: * aren't under result sets.
10239: *
10240: * Appended ResultColumns marked as generated so the wrapper
10241: * select won't see them when the * is expanded.
10242: *
10243: * RESOLVE - someday we should try to find matching aggregates
10244: * instead of just adding them.
10245: *
10246: * NOTE: This rewriting of the query tree makes the handling of an ORDER BY
10247: * clause difficult. See OrderByColumn.pullUpOrderByColumn. It makes specific
10248: * assumptions about the structure of the generated query tree. Do not make
10249: * any changes to this transformation without carefully considering the
10250: * OrderByColumn pullUpOrderByColumn and bindOrderByColumn methods.
10251: */
10252: if (havingClause != null) {
10253: ReplaceAggregatesWithCRVisitor visitor = new ReplaceAggregatesWithCRVisitor(
10254: selectList, ResultSetNode.class);
10255: havingClause = (ValueNode) havingClause.accept(visitor);
10256:
10257: // fix for HAVING without GROUP BY, makes sure we get one
10258: // aggregate operator by adding a count(*), this fixes beetle 5853, 5890
10259: if (groupByList == null) {
10260: ValueNode vn = (ValueNode) nodeFactory
10261: .getNode(
10262: C_NodeTypes.AGGREGATE_NODE,
10263: null,
10264: org.apache.derby.impl.sql.compile.CountAggregateDefinition.class,
10265: Boolean.FALSE, // distinct Boolean.TRUE?
10266: "COUNT(*)", getContextManager());
10267: AggregateNode n = (AggregateNode) vn;
10268: n.replaceAggregatesWithColumnReferences(selectList,
10269: 0);
10270: }
10271: }
10272:
10273: outerRCL.addResultColumn((ResultColumn) nodeFactory
10274: .getNode(C_NodeTypes.ALL_RESULT_COLUMN, null,
10275: getContextManager()));
10276: // wrap another selectNode on the outside of the subquery
10277: selectNode = (SelectNode) nodeFactory.getNode(
10278: C_NodeTypes.SELECT_NODE, outerRCL, /* SELECT * from user SELECT */
10279: null, /* AGGREGATE list */
10280: fromList, havingClause, null, /* GROUP BY list */
10281: getContextManager());
10282:
10283: /* Mark the wrapping FromSubquery and SelectNode as appropriate */
10284: if (groupByList != null) {
10285: fromSubquery.markAsForGroupByClause();
10286: selectNode.markAsForGroupByClause();
10287: }
10288: if (havingClause != null) {
10289: fromSubquery.markAsForHavingClause();
10290: selectNode.markAsForHavingClause();
10291: }
10292: }
10293: {
10294: if (true)
10295: return selectNode;
10296: }
10297: throw new Error("Missing return statement in function");
10298: }
10299:
10300: /*
10301: * <A NAME="fromClause">fromClause</A>
10302: */
10303: final public FromList fromClause() throws ParseException,
10304: StandardException {
10305: FromList fromList = (FromList) nodeFactory
10306: .getNode(C_NodeTypes.FROM_LIST, getNodeFactory()
10307: .doJoinOrderOptimization(), getContextManager());
10308: int tokKind;
10309: Token beginToken;
10310: Token endToken;
10311: jj_consume_token(FROM);
10312: beginToken = getToken(1);
10313: switch (jj_nt.kind) {
10314: case DERBYDASHPROPERTIES:
10315: fromListProperties(fromList);
10316: break;
10317: default:
10318: jj_la1[169] = jj_gen;
10319: ;
10320: }
10321: dummyTableReferenceRule(fromList);
10322: label_25: while (true) {
10323: switch (jj_nt.kind) {
10324: case COMMA:
10325: ;
10326: break;
10327: default:
10328: jj_la1[170] = jj_gen;
10329: break label_25;
10330: }
10331: jj_consume_token(COMMA);
10332: dummyTableReferenceRule(fromList);
10333: }
10334: endToken = getToken(0);
10335: fromList.setBeginOffset(beginToken.beginOffset);
10336: fromList.setEndOffset(endToken.endOffset);
10337: {
10338: if (true)
10339: return fromList;
10340: }
10341: throw new Error("Missing return statement in function");
10342: }
10343:
10344: /*
10345: * <A NAME="fromListProperties">fromListProperties</A>
10346: */
10347: final public void fromListProperties(FromList fromList)
10348: throws ParseException, StandardException {
10349: Properties properties;
10350: properties = propertyList(true);
10351: jj_consume_token(CHECK_PROPERTIES);
10352: fromList.setProperties(properties);
10353: }
10354:
10355: /* This rule created simply as a way to add the result of tableReference()
10356: * to the fromList.
10357: */
10358: final public void dummyTableReferenceRule(FromList fromList)
10359: throws ParseException, StandardException {
10360: FromTable tableReference;
10361: switch (jj_nt.kind) {
10362: case TABLE:
10363: jj_consume_token(TABLE);
10364: if (getToken(1).kind == LEFT_PAREN
10365: && (getToken(2).kind == SELECT || getToken(2).kind == VALUES)) {
10366:
10367: } else {
10368: jj_consume_token(-1);
10369: throw new ParseException();
10370: }
10371: tableReference = tableReferenceTypes(false);
10372: fromList.addFromTable(tableReference);
10373: break;
10374: default:
10375: jj_la1[171] = jj_gen;
10376: if (jj_2_37(1)) {
10377: tableReference = tableReferenceTypes(false);
10378: fromList.addFromTable(tableReference);
10379: } else {
10380: jj_consume_token(-1);
10381: throw new ParseException();
10382: }
10383: }
10384: }
10385:
10386: final public FromTable tableReferenceTypes(boolean nestedInParens)
10387: throws ParseException, StandardException {
10388: FromTable tableReference;
10389: if (jj_2_38(1)) {
10390: tableReference = tableReference(nestedInParens);
10391: {
10392: if (true)
10393: return tableReference;
10394: }
10395: } else {
10396: switch (jj_nt.kind) {
10397: case LEFT_BRACE:
10398: jj_consume_token(LEFT_BRACE);
10399: jj_consume_token(OJ);
10400: tableReference = tableReference(nestedInParens);
10401: jj_consume_token(RIGHT_BRACE);
10402: {
10403: if (true)
10404: return tableReference;
10405: }
10406: break;
10407: default:
10408: jj_la1[172] = jj_gen;
10409: jj_consume_token(-1);
10410: throw new ParseException();
10411: }
10412: }
10413: throw new Error("Missing return statement in function");
10414: }
10415:
10416: final public Object[] optionalTableClauses() throws ParseException,
10417: StandardException {
10418: Object[] otc = null;
10419: Properties tableProperties = null;
10420: ResultColumnList derivedRCL = null;
10421: String correlationName = null;
10422: switch (jj_nt.kind) {
10423: case DERBYDASHPROPERTIES:
10424: otc = optionalTableProperties();
10425: otc[OPTIONAL_TABLE_CLAUSES_DERIVED_RCL] = derivedRCL;
10426: otc[OPTIONAL_TABLE_CLAUSES_CORRELATION_NAME] = correlationName;
10427: {
10428: if (true)
10429: return otc;
10430: }
10431: break;
10432: default:
10433: jj_la1[177] = jj_gen;
10434: switch (jj_nt.kind) {
10435: case AS:
10436: case BINARY:
10437: case COALESCE:
10438: case COUNT:
10439: case D:
10440: case MODULE:
10441: case T:
10442: case TS:
10443: case VALUE:
10444: case VARBINARY:
10445: case ABS:
10446: case ABSVAL:
10447: case ACTION:
10448: case ALWAYS:
10449: case BLOB:
10450: case C:
10451: case CALLED:
10452: case CLOB:
10453: case COBOL:
10454: case COMMITTED:
10455: case CONCAT:
10456: case CONTAINS:
10457: case DATA:
10458: case DATE:
10459: case DAY:
10460: case DYNAMIC:
10461: case FORTRAN:
10462: case GENERATED:
10463: case IDENTITY_VAL_LOCAL:
10464: case INCREMENT:
10465: case INITIAL:
10466: case INTERVAL:
10467: case LANGUAGE:
10468: case LARGE:
10469: case LENGTH:
10470: case LEVEL:
10471: case LOCKS:
10472: case LOCKSIZE:
10473: case LOGGED:
10474: case MOD:
10475: case MODIFIES:
10476: case MODIFY:
10477: case MONTH:
10478: case _MORE:
10479: case MUMPS:
10480: case NAME:
10481: case NCLOB:
10482: case NULLABLE:
10483: case NUMBER:
10484: case OBJECT:
10485: case PASCAL:
10486: case PLI:
10487: case PRECISION:
10488: case RELEASE:
10489: case REPEATABLE:
10490: case RESTART:
10491: case RETURNS:
10492: case ROW:
10493: case SAVEPOINT:
10494: case SCALE:
10495: case SERIALIZABLE:
10496: case SQL_TSI_FRAC_SECOND:
10497: case SQL_TSI_SECOND:
10498: case SQL_TSI_MINUTE:
10499: case SQL_TSI_HOUR:
10500: case SQL_TSI_DAY:
10501: case SQL_TSI_WEEK:
10502: case SQL_TSI_MONTH:
10503: case SQL_TSI_QUARTER:
10504: case SQL_TSI_YEAR:
10505: case START:
10506: case STATEMENT:
10507: case SYNONYM:
10508: case THEN:
10509: case TIME:
10510: case TIMESTAMP:
10511: case TIMESTAMPADD:
10512: case TIMESTAMPDIFF:
10513: case TRUNCATE:
10514: case TYPE:
10515: case UNCOMMITTED:
10516: case USAGE:
10517: case WHEN:
10518: case CURDATE:
10519: case CURTIME:
10520: case DATABASE:
10521: case LONG:
10522: case AFTER:
10523: case BEFORE:
10524: case CLASS:
10525: case COMPRESS:
10526: case CONTENT:
10527: case CS:
10528: case DB2SQL:
10529: case DIRTY:
10530: case DOCUMENT:
10531: case EACH:
10532: case EMPTY:
10533: case EXCLUSIVE:
10534: case FN:
10535: case INDEX:
10536: case JAVA:
10537: case LCASE:
10538: case LOCATE:
10539: case LOCK:
10540: case MESSAGE_LOCALE:
10541: case METHOD:
10542: case MODE:
10543: case NEW:
10544: case NEW_TABLE:
10545: case OJ:
10546: case OFF:
10547: case OLD:
10548: case OLD_TABLE:
10549: case PARAMETER:
10550: case PASSING:
10551: case PROPERTIES:
10552: case READS:
10553: case REF:
10554: case REFERENCING:
10555: case RENAME:
10556: case RESET:
10557: case RESULT:
10558: case RETAIN:
10559: case RETURNING:
10560: case RR:
10561: case RS:
10562: case SEQUENCE:
10563: case SEQUENTIAL:
10564: case SETS:
10565: case SHARE:
10566: case SQLID:
10567: case SPECIFIC:
10568: case SQRT:
10569: case STABILITY:
10570: case STRIP:
10571: case STYLE:
10572: case TRIGGER:
10573: case UCASE:
10574: case UR:
10575: case WHITESPACE:
10576: case IDENTIFIER:
10577: case DELIMITED_IDENTIFIER:
10578: switch (jj_nt.kind) {
10579: case AS:
10580: jj_consume_token(AS);
10581: break;
10582: default:
10583: jj_la1[173] = jj_gen;
10584: ;
10585: }
10586: correlationName = identifier(
10587: Limits.MAX_IDENTIFIER_LENGTH, true);
10588: switch (jj_nt.kind) {
10589: case LEFT_PAREN:
10590: jj_consume_token(LEFT_PAREN);
10591: derivedRCL = derivedColumnList();
10592: jj_consume_token(RIGHT_PAREN);
10593: break;
10594: default:
10595: jj_la1[174] = jj_gen;
10596: ;
10597: }
10598: switch (jj_nt.kind) {
10599: case DERBYDASHPROPERTIES:
10600: tableProperties = propertyList(true);
10601: jj_consume_token(CHECK_PROPERTIES);
10602: break;
10603: default:
10604: jj_la1[175] = jj_gen;
10605: ;
10606: }
10607: break;
10608: default:
10609: jj_la1[176] = jj_gen;
10610: ;
10611: }
10612: otc = new Object[OPTIONAL_TABLE_CLAUSES_SIZE];
10613: otc[OPTIONAL_TABLE_CLAUSES_TABLE_PROPERTIES] = tableProperties;
10614: otc[OPTIONAL_TABLE_CLAUSES_DERIVED_RCL] = derivedRCL;
10615: otc[OPTIONAL_TABLE_CLAUSES_CORRELATION_NAME] = correlationName;
10616: {
10617: if (true)
10618: return otc;
10619: }
10620: }
10621: throw new Error("Missing return statement in function");
10622: }
10623:
10624: final public Object[] optionalTableProperties()
10625: throws ParseException, StandardException {
10626: Object[] otc = null;
10627: Properties tableProperties = null;
10628: tableProperties = propertyList(true);
10629: jj_consume_token(CHECK_PROPERTIES);
10630: otc = new Object[OPTIONAL_TABLE_CLAUSES_SIZE];
10631: otc[OPTIONAL_TABLE_CLAUSES_TABLE_PROPERTIES] = tableProperties;
10632: {
10633: if (true)
10634: return otc;
10635: }
10636: throw new Error("Missing return statement in function");
10637: }
10638:
10639: /*
10640: * <A NAME="tableReference">tableReference</A>
10641: */
10642: final public FromTable tableReference(boolean nestedInParens)
10643: throws ParseException, StandardException {
10644: JavaToSQLValueNode javaToSQLNode = null;
10645: TableName tableName;
10646: String correlationName = null;
10647: ResultColumnList derivedRCL = null;
10648: FromTable fromTable;
10649: TableOperatorNode joinTable = null;
10650: FromTable tableReference;
10651: Object[] optionalTableClauses = new Object[OPTIONAL_TABLE_CLAUSES_SIZE];
10652: Properties tableProperties = null;
10653: ResultSetNode derivedTable;
10654: if (newInvocationFollows(1)) {
10655: javaToSQLNode = newInvocation();
10656: switch (jj_nt.kind) {
10657: case AS:
10658: jj_consume_token(AS);
10659: break;
10660: default:
10661: jj_la1[178] = jj_gen;
10662: ;
10663: }
10664: correlationName = identifier(Limits.MAX_IDENTIFIER_LENGTH,
10665: true);
10666: switch (jj_nt.kind) {
10667: case LEFT_PAREN:
10668: jj_consume_token(LEFT_PAREN);
10669: derivedRCL = derivedColumnList();
10670: jj_consume_token(RIGHT_PAREN);
10671: break;
10672: default:
10673: jj_la1[179] = jj_gen;
10674: ;
10675: }
10676: switch (jj_nt.kind) {
10677: case DERBYDASHPROPERTIES:
10678: optionalTableClauses = optionalTableProperties();
10679: break;
10680: default:
10681: jj_la1[180] = jj_gen;
10682: ;
10683: }
10684: label_26: while (true) {
10685: if (joinedTableExpressionFollows()) {
10686: ;
10687: } else {
10688: break label_26;
10689: }
10690: joinTable = joinedTableExpression(
10691: (joinTable != null) ? joinTable
10692: : (FromTable) nodeFactory
10693: .getNode(
10694: C_NodeTypes.FROM_VTI,
10695: javaToSQLNode
10696: .getJavaValueNode(),
10697: correlationName,
10698: derivedRCL,
10699: ((optionalTableClauses != null) ? (Properties) optionalTableClauses[OPTIONAL_TABLE_CLAUSES_TABLE_PROPERTIES]
10700: : (Properties) null),
10701: getContextManager()),
10702: nestedInParens);
10703: }
10704: /* Build a derived table if not a join expression */
10705: if (joinTable == null) {
10706: fromTable = (FromTable) nodeFactory
10707: .getNode(
10708: C_NodeTypes.FROM_VTI,
10709: javaToSQLNode.getJavaValueNode(),
10710: correlationName,
10711: derivedRCL,
10712: ((optionalTableClauses != null) ? (Properties) optionalTableClauses[OPTIONAL_TABLE_CLAUSES_TABLE_PROPERTIES]
10713: : (Properties) null),
10714: getContextManager());
10715: } else {
10716: fromTable = joinTable;
10717: }
10718:
10719: {
10720: if (true)
10721: return fromTable;
10722: }
10723: } else {
10724: switch (jj_nt.kind) {
10725: case BINARY:
10726: case COALESCE:
10727: case COUNT:
10728: case D:
10729: case MODULE:
10730: case T:
10731: case TS:
10732: case VALUE:
10733: case VARBINARY:
10734: case ABS:
10735: case ABSVAL:
10736: case ACTION:
10737: case ALWAYS:
10738: case BLOB:
10739: case C:
10740: case CALLED:
10741: case CLOB:
10742: case COBOL:
10743: case COMMITTED:
10744: case CONCAT:
10745: case CONTAINS:
10746: case DATA:
10747: case DATE:
10748: case DAY:
10749: case DYNAMIC:
10750: case FORTRAN:
10751: case GENERATED:
10752: case IDENTITY_VAL_LOCAL:
10753: case INCREMENT:
10754: case INITIAL:
10755: case INTERVAL:
10756: case LANGUAGE:
10757: case LARGE:
10758: case LENGTH:
10759: case LEVEL:
10760: case LOCKS:
10761: case LOCKSIZE:
10762: case LOGGED:
10763: case MOD:
10764: case MODIFIES:
10765: case MODIFY:
10766: case MONTH:
10767: case _MORE:
10768: case MUMPS:
10769: case NAME:
10770: case NCLOB:
10771: case NULLABLE:
10772: case NUMBER:
10773: case OBJECT:
10774: case PASCAL:
10775: case PLI:
10776: case PRECISION:
10777: case RELEASE:
10778: case REPEATABLE:
10779: case RESTART:
10780: case RETURNS:
10781: case ROW:
10782: case SAVEPOINT:
10783: case SCALE:
10784: case SERIALIZABLE:
10785: case SQL_TSI_FRAC_SECOND:
10786: case SQL_TSI_SECOND:
10787: case SQL_TSI_MINUTE:
10788: case SQL_TSI_HOUR:
10789: case SQL_TSI_DAY:
10790: case SQL_TSI_WEEK:
10791: case SQL_TSI_MONTH:
10792: case SQL_TSI_QUARTER:
10793: case SQL_TSI_YEAR:
10794: case START:
10795: case STATEMENT:
10796: case SYNONYM:
10797: case THEN:
10798: case TIME:
10799: case TIMESTAMP:
10800: case TIMESTAMPADD:
10801: case TIMESTAMPDIFF:
10802: case TRUNCATE:
10803: case TYPE:
10804: case UNCOMMITTED:
10805: case USAGE:
10806: case WHEN:
10807: case CURDATE:
10808: case CURTIME:
10809: case DATABASE:
10810: case LONG:
10811: case AFTER:
10812: case BEFORE:
10813: case CLASS:
10814: case COMPRESS:
10815: case CONTENT:
10816: case CS:
10817: case DB2SQL:
10818: case DIRTY:
10819: case DOCUMENT:
10820: case EACH:
10821: case EMPTY:
10822: case EXCLUSIVE:
10823: case FN:
10824: case INDEX:
10825: case JAVA:
10826: case LCASE:
10827: case LOCATE:
10828: case LOCK:
10829: case MESSAGE_LOCALE:
10830: case METHOD:
10831: case MODE:
10832: case NEW:
10833: case NEW_TABLE:
10834: case OJ:
10835: case OFF:
10836: case OLD:
10837: case OLD_TABLE:
10838: case PARAMETER:
10839: case PASSING:
10840: case PROPERTIES:
10841: case READS:
10842: case REF:
10843: case REFERENCING:
10844: case RENAME:
10845: case RESET:
10846: case RESULT:
10847: case RETAIN:
10848: case RETURNING:
10849: case RR:
10850: case RS:
10851: case SEQUENCE:
10852: case SEQUENTIAL:
10853: case SETS:
10854: case SHARE:
10855: case SQLID:
10856: case SPECIFIC:
10857: case SQRT:
10858: case STABILITY:
10859: case STRIP:
10860: case STYLE:
10861: case TRIGGER:
10862: case UCASE:
10863: case UR:
10864: case WHITESPACE:
10865: case IDENTIFIER:
10866: case DELIMITED_IDENTIFIER:
10867: /* identifier() used to be correlationName() */
10868: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
10869: optionalTableClauses = optionalTableClauses();
10870: label_27: while (true) {
10871: if (joinedTableExpressionFollows()) {
10872: ;
10873: } else {
10874: break label_27;
10875: }
10876: joinTable = joinedTableExpression(
10877: (joinTable != null) ? joinTable
10878: : (FromTable) nodeFactory
10879: .getNode(
10880: C_NodeTypes.FROM_BASE_TABLE,
10881: tableName,
10882: (String) optionalTableClauses[OPTIONAL_TABLE_CLAUSES_CORRELATION_NAME],
10883: (ResultColumnList) optionalTableClauses[OPTIONAL_TABLE_CLAUSES_DERIVED_RCL],
10884: (Properties) optionalTableClauses[OPTIONAL_TABLE_CLAUSES_TABLE_PROPERTIES],
10885: getContextManager()),
10886: nestedInParens);
10887: }
10888: /* Build a from table if not a join expression */
10889: if (joinTable == null) {
10890: fromTable = (FromTable) nodeFactory
10891: .getNode(
10892: C_NodeTypes.FROM_BASE_TABLE,
10893: tableName,
10894: (String) optionalTableClauses[OPTIONAL_TABLE_CLAUSES_CORRELATION_NAME],
10895: (ResultColumnList) optionalTableClauses[OPTIONAL_TABLE_CLAUSES_DERIVED_RCL],
10896: (Properties) optionalTableClauses[OPTIONAL_TABLE_CLAUSES_TABLE_PROPERTIES],
10897: getContextManager());
10898: } else {
10899: fromTable = joinTable;
10900: }
10901: {
10902: if (true)
10903: return fromTable;
10904: }
10905: break;
10906: default:
10907: jj_la1[184] = jj_gen;
10908: if (getToken(1).kind == LEFT_PAREN
10909: && (getToken(2).kind == SELECT || getToken(2).kind == VALUES)) {
10910: derivedTable = derivedTable();
10911: switch (jj_nt.kind) {
10912: case AS:
10913: jj_consume_token(AS);
10914: break;
10915: default:
10916: jj_la1[181] = jj_gen;
10917: ;
10918: }
10919: correlationName = identifier(
10920: Limits.MAX_IDENTIFIER_LENGTH, true);
10921: switch (jj_nt.kind) {
10922: case LEFT_PAREN:
10923: jj_consume_token(LEFT_PAREN);
10924: derivedRCL = derivedColumnList();
10925: jj_consume_token(RIGHT_PAREN);
10926: break;
10927: default:
10928: jj_la1[182] = jj_gen;
10929: ;
10930: }
10931: switch (jj_nt.kind) {
10932: case DERBYDASHPROPERTIES:
10933: optionalTableClauses = optionalTableProperties();
10934: break;
10935: default:
10936: jj_la1[183] = jj_gen;
10937: ;
10938: }
10939: label_28: while (true) {
10940: if (joinedTableExpressionFollows()) {
10941: ;
10942: } else {
10943: break label_28;
10944: }
10945: joinTable = joinedTableExpression(
10946: (joinTable != null) ? joinTable
10947: : (FromTable) nodeFactory
10948: .getNode(
10949: C_NodeTypes.FROM_SUBQUERY,
10950: derivedTable,
10951: correlationName,
10952: derivedRCL,
10953: ((optionalTableClauses != null) ? (Properties) optionalTableClauses[OPTIONAL_TABLE_CLAUSES_TABLE_PROPERTIES]
10954: : (Properties) null),
10955: getContextManager()),
10956: nestedInParens);
10957: }
10958: /* Build a derived table if not a join expression */
10959: if (joinTable == null) {
10960: fromTable = (FromTable) nodeFactory
10961: .getNode(
10962: C_NodeTypes.FROM_SUBQUERY,
10963: derivedTable,
10964: correlationName,
10965: derivedRCL,
10966: ((optionalTableClauses != null) ? (Properties) optionalTableClauses[OPTIONAL_TABLE_CLAUSES_TABLE_PROPERTIES]
10967: : (Properties) null),
10968: getContextManager());
10969: } else {
10970: fromTable = joinTable;
10971: }
10972:
10973: {
10974: if (true)
10975: return fromTable;
10976: }
10977: } else {
10978: switch (jj_nt.kind) {
10979: case LEFT_PAREN:
10980: jj_consume_token(LEFT_PAREN);
10981: tableReference = tableReferenceTypes(true);
10982: jj_consume_token(RIGHT_PAREN);
10983: label_29: while (true) {
10984: if (joinedTableExpressionFollows()) {
10985: ;
10986: } else {
10987: break label_29;
10988: }
10989: joinTable = joinedTableExpression(
10990: (joinTable != null) ? joinTable
10991: : tableReference,
10992: nestedInParens);
10993: }
10994: if (joinTable == null) {
10995: fromTable = tableReference;
10996: } else {
10997: fromTable = joinTable;
10998: }
10999:
11000: {
11001: if (true)
11002: return fromTable;
11003: }
11004: break;
11005: default:
11006: jj_la1[185] = jj_gen;
11007: jj_consume_token(-1);
11008: throw new ParseException();
11009: }
11010: }
11011: }
11012: }
11013: throw new Error("Missing return statement in function");
11014: }
11015:
11016: /*
11017: * <A NAME="derivedColumnList">derivedColumnList</A>
11018: */
11019: final public ResultColumnList derivedColumnList()
11020: throws ParseException, StandardException {
11021: ResultColumnList resultColumns = (ResultColumnList) nodeFactory
11022: .getNode(C_NodeTypes.RESULT_COLUMN_LIST,
11023: getContextManager());
11024: columnNameList(resultColumns);
11025: {
11026: if (true)
11027: return resultColumns;
11028: }
11029: throw new Error("Missing return statement in function");
11030: }
11031:
11032: /*
11033: * <A NAME="columnNameList">columnNameList</A>
11034: */
11035: final public void columnNameList(ResultColumnList columnList)
11036: throws ParseException, StandardException {
11037: columnNameItem(columnList);
11038: label_30: while (true) {
11039: switch (jj_nt.kind) {
11040: case COMMA:
11041: ;
11042: break;
11043: default:
11044: jj_la1[186] = jj_gen;
11045: break label_30;
11046: }
11047: jj_consume_token(COMMA);
11048: columnNameItem(columnList);
11049: }
11050: }
11051:
11052: /*
11053: * <A NAME="columnNameItem">columnNameItem</A>
11054: */
11055: final public void columnNameItem(ResultColumnList columnList)
11056: throws ParseException, StandardException {
11057: String columnName;
11058: ResultColumn resultColumn;
11059: /* identifier() used to be columnName() */
11060: columnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
11061: /*
11062: ** Store the column names for the result columns in the
11063: ** result column list. We don't know yet what valueNodes
11064: ** should be hooked up to each result column, so set that
11065: ** to null for now.
11066: */
11067: resultColumn = (ResultColumn) nodeFactory.getNode(
11068: C_NodeTypes.RESULT_COLUMN, columnName, null,
11069: getContextManager());
11070: columnList.addResultColumn(resultColumn);
11071: }
11072:
11073: /*
11074: * <A NAME="indexColumnList">indexColumnList</A>
11075: */
11076: final public void indexColumnList(Vector columnList)
11077: throws ParseException, StandardException {
11078: indexColumnItem(columnList);
11079: label_31: while (true) {
11080: switch (jj_nt.kind) {
11081: case COMMA:
11082: ;
11083: break;
11084: default:
11085: jj_la1[187] = jj_gen;
11086: break label_31;
11087: }
11088: jj_consume_token(COMMA);
11089: indexColumnItem(columnList);
11090: }
11091: }
11092:
11093: /*
11094: * <A NAME="indexColumnItem">indexColumnItem</A>
11095: */
11096: final public void indexColumnItem(Vector columnList)
11097: throws ParseException, StandardException {
11098: String columnName;
11099: /* identifier never ends with a space; appending a space meaning desc */
11100: columnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
11101: switch (jj_nt.kind) {
11102: case ASC:
11103: case DESC:
11104: switch (jj_nt.kind) {
11105: case ASC:
11106: jj_consume_token(ASC);
11107: break;
11108: case DESC:
11109: jj_consume_token(DESC);
11110: columnName = columnName + ' ';
11111: break;
11112: default:
11113: jj_la1[188] = jj_gen;
11114: jj_consume_token(-1);
11115: throw new ParseException();
11116: }
11117: break;
11118: default:
11119: jj_la1[189] = jj_gen;
11120: ;
11121: }
11122: /*
11123: ** Store the column names for the index columns in the
11124: ** index column list.
11125: */
11126: columnList.addElement(columnName);
11127: }
11128:
11129: /*
11130: * <A NAME="derivedTable">derivedTable</A>
11131: */
11132: final public ResultSetNode derivedTable() throws ParseException,
11133: StandardException {
11134: SubqueryNode tableSubquery;
11135: jj_consume_token(LEFT_PAREN);
11136: tableSubquery = tableSubquery(SubqueryNode.FROM_SUBQUERY, null);
11137: jj_consume_token(RIGHT_PAREN);
11138: {
11139: if (true)
11140: return tableSubquery.getResultSet();
11141: }
11142: throw new Error("Missing return statement in function");
11143: }
11144:
11145: final public TableOperatorNode joinedTableExpression(
11146: ResultSetNode leftRSN, boolean nestedInParens)
11147: throws ParseException, StandardException {
11148: TableOperatorNode joinNode;
11149: joinNode = qualifiedJoin(leftRSN, nestedInParens);
11150: {
11151: if (true)
11152: return joinNode;
11153: }
11154: throw new Error("Missing return statement in function");
11155: }
11156:
11157: final public TableOperatorNode qualifiedJoin(ResultSetNode leftRSN,
11158: boolean nestedInParens) throws ParseException,
11159: StandardException {
11160: int joinType = JoinNode.INNERJOIN;
11161: ResultSetNode rightRSN;
11162: TableOperatorNode ton = null;
11163: Object[] onOrUsingClause = null;
11164: ResultColumnList usingClause = null;
11165: ValueNode onClause;
11166: switch (jj_nt.kind) {
11167: case INNER:
11168: case LEFT:
11169: case RIGHT:
11170: joinType = joinType();
11171: break;
11172: default:
11173: jj_la1[190] = jj_gen;
11174: ;
11175: }
11176: jj_consume_token(JOIN);
11177: rightRSN = tableReferenceTypes(nestedInParens);
11178: onOrUsingClause = joinSpecification(leftRSN, rightRSN);
11179: /* If NATURAL OR UNION is specified, then no joinSpecification()
11180: * is required, otherwise it is required.
11181: */
11182:
11183: /* RESOLVE - Since we don't support NATURAL or UNION joins yet,
11184: * onOrUsingClause must be non-null. (Change error message if and
11185: * when grammar changes.)
11186: */
11187:
11188: /* Figure out whether an ON or USING clause was used */
11189: onClause = (ValueNode) onOrUsingClause[ON_CLAUSE];
11190: usingClause = (ResultColumnList) onOrUsingClause[USING_CLAUSE];
11191:
11192: if (onClause == null && usingClause == null) {
11193: {
11194: if (true)
11195: throw StandardException.newException(
11196: SQLState.LANG_MISSING_JOIN_SPECIFICATION,
11197: JoinNode.joinTypeToString(joinType));
11198: }
11199: }
11200:
11201: switch (joinType) {
11202: case JoinNode.INNERJOIN:
11203: ton = (TableOperatorNode) nodeFactory.getNode(
11204: C_NodeTypes.JOIN_NODE, leftRSN, rightRSN, onClause,
11205: usingClause, null, null, null, getContextManager());
11206: break;
11207:
11208: case JoinNode.LEFTOUTERJOIN:
11209: ton = (TableOperatorNode) nodeFactory.getNode(
11210: C_NodeTypes.HALF_OUTER_JOIN_NODE, leftRSN,
11211: rightRSN, onClause, usingClause, Boolean.FALSE,
11212: null, getContextManager());
11213: break;
11214:
11215: case JoinNode.RIGHTOUTERJOIN:
11216: ton = (TableOperatorNode) nodeFactory.getNode(
11217: C_NodeTypes.HALF_OUTER_JOIN_NODE, leftRSN,
11218: rightRSN, onClause, usingClause, Boolean.TRUE,
11219: null, getContextManager());
11220: break;
11221:
11222: default:
11223: if (SanityManager.DEBUG) {
11224: SanityManager.ASSERT(false, "Unexpected joinType");
11225: }
11226: {
11227: if (true)
11228: return null;
11229: }
11230: }
11231:
11232: /* Mark whether or not we are nested within parens */
11233: ton.setNestedInParens(nestedInParens);
11234: {
11235: if (true)
11236: return ton;
11237: }
11238: throw new Error("Missing return statement in function");
11239: }
11240:
11241: final public int joinType() throws ParseException,
11242: StandardException {
11243: int joinType;
11244: switch (jj_nt.kind) {
11245: case INNER:
11246: jj_consume_token(INNER);
11247: {
11248: if (true)
11249: return JoinNode.INNERJOIN;
11250: }
11251: break;
11252: case LEFT:
11253: case RIGHT:
11254: joinType = outerJoinType();
11255: switch (jj_nt.kind) {
11256: case OUTER:
11257: jj_consume_token(OUTER);
11258: break;
11259: default:
11260: jj_la1[191] = jj_gen;
11261: ;
11262: }
11263: {
11264: if (true)
11265: return joinType;
11266: }
11267: break;
11268: default:
11269: jj_la1[192] = jj_gen;
11270: jj_consume_token(-1);
11271: throw new ParseException();
11272: }
11273: throw new Error("Missing return statement in function");
11274: }
11275:
11276: final public int outerJoinType() throws ParseException,
11277: StandardException {
11278: switch (jj_nt.kind) {
11279: case LEFT:
11280: jj_consume_token(LEFT);
11281: {
11282: if (true)
11283: return JoinNode.LEFTOUTERJOIN;
11284: }
11285: break;
11286: case RIGHT:
11287: jj_consume_token(RIGHT);
11288: {
11289: if (true)
11290: return JoinNode.RIGHTOUTERJOIN;
11291: }
11292: break;
11293: default:
11294: jj_la1[193] = jj_gen;
11295: jj_consume_token(-1);
11296: throw new ParseException();
11297: }
11298: throw new Error("Missing return statement in function");
11299: }
11300:
11301: final public Object[] joinSpecification(ResultSetNode leftRSN,
11302: ResultSetNode rightRSN) throws ParseException,
11303: StandardException {
11304: Object[] onOrUsingClause = new Object[ON_OR_USING_CLAUSE_SIZE];
11305: ResultColumnList usingClause = null;
11306: ValueNode joinClause = null;
11307: joinClause = joinCondition();
11308: onOrUsingClause[ON_CLAUSE] = joinClause;
11309: onOrUsingClause[USING_CLAUSE] = usingClause;
11310: {
11311: if (true)
11312: return onOrUsingClause;
11313: }
11314: throw new Error("Missing return statement in function");
11315: }
11316:
11317: final public ValueNode joinCondition() throws ParseException,
11318: StandardException {
11319: ValueNode joinClause;
11320: jj_consume_token(ON);
11321: joinClause = valueExpression(false);
11322: {
11323: if (true)
11324: return joinClause;
11325: }
11326: throw new Error("Missing return statement in function");
11327: }
11328:
11329: /*
11330: * <A NAME="tableValueConstructor">tableValueConstructor</A>
11331: */
11332: final public ResultSetNode tableValueConstructor()
11333: throws ParseException, StandardException {
11334: ResultSetNode resultSetNode;
11335: jj_consume_token(VALUES);
11336: resultSetNode = tableValueConstructorList();
11337: {
11338: if (true)
11339: return resultSetNode;
11340: }
11341: throw new Error("Missing return statement in function");
11342: }
11343:
11344: /*
11345: * <A NAME="tableValueConstructorList">tableValueConstructorList</A>
11346: */
11347: final public ResultSetNode tableValueConstructorList()
11348: throws ParseException, StandardException {
11349: ResultSetNode resultSetNode;
11350: resultSetNode = rowValueConstructor(null);
11351: label_32: while (true) {
11352: switch (jj_nt.kind) {
11353: case COMMA:
11354: ;
11355: break;
11356: default:
11357: jj_la1[194] = jj_gen;
11358: break label_32;
11359: }
11360: jj_consume_token(COMMA);
11361: resultSetNode = rowValueConstructor(resultSetNode);
11362: }
11363: if (resultSetNode instanceof UnionNode) {
11364: ((UnionNode) resultSetNode).markTopTableConstructor();
11365: }
11366:
11367: {
11368: if (true)
11369: return resultSetNode;
11370: }
11371: throw new Error("Missing return statement in function");
11372: }
11373:
11374: /*
11375: * <A NAME="explicitTable">explicitTable</A>
11376: */
11377:
11378: /*
11379: * <A NAME="datetimeValueFunction">datetimeValueFunction</A>
11380: */
11381: final public ValueNode datetimeValueFunction()
11382: throws ParseException, StandardException {
11383: int prec = -1;
11384: if ((getToken(1).kind == CURRENT && getToken(2).kind == DATE)) {
11385: jj_consume_token(CURRENT);
11386: jj_consume_token(DATE);
11387: {
11388: if (true)
11389: return (ValueNode) nodeFactory
11390: .getNode(
11391: C_NodeTypes.CURRENT_DATETIME_OPERATOR_NODE,
11392: ReuseFactory
11393: .getInteger(CurrentDatetimeOperatorNode.CURRENT_DATE),
11394: getContextManager());
11395: }
11396: } else {
11397: switch (jj_nt.kind) {
11398: case CURRENT_DATE:
11399: jj_consume_token(CURRENT_DATE);
11400: {
11401: if (true)
11402: return (ValueNode) nodeFactory
11403: .getNode(
11404: C_NodeTypes.CURRENT_DATETIME_OPERATOR_NODE,
11405: ReuseFactory
11406: .getInteger(CurrentDatetimeOperatorNode.CURRENT_DATE),
11407: getContextManager());
11408: }
11409: break;
11410: default:
11411: jj_la1[195] = jj_gen;
11412: if ((getToken(1).kind == CURRENT && getToken(2).kind == TIME)) {
11413: jj_consume_token(CURRENT);
11414: jj_consume_token(TIME);
11415: {
11416: if (true)
11417: return (ValueNode) nodeFactory
11418: .getNode(
11419: C_NodeTypes.CURRENT_DATETIME_OPERATOR_NODE,
11420: ReuseFactory
11421: .getInteger(CurrentDatetimeOperatorNode.CURRENT_TIME),
11422: getContextManager());
11423: }
11424: } else {
11425: switch (jj_nt.kind) {
11426: case CURRENT_TIME:
11427: jj_consume_token(CURRENT_TIME);
11428: {
11429: if (true)
11430: return (ValueNode) nodeFactory
11431: .getNode(
11432: C_NodeTypes.CURRENT_DATETIME_OPERATOR_NODE,
11433: ReuseFactory
11434: .getInteger(CurrentDatetimeOperatorNode.CURRENT_TIME),
11435: getContextManager());
11436: }
11437: break;
11438: default:
11439: jj_la1[196] = jj_gen;
11440: if ((getToken(1).kind == CURRENT && getToken(2).kind == TIMESTAMP)) {
11441: jj_consume_token(CURRENT);
11442: jj_consume_token(TIMESTAMP);
11443: {
11444: if (true)
11445: return (ValueNode) nodeFactory
11446: .getNode(
11447: C_NodeTypes.CURRENT_DATETIME_OPERATOR_NODE,
11448: ReuseFactory
11449: .getInteger(CurrentDatetimeOperatorNode.CURRENT_TIMESTAMP),
11450: getContextManager());
11451: }
11452: } else {
11453: switch (jj_nt.kind) {
11454: case CURRENT_TIMESTAMP:
11455: jj_consume_token(CURRENT_TIMESTAMP);
11456: {
11457: if (true)
11458: return (ValueNode) nodeFactory
11459: .getNode(
11460: C_NodeTypes.CURRENT_DATETIME_OPERATOR_NODE,
11461: ReuseFactory
11462: .getInteger(CurrentDatetimeOperatorNode.CURRENT_TIMESTAMP),
11463: getContextManager());
11464: }
11465: break;
11466: default:
11467: jj_la1[197] = jj_gen;
11468: jj_consume_token(-1);
11469: throw new ParseException();
11470: }
11471: }
11472: }
11473: }
11474: }
11475: }
11476: throw new Error("Missing return statement in function");
11477: }
11478:
11479: /*
11480: ** Note that set function and aggregate are used
11481: ** interchangeably in the parser. The tree has
11482: ** aggregate nodes.
11483: */
11484: final public ValueNode aggregateNode() throws ParseException,
11485: StandardException {
11486: ValueNode agg;
11487: switch (jj_nt.kind) {
11488: case COUNT:
11489: jj_consume_token(COUNT);
11490: jj_consume_token(LEFT_PAREN);
11491: switch (jj_nt.kind) {
11492: case ASTERISK:
11493: jj_consume_token(ASTERISK);
11494: agg = (ValueNode) nodeFactory.getNode(
11495: C_NodeTypes.AGGREGATE_NODE, null,
11496: CountAggregateDefinition.class, Boolean.FALSE,
11497: "COUNT(*)", getContextManager());
11498: break;
11499: default:
11500: jj_la1[198] = jj_gen;
11501: if (jj_2_39(1)) {
11502: agg = aggregateExpression("COUNT",
11503: CountAggregateDefinition.class);
11504: } else {
11505: jj_consume_token(-1);
11506: throw new ParseException();
11507: }
11508: }
11509: jj_consume_token(RIGHT_PAREN);
11510: {
11511: if (true)
11512: return agg;
11513: }
11514: break;
11515: case AVG:
11516: case MAX:
11517: case MIN:
11518: case SUM:
11519: agg = generalAggregate();
11520: {
11521: if (true)
11522: return agg;
11523: }
11524: break;
11525: default:
11526: jj_la1[199] = jj_gen;
11527: jj_consume_token(-1);
11528: throw new ParseException();
11529: }
11530: throw new Error("Missing return statement in function");
11531: }
11532:
11533: final public ValueNode aggregateExpression(String aggName,
11534: Class aggClass) throws ParseException, StandardException {
11535: boolean distinct = false;
11536: ValueNode value;
11537: if (jj_2_40(1)) {
11538: distinct = setQuantifier();
11539: } else {
11540: ;
11541: }
11542: value = additiveExpression(null, 0, false);
11543: {
11544: if (true)
11545: return (ValueNode) nodeFactory.getNode(
11546: C_NodeTypes.AGGREGATE_NODE, value, aggClass,
11547: distinct ? Boolean.TRUE : Boolean.FALSE,
11548: aggName, getContextManager());
11549: }
11550: throw new Error("Missing return statement in function");
11551: }
11552:
11553: final public ValueNode generalAggregate() throws ParseException,
11554: StandardException {
11555: Token aggToken;
11556: String methodAliasString;
11557: ValueNode aggExpr;
11558: ValueNode value;
11559: aggToken = builtInAggregateType();
11560: jj_consume_token(LEFT_PAREN);
11561: aggExpr = aggregateExpression(aggName(aggToken),
11562: aggClass(aggToken));
11563: jj_consume_token(RIGHT_PAREN);
11564: {
11565: if (true)
11566: return aggExpr;
11567: }
11568: throw new Error("Missing return statement in function");
11569: }
11570:
11571: /*
11572: ** All built in aggregates are pretty similar to user
11573: ** defined aggregates, except we know what to map to
11574: ** without looking up the class name.
11575: **
11576: ** NOTE: COUNT is omitted here because the COUNT aggregate is
11577: ** factored into a different rule, to distinguish between
11578: ** COUNT(*) and COUNT(<expression>).
11579: */
11580: final public Token builtInAggregateType() throws ParseException,
11581: StandardException {
11582: Token retval;
11583: switch (jj_nt.kind) {
11584: case MAX:
11585: retval = jj_consume_token(MAX);
11586: break;
11587: case AVG:
11588: retval = jj_consume_token(AVG);
11589: break;
11590: case MIN:
11591: retval = jj_consume_token(MIN);
11592: break;
11593: case SUM:
11594: retval = jj_consume_token(SUM);
11595: break;
11596: default:
11597: jj_la1[200] = jj_gen;
11598: jj_consume_token(-1);
11599: throw new ParseException();
11600: }
11601: {
11602: if (true)
11603: return retval;
11604: }
11605: throw new Error("Missing return statement in function");
11606: }
11607:
11608: final public ValueNode castSpecification() throws ParseException,
11609: StandardException {
11610: DataTypeDescriptor dts;
11611: ValueNode treeTop;
11612: ValueNode value;
11613: int charType;
11614: int length = -1;
11615: jj_consume_token(CAST);
11616: jj_consume_token(LEFT_PAREN);
11617: value = castOperand();
11618: jj_consume_token(AS);
11619: dts = dataTypeCast();
11620: jj_consume_token(RIGHT_PAREN);
11621: treeTop = (ValueNode) nodeFactory.getNode(
11622: C_NodeTypes.CAST_NODE, value, dts, getContextManager());
11623:
11624: /* We need to generate a SQL->Java conversion tree above us if
11625: * the dataTypeCast is a user type.
11626: */
11627: if (dts.getTypeId().userType()) {
11628: treeTop = (ValueNode) nodeFactory.getNode(
11629: C_NodeTypes.JAVA_TO_SQL_VALUE_NODE, nodeFactory
11630: .getNode(
11631: C_NodeTypes.SQL_TO_JAVA_VALUE_NODE,
11632: treeTop, getContextManager()),
11633: getContextManager());
11634: }
11635:
11636: {
11637: if (true)
11638: return treeTop;
11639: }
11640: throw new Error("Missing return statement in function");
11641: }
11642:
11643: /*
11644: * <A NAME="charOrVarchar">charOrVarchar</A>
11645: */
11646: final public int charOrVarchar() throws ParseException {
11647: switch (jj_nt.kind) {
11648: case CHAR:
11649: jj_consume_token(CHAR);
11650: {
11651: if (true)
11652: return Types.CHAR;
11653: }
11654: break;
11655: case VARCHAR:
11656: jj_consume_token(VARCHAR);
11657: {
11658: if (true)
11659: return Types.VARCHAR;
11660: }
11661: break;
11662: default:
11663: jj_la1[201] = jj_gen;
11664: jj_consume_token(-1);
11665: throw new ParseException();
11666: }
11667: throw new Error("Missing return statement in function");
11668: }
11669:
11670: final public ValueNode castOperand() throws ParseException,
11671: StandardException {
11672: ValueNode value;
11673: if (jj_2_41(1)) {
11674: value = additiveExpression(null, 0, false);
11675: {
11676: if (true)
11677: return value;
11678: }
11679: } else {
11680: switch (jj_nt.kind) {
11681: case NULL:
11682: jj_consume_token(NULL);
11683: {
11684: if (true)
11685: return (ValueNode) nodeFactory.getNode(
11686: C_NodeTypes.UNTYPED_NULL_CONSTANT_NODE,
11687: getContextManager());
11688: }
11689: break;
11690: default:
11691: jj_la1[202] = jj_gen;
11692: jj_consume_token(-1);
11693: throw new ParseException();
11694: }
11695: }
11696: throw new Error("Missing return statement in function");
11697: }
11698:
11699: /*
11700: * <A NAME="dynamicParameterSpecification">dynamicParameterSpecification</A>
11701: */
11702: final public ParameterNode dynamicParameterSpecification()
11703: throws ParseException, StandardException {
11704: jj_consume_token(QUESTION_MARK);
11705: {
11706: if (true)
11707: return makeParameterNode();
11708: }
11709: throw new Error("Missing return statement in function");
11710: }
11711:
11712: /*
11713: * <A NAME="whereClause">whereClause</A>
11714: */
11715: final public ValueNode whereClause(Token beginToken)
11716: throws ParseException, StandardException {
11717: ValueNode value;
11718: Token endToken;
11719: /* valueExpression() was searchCondition() */
11720: value = valueExpression(false);
11721: endToken = getToken(0);
11722:
11723: value.setBeginOffset(beginToken.endOffset + 1);
11724: value.setEndOffset(endToken.endOffset);
11725:
11726: {
11727: if (true)
11728: return value;
11729: }
11730: throw new Error("Missing return statement in function");
11731: }
11732:
11733: final public GroupByList groupByClause() throws ParseException,
11734: StandardException {
11735: GroupByList groupingCols;
11736: jj_consume_token(GROUP);
11737: jj_consume_token(BY);
11738: groupingCols = groupingColumnReferenceList();
11739: {
11740: if (true)
11741: return groupingCols;
11742: }
11743: throw new Error("Missing return statement in function");
11744: }
11745:
11746: final public GroupByList groupingColumnReferenceList()
11747: throws ParseException, StandardException {
11748: GroupByList groupingCols = (GroupByList) nodeFactory.getNode(
11749: C_NodeTypes.GROUP_BY_LIST, getContextManager());
11750: groupingColumnReference(groupingCols);
11751: label_33: while (true) {
11752: switch (jj_nt.kind) {
11753: case COMMA:
11754: ;
11755: break;
11756: default:
11757: jj_la1[203] = jj_gen;
11758: break label_33;
11759: }
11760: jj_consume_token(COMMA);
11761: groupingColumnReference(groupingCols);
11762: }
11763: {
11764: if (true)
11765: return groupingCols;
11766: }
11767: throw new Error("Missing return statement in function");
11768: }
11769:
11770: final public void groupingColumnReference(GroupByList groupingCols)
11771: throws ParseException, StandardException {
11772: ValueNode columnExpression;
11773: columnExpression = additiveExpression(null, 0, false);
11774: if (columnExpression.isParameterNode()) {
11775: {
11776: if (true)
11777: throw StandardException.newException(
11778: SQLState.LANG_SYNTAX_ERROR, "?");
11779: }
11780: }
11781: if (columnExpression instanceof AggregateNode) {
11782: AggregateNode agNode = (AggregateNode) columnExpression;
11783: {
11784: if (true)
11785: throw StandardException.newException(
11786: SQLState.LANG_AGGREGATE_IN_GROUPBY_LIST,
11787: agNode.getAggregateName());
11788: }
11789: }
11790: groupingCols.addGroupByColumn((GroupByColumn) nodeFactory
11791: .getNode(C_NodeTypes.GROUP_BY_COLUMN, columnExpression,
11792: getContextManager()));
11793: }
11794:
11795: final public ValueNode havingClause() throws ParseException,
11796: StandardException {
11797: ValueNode value;
11798: jj_consume_token(HAVING);
11799: value = valueExpression(false);
11800: {
11801: if (true)
11802: return value;
11803: }
11804: throw new Error("Missing return statement in function");
11805: }
11806:
11807: final public QueryTreeNode schemaDefinition()
11808: throws ParseException, StandardException {
11809: String schemaName = null;
11810: String authName = null;
11811: jj_consume_token(SCHEMA);
11812: switch (jj_nt.kind) {
11813: case BINARY:
11814: case COALESCE:
11815: case COUNT:
11816: case D:
11817: case MODULE:
11818: case T:
11819: case TS:
11820: case VALUE:
11821: case VARBINARY:
11822: case ABS:
11823: case ABSVAL:
11824: case ACTION:
11825: case ALWAYS:
11826: case BLOB:
11827: case C:
11828: case CALLED:
11829: case CLOB:
11830: case COBOL:
11831: case COMMITTED:
11832: case CONCAT:
11833: case CONTAINS:
11834: case DATA:
11835: case DATE:
11836: case DAY:
11837: case DYNAMIC:
11838: case FORTRAN:
11839: case GENERATED:
11840: case IDENTITY_VAL_LOCAL:
11841: case INCREMENT:
11842: case INITIAL:
11843: case INTERVAL:
11844: case LANGUAGE:
11845: case LARGE:
11846: case LENGTH:
11847: case LEVEL:
11848: case LOCKS:
11849: case LOCKSIZE:
11850: case LOGGED:
11851: case MOD:
11852: case MODIFIES:
11853: case MODIFY:
11854: case MONTH:
11855: case _MORE:
11856: case MUMPS:
11857: case NAME:
11858: case NCLOB:
11859: case NULLABLE:
11860: case NUMBER:
11861: case OBJECT:
11862: case PASCAL:
11863: case PLI:
11864: case PRECISION:
11865: case RELEASE:
11866: case REPEATABLE:
11867: case RESTART:
11868: case RETURNS:
11869: case ROW:
11870: case SAVEPOINT:
11871: case SCALE:
11872: case SERIALIZABLE:
11873: case SQL_TSI_FRAC_SECOND:
11874: case SQL_TSI_SECOND:
11875: case SQL_TSI_MINUTE:
11876: case SQL_TSI_HOUR:
11877: case SQL_TSI_DAY:
11878: case SQL_TSI_WEEK:
11879: case SQL_TSI_MONTH:
11880: case SQL_TSI_QUARTER:
11881: case SQL_TSI_YEAR:
11882: case START:
11883: case STATEMENT:
11884: case SYNONYM:
11885: case THEN:
11886: case TIME:
11887: case TIMESTAMP:
11888: case TIMESTAMPADD:
11889: case TIMESTAMPDIFF:
11890: case TRUNCATE:
11891: case TYPE:
11892: case UNCOMMITTED:
11893: case USAGE:
11894: case WHEN:
11895: case CURDATE:
11896: case CURTIME:
11897: case DATABASE:
11898: case LONG:
11899: case AFTER:
11900: case BEFORE:
11901: case CLASS:
11902: case COMPRESS:
11903: case CONTENT:
11904: case CS:
11905: case DB2SQL:
11906: case DIRTY:
11907: case DOCUMENT:
11908: case EACH:
11909: case EMPTY:
11910: case EXCLUSIVE:
11911: case FN:
11912: case INDEX:
11913: case JAVA:
11914: case LCASE:
11915: case LOCATE:
11916: case LOCK:
11917: case MESSAGE_LOCALE:
11918: case METHOD:
11919: case MODE:
11920: case NEW:
11921: case NEW_TABLE:
11922: case OJ:
11923: case OFF:
11924: case OLD:
11925: case OLD_TABLE:
11926: case PARAMETER:
11927: case PASSING:
11928: case PROPERTIES:
11929: case READS:
11930: case REF:
11931: case REFERENCING:
11932: case RENAME:
11933: case RESET:
11934: case RESULT:
11935: case RETAIN:
11936: case RETURNING:
11937: case RR:
11938: case RS:
11939: case SEQUENCE:
11940: case SEQUENTIAL:
11941: case SETS:
11942: case SHARE:
11943: case SQLID:
11944: case SPECIFIC:
11945: case SQRT:
11946: case STABILITY:
11947: case STRIP:
11948: case STYLE:
11949: case TRIGGER:
11950: case UCASE:
11951: case UR:
11952: case WHITESPACE:
11953: case IDENTIFIER:
11954: case DELIMITED_IDENTIFIER:
11955: schemaName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
11956: switch (jj_nt.kind) {
11957: case AUTHORIZATION:
11958: jj_consume_token(AUTHORIZATION);
11959: authName = identifier(Limits.MAX_IDENTIFIER_LENGTH,
11960: true);
11961: break;
11962: default:
11963: jj_la1[204] = jj_gen;
11964: ;
11965: }
11966: if (authName != null)
11967: checkVersion(DataDictionary.DD_VERSION_DERBY_10_2,
11968: "AUTHORIZATION");
11969:
11970: if (schemaName.startsWith("SYS")) {
11971: if (true)
11972: throw StandardException.newException(
11973: SQLState.INVALID_SCHEMA_SYS, schemaName);
11974: }
11975:
11976: {
11977: if (true)
11978: return (QueryTreeNode) nodeFactory.getNode(
11979: C_NodeTypes.CREATE_SCHEMA_NODE, schemaName,
11980: authName, getContextManager());
11981: }
11982: break;
11983: case AUTHORIZATION:
11984: jj_consume_token(AUTHORIZATION);
11985: authName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
11986: checkVersion(DataDictionary.DD_VERSION_DERBY_10_2,
11987: "AUTHORIZATION");
11988: if (authName.startsWith("SYS")) {
11989: if (true)
11990: throw StandardException.newException(
11991: SQLState.INVALID_SCHEMA_SYS, authName);
11992: }
11993:
11994: {
11995: if (true)
11996: return (QueryTreeNode) nodeFactory.getNode(
11997: C_NodeTypes.CREATE_SCHEMA_NODE, authName,
11998: authName, getContextManager());
11999: }
12000: break;
12001: default:
12002: jj_la1[205] = jj_gen;
12003: jj_consume_token(-1);
12004: throw new ParseException();
12005: }
12006: throw new Error("Missing return statement in function");
12007: }
12008:
12009: /*
12010: * <A NAME="tableDefinition">tableDefinition</A>
12011: */
12012: final public QueryTreeNode tableDefinition() throws ParseException,
12013: StandardException {
12014: char lockGranularity = TableDescriptor.DEFAULT_LOCK_GRANULARITY;
12015: Properties properties = null;
12016: TableName tableName;
12017: TableElementList tableElementList;
12018: jj_consume_token(TABLE);
12019: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
12020: tableElementList = tableElementList();
12021: switch (jj_nt.kind) {
12022: case DERBYDASHPROPERTIES:
12023: properties = propertyList(false);
12024: jj_consume_token(CHECK_PROPERTIES);
12025: break;
12026: default:
12027: jj_la1[206] = jj_gen;
12028: ;
12029: }
12030: {
12031: if (true)
12032: return (QueryTreeNode) nodeFactory.getNode(
12033: C_NodeTypes.CREATE_TABLE_NODE, tableName,
12034: tableElementList, properties, new Character(
12035: lockGranularity), getContextManager());
12036: }
12037: throw new Error("Missing return statement in function");
12038: }
12039:
12040: /*
12041: * This method is called when a comment starting with --derby-properties is found.
12042: * Such a comment is a special directive to Derby and allows a sql to pass optimizer
12043: * overrides. Derby looks for propertyName=value [,propertyName=value]* after
12044: * --derby-properties and returns these properties in a Properties object as a return
12045: * value of this method.
12046: * The param propertiesUseAllowed true indicates that users are allowed to
12047: * specify optimizer overrides in the given context.
12048: * False means optimizer overrides in the given context are allowed internally
12049: * only eg impl/load/import.java specifies property insertMode=replace/bulkInsert
12050: * in the insert statement. This same property will not be acceptable from an
12051: * insert statement from a user sql.
12052: */
12053: final public Properties propertyList(boolean propertiesUseAllowed)
12054: throws ParseException, StandardException {
12055: Properties properties = new FormatableProperties();
12056: StringTokenizer commaSeparatedProperties;
12057: StringTokenizer equalOperatorSeparatedProperty;
12058: jj_consume_token(DERBYDASHPROPERTIES);
12059: //first use StringTokenizer to get tokens which are delimited by ,s
12060: commaSeparatedProperties = new StringTokenizer(
12061: getToken(1).image, ",");
12062: while (commaSeparatedProperties.hasMoreTokens()) {
12063: //Now verify that tokens delimited by ,s follow propertyName=value pattern
12064: String currentProperty = commaSeparatedProperties
12065: .nextToken();
12066: equalOperatorSeparatedProperty = new StringTokenizer(
12067: currentProperty, "=", true);
12068: if (equalOperatorSeparatedProperty.countTokens() != 3) {
12069: if (true)
12070: throw StandardException
12071: .newException(SQLState.PROPERTY_SYNTAX_INVALID);
12072: } else {
12073: String key = equalOperatorSeparatedProperty.nextToken()
12074: .trim();
12075: if (!equalOperatorSeparatedProperty.nextToken().equals(
12076: "=")) {
12077: if (true)
12078: throw StandardException
12079: .newException(SQLState.PROPERTY_SYNTAX_INVALID);
12080: }
12081: String value = equalOperatorSeparatedProperty
12082: .nextToken().trim();
12083: verifyImageLength(value);
12084: /* Trim off the leading and trailing ', and compress all '' to ' */
12085: if (value.startsWith("'") && value.endsWith("'"))
12086: value = compressQuotes(value.substring(1, value
12087: .length() - 1), SINGLEQUOTES);
12088: /* Trim off the leading and trailing ", and compress all "" to " */
12089: else if (value.startsWith("\"") && value.endsWith("\""))
12090: value = compressQuotes(value.substring(1, value
12091: .length() - 1), DOUBLEQUOTES);
12092: else
12093: value = value.toUpperCase();
12094: // Do not allow user to specify multiple values for the same key
12095: if (properties.put(key, value) != null) {
12096: {
12097: if (true)
12098: throw StandardException.newException(
12099: SQLState.LANG_DUPLICATE_PROPERTY,
12100: key);
12101: }
12102: }
12103: }
12104: }
12105: //if this property override is supported in internal mode only, then do that verification here.
12106: if (!propertiesUseAllowed)
12107: checkInternalFeature("DERBY-PROPERTIES");
12108: {
12109: if (true)
12110: return properties;
12111: }
12112: throw new Error("Missing return statement in function");
12113: }
12114:
12115: /*
12116: * <A NAME="DB2lockGranularityClause">DB2lockGranularityClause</A>
12117: */
12118: final public char DB2lockGranularityClause() throws ParseException,
12119: StandardException {
12120: char lockGranularity;
12121: jj_consume_token(LOCKSIZE);
12122: lockGranularity = lockGranularity();
12123: {
12124: if (true)
12125: return lockGranularity;
12126: }
12127: throw new Error("Missing return statement in function");
12128: }
12129:
12130: /*
12131: * <A NAME="lockGranularity">lockGranularity</A>
12132: */
12133: final public char lockGranularity() throws ParseException,
12134: StandardException {
12135: switch (jj_nt.kind) {
12136: case TABLE:
12137: jj_consume_token(TABLE);
12138: {
12139: if (true)
12140: return TableDescriptor.TABLE_LOCK_GRANULARITY;
12141: }
12142: break;
12143: case ROW:
12144: jj_consume_token(ROW);
12145: {
12146: if (true)
12147: return TableDescriptor.ROW_LOCK_GRANULARITY;
12148: }
12149: break;
12150: default:
12151: jj_la1[207] = jj_gen;
12152: jj_consume_token(-1);
12153: throw new ParseException();
12154: }
12155: throw new Error("Missing return statement in function");
12156: }
12157:
12158: /*
12159: * <A NAME="indexDefinition">indexDefinition</A>
12160: */
12161: final public QueryTreeNode indexDefinition() throws ParseException,
12162: StandardException {
12163: Boolean unique = Boolean.FALSE;
12164: Properties properties = null;
12165: TableName indexName;
12166: TableName tableName;
12167: Vector indexColumnList = new Vector();
12168: switch (jj_nt.kind) {
12169: case UNIQUE:
12170: unique = unique();
12171: break;
12172: default:
12173: jj_la1[208] = jj_gen;
12174: ;
12175: }
12176: jj_consume_token(INDEX);
12177: indexName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
12178: jj_consume_token(ON);
12179: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
12180: jj_consume_token(LEFT_PAREN);
12181: indexColumnList(indexColumnList);
12182: jj_consume_token(RIGHT_PAREN);
12183: switch (jj_nt.kind) {
12184: case DERBYDASHPROPERTIES:
12185: properties = propertyList(false);
12186: jj_consume_token(CHECK_PROPERTIES);
12187: break;
12188: default:
12189: jj_la1[209] = jj_gen;
12190: ;
12191: }
12192: /* User allowed to specify schema name on table and index.
12193: * If no schema name specified for index, then it "inherits"
12194: * its schema name from the table.
12195: * If index has a schema name and table does not, then
12196: * table "inherits" its schema name from the index.
12197: * If schema names are specified for both objects, then the
12198: * schema names must be the same.
12199: */
12200: if (indexName.getSchemaName() == null) {
12201: indexName.setSchemaName(tableName.getSchemaName());
12202: } else if (tableName.getSchemaName() == null) {
12203: tableName.setSchemaName(indexName.getSchemaName());
12204: } else {
12205: /* schema name specified for both */
12206: if (!(indexName.getSchemaName().equals(tableName
12207: .getSchemaName()))) {
12208: {
12209: if (true)
12210: throw StandardException
12211: .newException(
12212: SQLState.LANG_INDEX_AND_TABLE_IN_DIFFERENT_SCHEMAS,
12213: indexName, tableName);
12214: }
12215: }
12216: }
12217: {
12218: if (true)
12219: return (QueryTreeNode) nodeFactory.getNode(
12220: C_NodeTypes.CREATE_INDEX_NODE, unique,
12221: DEFAULT_INDEX_TYPE, indexName, tableName,
12222: indexColumnList, properties,
12223: getContextManager());
12224: }
12225: throw new Error("Missing return statement in function");
12226: }
12227:
12228: /*
12229: * <A NAME="unique">unique</A>
12230: */
12231: final public Boolean unique() throws ParseException,
12232: StandardException {
12233: jj_consume_token(UNIQUE);
12234: {
12235: if (true)
12236: return Boolean.TRUE;
12237: }
12238: throw new Error("Missing return statement in function");
12239: }
12240:
12241: /**
12242: CREATE PROCEDURE
12243:
12244: procedureElements contains the description of the procedure.
12245: (CREATE FUNCTIONS shares this lyout), see functionDefinition
12246:
12247: 0 - Object[] 3 element array for parameters
12248: 1 - TableName - specific name
12249: 2 - Integer - dynamic result set count
12250: 3 - String language (always java) - ignore
12251: 4 - String external name (also passed directly to create alias node - ignore
12252: 5 - Short parameter style (always java) - ignore
12253: 6 - Short - SQL allowed.
12254: 7 - Boolean - CALLED ON NULL INPUT (always TRUE for procedures)
12255: 8 - TypeDescriptor - return type (always NULL for procedures)
12256: */
12257: final public QueryTreeNode procedureDefinition()
12258: throws ParseException, StandardException {
12259: TableName procedureName;
12260: Object[] procedureElements = new Object[9];
12261: jj_consume_token(PROCEDURE);
12262: procedureName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
12263: procedureElements[0] = procedureParameterList();
12264: label_34: while (true) {
12265: routineElement(true, procedureElements);
12266: switch (jj_nt.kind) {
12267: case EXTERNAL:
12268: case NO:
12269: case CALLED:
12270: case CONTAINS:
12271: case DYNAMIC:
12272: case LANGUAGE:
12273: case MODIFIES:
12274: case RETURNS:
12275: case PARAMETER:
12276: case READS:
12277: case RESULT:
12278: case SPECIFIC:
12279: ;
12280: break;
12281: default:
12282: jj_la1[210] = jj_gen;
12283: break label_34;
12284: }
12285: }
12286: checkRequiredRoutineClause(JAVA_ROUTINE_CLAUSES,
12287: procedureElements);
12288:
12289: {
12290: if (true)
12291: return getCreateAliasNode(procedureName,
12292: (String) procedureElements[4],
12293: procedureElements,
12294: AliasInfo.ALIAS_TYPE_PROCEDURE_AS_CHAR,
12295: Boolean.FALSE);
12296: }
12297: throw new Error("Missing return statement in function");
12298: }
12299:
12300: final public void routineElement(boolean isProcedure,
12301: Object[] routineElements) throws ParseException,
12302: StandardException {
12303: int drs;
12304: int clausePosition = -1;
12305: Object clauseValue = null;
12306: switch (jj_nt.kind) {
12307: case SPECIFIC:
12308: jj_consume_token(SPECIFIC);
12309: clauseValue = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
12310: clausePosition = 1;
12311: {
12312: if (true)
12313: throw StandardException.newException(
12314: SQLState.NOT_IMPLEMENTED,
12315: "SPECIFIC identifier");
12316: }
12317: break;
12318: case DYNAMIC:
12319: case RESULT:
12320: switch (jj_nt.kind) {
12321: case DYNAMIC:
12322: jj_consume_token(DYNAMIC);
12323: break;
12324: default:
12325: jj_la1[211] = jj_gen;
12326: ;
12327: }
12328: jj_consume_token(RESULT);
12329: jj_consume_token(SETS);
12330: drs = uint_value();
12331: if (!isProcedure) {
12332: if (true)
12333: throw StandardException.newException(
12334: SQLState.LANG_SYNTAX_ERROR, "RESULT SETS");
12335: }
12336: clauseValue = ReuseFactory.getInteger(drs);
12337: clausePosition = 2;
12338: break;
12339: case LANGUAGE:
12340: jj_consume_token(LANGUAGE);
12341: jj_consume_token(JAVA);
12342: clauseValue = "JAVA";
12343: clausePosition = 3;
12344: break;
12345: case EXTERNAL:
12346: jj_consume_token(EXTERNAL);
12347: jj_consume_token(NAME);
12348: clauseValue = string();
12349: clausePosition = 4;
12350: break;
12351: case PARAMETER:
12352: jj_consume_token(PARAMETER);
12353: jj_consume_token(STYLE);
12354: clauseValue = parameterStyle();
12355: clausePosition = 5;
12356: break;
12357: case NO:
12358: jj_consume_token(NO);
12359: jj_consume_token(SQL);
12360: clauseValue = ReuseFactory
12361: .getShort(RoutineAliasInfo.NO_SQL);
12362: clausePosition = 6;
12363: break;
12364: case CONTAINS:
12365: jj_consume_token(CONTAINS);
12366: jj_consume_token(SQL);
12367: clauseValue = ReuseFactory
12368: .getShort(RoutineAliasInfo.CONTAINS_SQL);
12369: clausePosition = 6;
12370: break;
12371: case READS:
12372: jj_consume_token(READS);
12373: jj_consume_token(SQL);
12374: jj_consume_token(DATA);
12375: clauseValue = ReuseFactory
12376: .getShort(RoutineAliasInfo.READS_SQL_DATA);
12377: clausePosition = 6;
12378: break;
12379: case MODIFIES:
12380: jj_consume_token(MODIFIES);
12381: jj_consume_token(SQL);
12382: jj_consume_token(DATA);
12383: if (!isProcedure) {
12384: if (true)
12385: throw StandardException.newException(
12386: SQLState.LANG_SYNTAX_ERROR,
12387: "MODIFIES SQL DATA");
12388: }
12389: clauseValue = ReuseFactory
12390: .getShort(RoutineAliasInfo.MODIFIES_SQL_DATA);
12391: clausePosition = 6;
12392: break;
12393: case CALLED:
12394: case RETURNS:
12395: clauseValue = calledOnNullInput(isProcedure);
12396: clausePosition = 7;
12397: break;
12398: default:
12399: jj_la1[212] = jj_gen;
12400: jj_consume_token(-1);
12401: throw new ParseException();
12402: }
12403: if (clausePosition != -1) {
12404: // check for repeated clause
12405: if (routineElements[clausePosition] != null) {
12406:
12407: String which = ROUTINE_CLAUSE_NAMES[clausePosition];
12408: {
12409: if (true)
12410: throw StandardException.newException(
12411: SQLState.LANG_DB2_MULTIPLE_ELEMENTS,
12412: which);
12413: }
12414: }
12415:
12416: routineElements[clausePosition] = clauseValue;
12417: }
12418: }
12419:
12420: final public Boolean calledOnNullInput(boolean isProcedure)
12421: throws ParseException, StandardException {
12422: Boolean calledOnNull;
12423: switch (jj_nt.kind) {
12424: case CALLED:
12425: jj_consume_token(CALLED);
12426: calledOnNull = Boolean.TRUE;
12427: break;
12428: case RETURNS:
12429: jj_consume_token(RETURNS);
12430: jj_consume_token(NULL);
12431: if (isProcedure) {
12432: if (true)
12433: throw StandardException.newException(
12434: SQLState.LANG_SYNTAX_ERROR,
12435: "RETURNS NULL ON NULL INPUT");
12436: }
12437:
12438: calledOnNull = Boolean.FALSE;
12439: break;
12440: default:
12441: jj_la1[213] = jj_gen;
12442: jj_consume_token(-1);
12443: throw new ParseException();
12444: }
12445: jj_consume_token(ON);
12446: jj_consume_token(NULL);
12447: jj_consume_token(INPUT);
12448: {
12449: if (true)
12450: return calledOnNull;
12451: }
12452: throw new Error("Missing return statement in function");
12453: }
12454:
12455: final public Short parameterStyle() throws ParseException {
12456: jj_consume_token(JAVA);
12457: {
12458: if (true)
12459: return ReuseFactory.getShort(RoutineAliasInfo.PS_JAVA);
12460: }
12461: throw new Error("Missing return statement in function");
12462: }
12463:
12464: final public Object[] procedureParameterList()
12465: throws ParseException, StandardException {
12466: Vector[] list = new Vector[3];
12467: list[0] = new Vector(); // name
12468: list[1] = new Vector(); // type
12469: list[2] = new Vector();
12470: jj_consume_token(LEFT_PAREN);
12471: switch (jj_nt.kind) {
12472: case BINARY:
12473: case COALESCE:
12474: case COUNT:
12475: case D:
12476: case IN:
12477: case MODULE:
12478: case T:
12479: case TS:
12480: case VALUE:
12481: case VARBINARY:
12482: case ABS:
12483: case ABSVAL:
12484: case ACTION:
12485: case ALWAYS:
12486: case BLOB:
12487: case C:
12488: case CALLED:
12489: case CLOB:
12490: case COBOL:
12491: case COMMITTED:
12492: case CONCAT:
12493: case CONTAINS:
12494: case DATA:
12495: case DATE:
12496: case DAY:
12497: case DYNAMIC:
12498: case FORTRAN:
12499: case GENERATED:
12500: case IDENTITY_VAL_LOCAL:
12501: case INCREMENT:
12502: case INITIAL:
12503: case INOUT:
12504: case INTERVAL:
12505: case LANGUAGE:
12506: case LARGE:
12507: case LENGTH:
12508: case LEVEL:
12509: case LOCKS:
12510: case LOCKSIZE:
12511: case LOGGED:
12512: case MOD:
12513: case MODIFIES:
12514: case MODIFY:
12515: case MONTH:
12516: case _MORE:
12517: case MUMPS:
12518: case NAME:
12519: case NCLOB:
12520: case NULLABLE:
12521: case NUMBER:
12522: case OBJECT:
12523: case PASCAL:
12524: case PLI:
12525: case PRECISION:
12526: case RELEASE:
12527: case REPEATABLE:
12528: case RESTART:
12529: case RETURNS:
12530: case ROW:
12531: case SAVEPOINT:
12532: case SCALE:
12533: case SERIALIZABLE:
12534: case SQL_TSI_FRAC_SECOND:
12535: case SQL_TSI_SECOND:
12536: case SQL_TSI_MINUTE:
12537: case SQL_TSI_HOUR:
12538: case SQL_TSI_DAY:
12539: case SQL_TSI_WEEK:
12540: case SQL_TSI_MONTH:
12541: case SQL_TSI_QUARTER:
12542: case SQL_TSI_YEAR:
12543: case START:
12544: case STATEMENT:
12545: case SYNONYM:
12546: case THEN:
12547: case TIME:
12548: case TIMESTAMP:
12549: case TIMESTAMPADD:
12550: case TIMESTAMPDIFF:
12551: case TRUNCATE:
12552: case TYPE:
12553: case UNCOMMITTED:
12554: case USAGE:
12555: case WHEN:
12556: case CURDATE:
12557: case CURTIME:
12558: case DATABASE:
12559: case LONG:
12560: case AFTER:
12561: case BEFORE:
12562: case CLASS:
12563: case COMPRESS:
12564: case CONTENT:
12565: case CS:
12566: case DB2SQL:
12567: case DIRTY:
12568: case DOCUMENT:
12569: case EACH:
12570: case EMPTY:
12571: case EXCLUSIVE:
12572: case FN:
12573: case INDEX:
12574: case JAVA:
12575: case LCASE:
12576: case LOCATE:
12577: case LOCK:
12578: case MESSAGE_LOCALE:
12579: case METHOD:
12580: case MODE:
12581: case NEW:
12582: case NEW_TABLE:
12583: case OJ:
12584: case OFF:
12585: case OLD:
12586: case OLD_TABLE:
12587: case OUT:
12588: case PARAMETER:
12589: case PASSING:
12590: case PROPERTIES:
12591: case READS:
12592: case REF:
12593: case REFERENCING:
12594: case RENAME:
12595: case RESET:
12596: case RESULT:
12597: case RETAIN:
12598: case RETURNING:
12599: case RR:
12600: case RS:
12601: case SEQUENCE:
12602: case SEQUENTIAL:
12603: case SETS:
12604: case SHARE:
12605: case SQLID:
12606: case SPECIFIC:
12607: case SQRT:
12608: case STABILITY:
12609: case STRIP:
12610: case STYLE:
12611: case TRIGGER:
12612: case UCASE:
12613: case UR:
12614: case WHITESPACE:
12615: case IDENTIFIER:
12616: case DELIMITED_IDENTIFIER:
12617: procedureParameterDefinition(list);
12618: label_35: while (true) {
12619: switch (jj_nt.kind) {
12620: case COMMA:
12621: ;
12622: break;
12623: default:
12624: jj_la1[214] = jj_gen;
12625: break label_35;
12626: }
12627: jj_consume_token(COMMA);
12628: procedureParameterDefinition(list);
12629: }
12630: break;
12631: default:
12632: jj_la1[215] = jj_gen;
12633: ;
12634: }
12635: jj_consume_token(RIGHT_PAREN);
12636: {
12637: if (true)
12638: return list;
12639: }
12640: throw new Error("Missing return statement in function");
12641: }
12642:
12643: /*
12644: * <A NAME="Definition">procedureParameterDefinition</A>
12645: */
12646: final public void procedureParameterDefinition(Vector[] list)
12647: throws ParseException, StandardException {
12648: DataTypeDescriptor typeDescriptor;
12649: String parameterName;
12650: Integer inout;
12651: inout = inoutParameter();
12652: parameterName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
12653: typeDescriptor = dataTypeDDL();
12654: list[0].addElement(parameterName);
12655: list[1].addElement(typeDescriptor);
12656: list[2].addElement(inout);
12657: }
12658:
12659: final public Integer inoutParameter() throws ParseException {
12660: int mode = JDBC30Translation.PARAMETER_MODE_IN;
12661: switch (jj_nt.kind) {
12662: case IN:
12663: case INOUT:
12664: case OUT:
12665: switch (jj_nt.kind) {
12666: case IN:
12667: jj_consume_token(IN);
12668:
12669: break;
12670: case OUT:
12671: jj_consume_token(OUT);
12672: mode = JDBC30Translation.PARAMETER_MODE_OUT;
12673: break;
12674: case INOUT:
12675: jj_consume_token(INOUT);
12676: mode = JDBC30Translation.PARAMETER_MODE_IN_OUT;
12677: break;
12678: default:
12679: jj_la1[216] = jj_gen;
12680: jj_consume_token(-1);
12681: throw new ParseException();
12682: }
12683: break;
12684: default:
12685: jj_la1[217] = jj_gen;
12686: ;
12687: }
12688: {
12689: if (true)
12690: return ReuseFactory.getInteger(mode);
12691: }
12692: throw new Error("Missing return statement in function");
12693: }
12694:
12695: /**
12696: CREATE FUNCTION
12697:
12698: functionElements contains the description of the function.
12699:
12700: 0 - Object[] 3 element array for parameters
12701: 1 - TableName - specific name
12702: 2 - Integer - dynamic result set count - always 0
12703: 3 - String language (always java) - required to be set
12704: 4 - String external name (also passed directly to create alias node - ignore
12705: 5 - Short parameter style (always java) - required to be set
12706: 6 - Short - SQL allowed.
12707: 7 - Boolean - CALLED ON NULL INPUT
12708: 8 - TypeDescriptor - return type
12709: */
12710: final public QueryTreeNode functionDefinition()
12711: throws ParseException, StandardException {
12712: TableName functionName;
12713: Object[] functionElements = new Object[9];
12714: jj_consume_token(FUNCTION);
12715: functionName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
12716: functionElements[0] = functionParameterList();
12717: jj_consume_token(RETURNS);
12718: functionElements[8] = dataTypeCommon();
12719: label_36: while (true) {
12720: routineElement(false, functionElements);
12721: switch (jj_nt.kind) {
12722: case EXTERNAL:
12723: case NO:
12724: case CALLED:
12725: case CONTAINS:
12726: case DYNAMIC:
12727: case LANGUAGE:
12728: case MODIFIES:
12729: case RETURNS:
12730: case PARAMETER:
12731: case READS:
12732: case RESULT:
12733: case SPECIFIC:
12734: ;
12735: break;
12736: default:
12737: jj_la1[218] = jj_gen;
12738: break label_36;
12739: }
12740: }
12741: checkRequiredRoutineClause(JAVA_ROUTINE_CLAUSES,
12742: functionElements);
12743:
12744: {
12745: if (true)
12746: return getCreateAliasNode(functionName,
12747: (String) functionElements[4], functionElements,
12748: AliasInfo.ALIAS_TYPE_FUNCTION_AS_CHAR,
12749: Boolean.FALSE);
12750: }
12751: throw new Error("Missing return statement in function");
12752: }
12753:
12754: final public Object[] functionParameterList()
12755: throws ParseException, StandardException {
12756: Vector[] list = new Vector[3];
12757: list[0] = new Vector(); // name
12758: list[1] = new Vector(); // type
12759: list[2] = new Vector();
12760: jj_consume_token(LEFT_PAREN);
12761: switch (jj_nt.kind) {
12762: case BINARY:
12763: case COALESCE:
12764: case COUNT:
12765: case D:
12766: case MODULE:
12767: case T:
12768: case TS:
12769: case VALUE:
12770: case VARBINARY:
12771: case ABS:
12772: case ABSVAL:
12773: case ACTION:
12774: case ALWAYS:
12775: case BLOB:
12776: case C:
12777: case CALLED:
12778: case CLOB:
12779: case COBOL:
12780: case COMMITTED:
12781: case CONCAT:
12782: case CONTAINS:
12783: case DATA:
12784: case DATE:
12785: case DAY:
12786: case DYNAMIC:
12787: case FORTRAN:
12788: case GENERATED:
12789: case IDENTITY_VAL_LOCAL:
12790: case INCREMENT:
12791: case INITIAL:
12792: case INTERVAL:
12793: case LANGUAGE:
12794: case LARGE:
12795: case LENGTH:
12796: case LEVEL:
12797: case LOCKS:
12798: case LOCKSIZE:
12799: case LOGGED:
12800: case MOD:
12801: case MODIFIES:
12802: case MODIFY:
12803: case MONTH:
12804: case _MORE:
12805: case MUMPS:
12806: case NAME:
12807: case NCLOB:
12808: case NULLABLE:
12809: case NUMBER:
12810: case OBJECT:
12811: case PASCAL:
12812: case PLI:
12813: case PRECISION:
12814: case RELEASE:
12815: case REPEATABLE:
12816: case RESTART:
12817: case RETURNS:
12818: case ROW:
12819: case SAVEPOINT:
12820: case SCALE:
12821: case SERIALIZABLE:
12822: case SQL_TSI_FRAC_SECOND:
12823: case SQL_TSI_SECOND:
12824: case SQL_TSI_MINUTE:
12825: case SQL_TSI_HOUR:
12826: case SQL_TSI_DAY:
12827: case SQL_TSI_WEEK:
12828: case SQL_TSI_MONTH:
12829: case SQL_TSI_QUARTER:
12830: case SQL_TSI_YEAR:
12831: case START:
12832: case STATEMENT:
12833: case SYNONYM:
12834: case THEN:
12835: case TIME:
12836: case TIMESTAMP:
12837: case TIMESTAMPADD:
12838: case TIMESTAMPDIFF:
12839: case TRUNCATE:
12840: case TYPE:
12841: case UNCOMMITTED:
12842: case USAGE:
12843: case WHEN:
12844: case CURDATE:
12845: case CURTIME:
12846: case DATABASE:
12847: case LONG:
12848: case AFTER:
12849: case BEFORE:
12850: case CLASS:
12851: case COMPRESS:
12852: case CONTENT:
12853: case CS:
12854: case DB2SQL:
12855: case DIRTY:
12856: case DOCUMENT:
12857: case EACH:
12858: case EMPTY:
12859: case EXCLUSIVE:
12860: case FN:
12861: case INDEX:
12862: case JAVA:
12863: case LCASE:
12864: case LOCATE:
12865: case LOCK:
12866: case MESSAGE_LOCALE:
12867: case METHOD:
12868: case MODE:
12869: case NEW:
12870: case NEW_TABLE:
12871: case OJ:
12872: case OFF:
12873: case OLD:
12874: case OLD_TABLE:
12875: case PARAMETER:
12876: case PASSING:
12877: case PROPERTIES:
12878: case READS:
12879: case REF:
12880: case REFERENCING:
12881: case RENAME:
12882: case RESET:
12883: case RESULT:
12884: case RETAIN:
12885: case RETURNING:
12886: case RR:
12887: case RS:
12888: case SEQUENCE:
12889: case SEQUENTIAL:
12890: case SETS:
12891: case SHARE:
12892: case SQLID:
12893: case SPECIFIC:
12894: case SQRT:
12895: case STABILITY:
12896: case STRIP:
12897: case STYLE:
12898: case TRIGGER:
12899: case UCASE:
12900: case UR:
12901: case WHITESPACE:
12902: case IDENTIFIER:
12903: case DELIMITED_IDENTIFIER:
12904: functionParameterDefinition(list);
12905: label_37: while (true) {
12906: switch (jj_nt.kind) {
12907: case COMMA:
12908: ;
12909: break;
12910: default:
12911: jj_la1[219] = jj_gen;
12912: break label_37;
12913: }
12914: jj_consume_token(COMMA);
12915: functionParameterDefinition(list);
12916: }
12917: break;
12918: default:
12919: jj_la1[220] = jj_gen;
12920: ;
12921: }
12922: jj_consume_token(RIGHT_PAREN);
12923: {
12924: if (true)
12925: return list;
12926: }
12927: throw new Error("Missing return statement in function");
12928: }
12929:
12930: /*
12931: * <A NAME="Definition">functionParameterDefinition</A>
12932: */
12933: final public void functionParameterDefinition(Vector[] list)
12934: throws ParseException, StandardException {
12935: DataTypeDescriptor typeDescriptor;
12936: String parameterName;
12937: Integer inout;
12938: parameterName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
12939: typeDescriptor = dataTypeDDL();
12940: list[0].addElement(parameterName);
12941: list[1].addElement(typeDescriptor);
12942: list[2].addElement(ReuseFactory
12943: .getInteger(JDBC30Translation.PARAMETER_MODE_IN));
12944: }
12945:
12946: final public QueryTreeNode viewDefinition(Token beginToken)
12947: throws ParseException, StandardException {
12948: int checkOptionType;
12949: ResultColumnList resultColumns = null;
12950: ResultSetNode queryExpression;
12951: TableName tableName;
12952: Token checkTok = null;
12953: Token endToken;
12954: jj_consume_token(VIEW);
12955: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
12956: switch (jj_nt.kind) {
12957: case LEFT_PAREN:
12958: jj_consume_token(LEFT_PAREN);
12959: resultColumns = viewColumnList();
12960: jj_consume_token(RIGHT_PAREN);
12961: break;
12962: default:
12963: jj_la1[221] = jj_gen;
12964: ;
12965: }
12966: jj_consume_token(AS);
12967: queryExpression = queryExpression(null, NO_SET_OP);
12968: checkOptionType = ViewDescriptor.NO_CHECK_OPTION;
12969: endToken = getToken(0);
12970: /* Parameters not allowed in create view */
12971: HasNodeVisitor visitor = new HasNodeVisitor(ParameterNode.class);
12972: queryExpression.accept(visitor);
12973: if (visitor.hasNode()) {
12974: {
12975: if (true)
12976: throw StandardException
12977: .newException(SQLState.LANG_NO_PARAMS_IN_VIEWS);
12978: }
12979: }
12980:
12981: {
12982: if (true)
12983: return (QueryTreeNode) nodeFactory.getNode(
12984: C_NodeTypes.CREATE_VIEW_NODE, tableName,
12985: resultColumns, queryExpression, ReuseFactory
12986: .getInteger(checkOptionType),
12987: StringUtil.slice(statementSQLText,
12988: beginToken.beginOffset,
12989: endToken.endOffset, false),
12990: getContextManager());
12991: }
12992: throw new Error("Missing return statement in function");
12993: }
12994:
12995: final public ResultColumnList viewColumnList()
12996: throws ParseException, StandardException {
12997: ResultColumnList resultColumns = (ResultColumnList) nodeFactory
12998: .getNode(C_NodeTypes.RESULT_COLUMN_LIST,
12999: getContextManager());
13000: columnNameList(resultColumns);
13001: {
13002: if (true)
13003: return resultColumns;
13004: }
13005: throw new Error("Missing return statement in function");
13006: }
13007:
13008: final public QueryTreeNode triggerDefinition()
13009: throws ParseException, StandardException {
13010: Boolean isBefore;
13011: Boolean isRow;
13012: TableName tableName;
13013: TableName triggerName;
13014: Token[] tokenHolder = new Token[1];
13015: Token beginToken;
13016: Token checkTok = null;
13017: Token endToken;
13018: int actionBegin;
13019: int actionEnd;
13020: int triggerEvent;
13021: QueryTreeNode actionNode;
13022: ResultColumnList triggerColumns = (ResultColumnList) nodeFactory
13023: .getNode(C_NodeTypes.RESULT_COLUMN_LIST,
13024: getContextManager());
13025: Vector refClause = null;
13026: jj_consume_token(TRIGGER);
13027: triggerName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
13028: isBefore = beforeOrAfter();
13029: triggerEvent = triggerEvent(triggerColumns);
13030: jj_consume_token(ON);
13031: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
13032: switch (jj_nt.kind) {
13033: case REFERENCING:
13034: refClause = triggerReferencingClause();
13035: break;
13036: default:
13037: jj_la1[222] = jj_gen;
13038: ;
13039: }
13040: jj_consume_token(FOR);
13041: jj_consume_token(EACH);
13042: isRow = rowOrStatement();
13043: jj_consume_token(MODE);
13044: jj_consume_token(DB2SQL);
13045: //we are not top level statement
13046: actionNode = proceduralStatement(tokenHolder);
13047: actionEnd = getToken(0).endOffset;
13048: actionBegin = tokenHolder[0].beginOffset;
13049:
13050: // No DML in action node for BEFORE triggers.
13051: if (isBefore.booleanValue()
13052: && (actionNode instanceof DMLModStatementNode)) {
13053: {
13054: if (true)
13055: throw StandardException.newException(
13056: SQLState.LANG_UNSUPPORTED_TRIGGER_STMT,
13057: ((StatementNode) actionNode)
13058: .statementToString(), "BEFORE");
13059: }
13060: }
13061:
13062: // no params in trigger action
13063: HasNodeVisitor visitor = new HasNodeVisitor(ParameterNode.class);
13064: actionNode.accept(visitor);
13065: if (visitor.hasNode()) {
13066: {
13067: if (true)
13068: throw StandardException
13069: .newException(SQLState.LANG_NO_PARAMS_IN_TRIGGER_ACTION);
13070: }
13071: }
13072:
13073: {
13074: if (true)
13075: return (QueryTreeNode) nodeFactory.getNode(
13076: C_NodeTypes.CREATE_TRIGGER_NODE,
13077: triggerName,
13078: tableName,
13079: ReuseFactory.getInteger(triggerEvent),
13080: triggerColumns,
13081: isBefore,
13082: isRow,
13083: Boolean.TRUE, // enabled
13084: refClause, // referencing clause
13085: null,// when clause node
13086: null, // when clause text
13087: ReuseFactory.getInteger(0),
13088: // when clause begin offset
13089: actionNode, StringUtil.slice(statementSQLText,
13090: actionBegin, actionEnd, false),
13091: ReuseFactory.getInteger(actionBegin),
13092: getContextManager());
13093: }
13094: throw new Error("Missing return statement in function");
13095: }
13096:
13097: final public QueryTreeNode synonymDefinition()
13098: throws ParseException, StandardException {
13099: TableName synonymName;
13100: TableName targetName;
13101: jj_consume_token(SYNONYM);
13102: synonymName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
13103: jj_consume_token(FOR);
13104: targetName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
13105: checkVersion(DataDictionary.DD_VERSION_DERBY_10_1,
13106: "CREATE SYNONYM");
13107:
13108: {
13109: if (true)
13110: return (StatementNode) getNodeFactory()
13111: .getCreateAliasNode(synonymName, targetName,
13112: null,
13113: AliasInfo.ALIAS_TYPE_SYNONYM_AS_CHAR,
13114: Boolean.FALSE, getContextManager());
13115: }
13116: throw new Error("Missing return statement in function");
13117: }
13118:
13119: final public Boolean beforeOrAfter() throws ParseException {
13120: switch (jj_nt.kind) {
13121: case NO:
13122: jj_consume_token(NO);
13123: jj_consume_token(CASCADE);
13124: jj_consume_token(BEFORE);
13125: {
13126: if (true)
13127: return Boolean.TRUE;
13128: }
13129: break;
13130: case AFTER:
13131: jj_consume_token(AFTER);
13132: {
13133: if (true)
13134: return Boolean.FALSE;
13135: }
13136: break;
13137: default:
13138: jj_la1[223] = jj_gen;
13139: jj_consume_token(-1);
13140: throw new ParseException();
13141: }
13142: throw new Error("Missing return statement in function");
13143: }
13144:
13145: final public int triggerEvent(ResultColumnList rcl)
13146: throws ParseException, StandardException {
13147: switch (jj_nt.kind) {
13148: case INSERT:
13149: jj_consume_token(INSERT);
13150: {
13151: if (true)
13152: return TriggerDescriptor.TRIGGER_EVENT_INSERT;
13153: }
13154: break;
13155: case DELETE:
13156: jj_consume_token(DELETE);
13157: {
13158: if (true)
13159: return TriggerDescriptor.TRIGGER_EVENT_DELETE;
13160: }
13161: break;
13162: case UPDATE:
13163: jj_consume_token(UPDATE);
13164: switch (jj_nt.kind) {
13165: case OF:
13166: jj_consume_token(OF);
13167: columnNameList(rcl);
13168: break;
13169: default:
13170: jj_la1[224] = jj_gen;
13171: ;
13172: }
13173: {
13174: if (true)
13175: return TriggerDescriptor.TRIGGER_EVENT_UPDATE;
13176: }
13177: break;
13178: default:
13179: jj_la1[225] = jj_gen;
13180: jj_consume_token(-1);
13181: throw new ParseException();
13182: }
13183: throw new Error("Missing return statement in function");
13184: }
13185:
13186: final public Boolean rowOrStatement() throws ParseException {
13187: switch (jj_nt.kind) {
13188: case ROW:
13189: token = jj_consume_token(ROW);
13190: {
13191: if (true)
13192: return Boolean.TRUE;
13193: }
13194: break;
13195: case STATEMENT:
13196: token = jj_consume_token(STATEMENT);
13197: {
13198: if (true)
13199: return Boolean.FALSE;
13200: }
13201: break;
13202: default:
13203: jj_la1[226] = jj_gen;
13204: jj_consume_token(-1);
13205: throw new ParseException();
13206: }
13207: throw new Error("Missing return statement in function");
13208: }
13209:
13210: final public Vector triggerReferencingClause()
13211: throws ParseException, StandardException {
13212: Vector vector = new Vector();
13213: jj_consume_token(REFERENCING);
13214: triggerReferencingExpression(vector);
13215: label_38: while (true) {
13216: switch (jj_nt.kind) {
13217: case NEW:
13218: case NEW_TABLE:
13219: case OLD:
13220: case OLD_TABLE:
13221: ;
13222: break;
13223: default:
13224: jj_la1[227] = jj_gen;
13225: break label_38;
13226: }
13227: triggerReferencingExpression(vector);
13228: }
13229: {
13230: if (true)
13231: return vector;
13232: }
13233: throw new Error("Missing return statement in function");
13234: }
13235:
13236: final public void triggerReferencingExpression(Vector vector)
13237: throws ParseException, StandardException {
13238: String identifier;
13239: boolean isNew = true;
13240: boolean isRow = true;
13241: switch (jj_nt.kind) {
13242: case NEW:
13243: jj_consume_token(NEW);
13244: break;
13245: case OLD:
13246: jj_consume_token(OLD);
13247: isNew = false;
13248: break;
13249: case NEW_TABLE:
13250: jj_consume_token(NEW_TABLE);
13251: isRow = false;
13252: break;
13253: case OLD_TABLE:
13254: jj_consume_token(OLD_TABLE);
13255: isNew = false;
13256: isRow = false;
13257: break;
13258: default:
13259: jj_la1[228] = jj_gen;
13260: jj_consume_token(-1);
13261: throw new ParseException();
13262: }
13263: jj_consume_token(AS);
13264: identifier = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
13265: vector.addElement(new TriggerReferencingStruct(isRow, isNew,
13266: identifier));
13267: }
13268:
13269: /*
13270: * <A NAME="defaultClause">defaultClause</A>
13271: */
13272: final public ValueNode defaultClause(long[] autoIncrementInfo,
13273: String columnName) throws ParseException, StandardException {
13274: ValueNode value;
13275: Token beginToken;
13276: Token endToken;
13277: switch (jj_nt.kind) {
13278: case _DEFAULT:
13279: case WITH:
13280: switch (jj_nt.kind) {
13281: case WITH:
13282: jj_consume_token(WITH);
13283: break;
13284: default:
13285: jj_la1[229] = jj_gen;
13286: ;
13287: }
13288: beginToken = jj_consume_token(_DEFAULT);
13289: value = defaultOption(beginToken, autoIncrementInfo,
13290: columnName);
13291: {
13292: if (true)
13293: return value;
13294: }
13295: break;
13296: case GENERATED:
13297: value = generatedColumnOption(autoIncrementInfo);
13298: {
13299: if (true)
13300: return value;
13301: }
13302: break;
13303: default:
13304: jj_la1[230] = jj_gen;
13305: jj_consume_token(-1);
13306: throw new ParseException();
13307: }
13308: throw new Error("Missing return statement in function");
13309: }
13310:
13311: /*
13312: * <A NAME="defaultNullOnlyClause">defaultNullOnlyClause</A>
13313: */
13314: final public ValueNode defaultNullOnlyClause()
13315: throws ParseException, StandardException {
13316: jj_consume_token(_DEFAULT);
13317: jj_consume_token(NULL);
13318: {
13319: if (true)
13320: return (ValueNode) nodeFactory.getNode(
13321: C_NodeTypes.UNTYPED_NULL_CONSTANT_NODE,
13322: getContextManager());
13323: }
13324: throw new Error("Missing return statement in function");
13325: }
13326:
13327: /*
13328: * <A NAME="generatedColumnOption">generatedColumnOption</A>
13329: */
13330:
13331: //ToCleanUp
13332: //A specific class not such long[] should exists for autoIncrementInfo ...
13333: final public ValueNode generatedColumnOption(
13334: long[] autoIncrementInfo) throws ParseException,
13335: StandardException {
13336: ValueNode value = null;
13337: autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_START_INDEX] = 1;
13338: autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_INC_INDEX] = 1;
13339: autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_IS_AUTOINCREMENT_INDEX] = 1;
13340: autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_CREATE_MODIFY] = ColumnDefinitionNode.CREATE_AUTOINCREMENT;
13341: jj_consume_token(GENERATED);
13342: switch (jj_nt.kind) {
13343: case ALWAYS:
13344: jj_consume_token(ALWAYS);
13345: value = null;
13346: break;
13347: case BY:
13348: jj_consume_token(BY);
13349: jj_consume_token(_DEFAULT);
13350: checkVersion(DataDictionary.DD_VERSION_DERBY_10_1,
13351: "GENERATED BY DEFAULT");
13352:
13353: value = (ValueNode) nodeFactory.getNode(
13354: C_NodeTypes.DEFAULT_NODE, getContextManager());
13355: break;
13356: default:
13357: jj_la1[231] = jj_gen;
13358: jj_consume_token(-1);
13359: throw new ParseException();
13360: }
13361: jj_consume_token(AS);
13362: jj_consume_token(IDENTITY);
13363: switch (jj_nt.kind) {
13364: case LEFT_PAREN:
13365: jj_consume_token(LEFT_PAREN);
13366: autoIncrementBeginEnd(autoIncrementInfo);
13367: jj_consume_token(RIGHT_PAREN);
13368: break;
13369: default:
13370: jj_la1[232] = jj_gen;
13371: ;
13372: }
13373: {
13374: if (true)
13375: return value;
13376: }
13377: throw new Error("Missing return statement in function");
13378: }
13379:
13380: /*
13381: * <A NAME="autoIncrementBeginEnd">autoIncrementBeginEnd</A>
13382: */
13383: final public void autoIncrementBeginEnd(long[] autoIncrementInfo)
13384: throws ParseException, StandardException {
13385: long autoIncrementInitial = 1;
13386: long autoIncrementIncrement = 1;
13387: switch (jj_nt.kind) {
13388: case INCREMENT:
13389: jj_consume_token(INCREMENT);
13390: jj_consume_token(BY);
13391: autoIncrementIncrement = exactNumber();
13392: autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_INC_INDEX] = autoIncrementIncrement;
13393: autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_CREATE_MODIFY] = ColumnDefinitionNode.CREATE_AUTOINCREMENT;
13394: {
13395: if (true)
13396: return;
13397: }
13398: break;
13399: case START:
13400: jj_consume_token(START);
13401: jj_consume_token(WITH);
13402: autoIncrementInitial = exactNumber();
13403: switch (jj_nt.kind) {
13404: case COMMA:
13405: jj_consume_token(COMMA);
13406: jj_consume_token(INCREMENT);
13407: jj_consume_token(BY);
13408: autoIncrementIncrement = exactNumber();
13409: break;
13410: default:
13411: jj_la1[233] = jj_gen;
13412: ;
13413: }
13414: autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_START_INDEX] = autoIncrementInitial;
13415: autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_INC_INDEX] = autoIncrementIncrement;
13416: autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_CREATE_MODIFY] = ColumnDefinitionNode.CREATE_AUTOINCREMENT;
13417: {
13418: if (true)
13419: return;
13420: }
13421: break;
13422: default:
13423: jj_la1[234] = jj_gen;
13424: jj_consume_token(-1);
13425: throw new ParseException();
13426: }
13427: }
13428:
13429: /*
13430: * <A NAME="defaultOption">defaultOption</A>
13431: */
13432: final public ValueNode defaultOption(Token beginToken,
13433: long[] autoIncrementInfo, String columnName)
13434: throws ParseException, StandardException {
13435: Token endToken;
13436: Token errorTok = null;
13437: Token initialTok = null;
13438: ValueNode value;
13439: if (getToken(1).kind == NULL
13440: && !(getToken(2).kind == PERIOD || getToken(2).kind == DOUBLE_COLON)) {
13441: jj_consume_token(NULL);
13442: {
13443: if (true)
13444: return (ValueNode) nodeFactory.getNode(
13445: C_NodeTypes.UNTYPED_NULL_CONSTANT_NODE,
13446: getContextManager());
13447: }
13448: } else if (jj_2_42(1)) {
13449: value = DB2DefaultOption(columnName);
13450: endToken = getToken(0);
13451: value.setBeginOffset(beginToken.beginOffset);
13452: value.setEndOffset(endToken.endOffset);
13453: value = (ValueNode) nodeFactory.getNode(
13454: C_NodeTypes.DEFAULT_NODE, value, StringUtil.slice(
13455: statementSQLText,
13456: beginToken.beginOffset + 7,
13457: endToken.endOffset, true),
13458: getContextManager());
13459: {
13460: if (true)
13461: return value;
13462: }
13463: } else {
13464: jj_consume_token(-1);
13465: throw new ParseException();
13466: }
13467: throw new Error("Missing return statement in function");
13468: }
13469:
13470: /*
13471: * <A NAME="DB2DefaultOption">DB2DefaultOption</A>
13472: */
13473: final public ValueNode DB2DefaultOption(String columnName)
13474: throws ParseException, StandardException {
13475: ValueNode value;
13476: if (getToken(2).kind == SCHEMA || getToken(2).kind == SQLID) {
13477: jj_consume_token(CURRENT);
13478: switch (jj_nt.kind) {
13479: case SCHEMA:
13480: jj_consume_token(SCHEMA);
13481: break;
13482: case SQLID:
13483: jj_consume_token(SQLID);
13484: break;
13485: default:
13486: jj_la1[235] = jj_gen;
13487: jj_consume_token(-1);
13488: throw new ParseException();
13489: }
13490: {
13491: if (true)
13492: return (ValueNode) nodeFactory.getNode(
13493: C_NodeTypes.CURRENT_SCHEMA_NODE,
13494: getContextManager());
13495: }
13496: } else {
13497: switch (jj_nt.kind) {
13498: case USER:
13499: jj_consume_token(USER);
13500: {
13501: if (true)
13502: return (ValueNode) nodeFactory.getNode(
13503: C_NodeTypes.USER_NODE,
13504: getContextManager());
13505: }
13506: break;
13507: default:
13508: jj_la1[236] = jj_gen;
13509: if (getToken(1).kind == DATE
13510: || getToken(1).kind == TIME
13511: || getToken(1).kind == TIMESTAMP) {
13512: value = miscBuiltins();
13513: // these functions are allowed as valid <cast-function> defaults.
13514: // Once "BLOB" is allowed as a cast-function (5281), a case should be
13515: // added for that, as well.
13516: {
13517: if (true)
13518: return value;
13519: }
13520: } else if (getToken(2).kind == LEFT_PAREN
13521: || (getToken(4).kind == LEFT_PAREN && getToken(2).kind != COMMA)) {
13522: // Check against comma: see Derby-331
13523: // Before adding this, the following was erroneously
13524: // flagged as invalid:
13525: // create table foo(.., b int default 0, unique (a))
13526: value = miscBuiltins();
13527: // If we have a function (as indicated by an open paren,
13528: // which can be either the 2nd token (w/ normal function name)
13529: // or the 4th token (w/ qualified function name)), then
13530: // it's not valid. Catch it here and throw an "invalid
13531: // default" error (42894) instead of letting it go as
13532: // a syntax error (this matches DB2 UDB behavior).
13533: {
13534: if (true)
13535: throw StandardException
13536: .newException(
13537: SQLState.LANG_DB2_INVALID_DEFAULT_VALUE,
13538: columnName);
13539: }
13540: } else if (jj_2_43(1)) {
13541: value = datetimeValueFunction();
13542: {
13543: if (true)
13544: return value;
13545: }
13546: } else {
13547: switch (jj_nt.kind) {
13548: case FALSE:
13549: case TRUE:
13550: case LEFT_BRACE:
13551: case PLUS_SIGN:
13552: case MINUS_SIGN:
13553: case EXACT_NUMERIC:
13554: case STRING:
13555: case HEX_STRING:
13556: case APPROXIMATE_NUMERIC:
13557: // Only (valid) thing left is literals (i.e. actual constants).
13558: value = literal();
13559: {
13560: if (true)
13561: return value;
13562: }
13563: break;
13564: default:
13565: jj_la1[237] = jj_gen;
13566: jj_consume_token(-1);
13567: throw new ParseException();
13568: }
13569: }
13570: }
13571: }
13572: throw new Error("Missing return statement in function");
13573: }
13574:
13575: /*
13576: * <A NAME="literal">literal</A>
13577: */
13578: final public ValueNode literal() throws ParseException,
13579: StandardException {
13580: String sign = "";
13581: Token tok;
13582: String datetimeString;
13583: String bitString;
13584: ValueNode constantNode;
13585: switch (jj_nt.kind) {
13586: case PLUS_SIGN:
13587: case MINUS_SIGN:
13588: case EXACT_NUMERIC:
13589: case APPROXIMATE_NUMERIC:
13590: switch (jj_nt.kind) {
13591: case PLUS_SIGN:
13592: case MINUS_SIGN:
13593: sign = sign();
13594: break;
13595: default:
13596: jj_la1[238] = jj_gen;
13597: ;
13598: }
13599: constantNode = numericLiteral(sign);
13600: {
13601: if (true)
13602: return constantNode;
13603: }
13604: break;
13605: case STRING:
13606: constantNode = stringLiteral();
13607: {
13608: if (true)
13609: return constantNode;
13610: }
13611: break;
13612: case HEX_STRING:
13613: constantNode = hexLiteral();
13614: {
13615: if (true)
13616: return constantNode;
13617: }
13618: break;
13619: case LEFT_BRACE:
13620: constantNode = dateTimeLiteral();
13621: {
13622: if (true)
13623: return constantNode;
13624: }
13625: break;
13626: case FALSE:
13627: case TRUE:
13628: tok = booleanLiteral();
13629: checkInternalFeature(tok.image);
13630: {
13631: if (true)
13632: return (ValueNode) nodeFactory.getNode(
13633: C_NodeTypes.BOOLEAN_CONSTANT_NODE,
13634: StringUtil.SQLEqualsIgnoreCase(tok.image,
13635: "true") ? Boolean.TRUE
13636: : Boolean.FALSE,
13637: getContextManager());
13638: }
13639: break;
13640: default:
13641: jj_la1[239] = jj_gen;
13642: jj_consume_token(-1);
13643: throw new ParseException();
13644: }
13645: throw new Error("Missing return statement in function");
13646: }
13647:
13648: /*
13649: * <A NAME="numericLiteral">numericLiteral</A>
13650: */
13651: final public ValueNode numericLiteral(String sign)
13652: throws ParseException, StandardException {
13653: Token tok;
13654: switch (jj_nt.kind) {
13655: case EXACT_NUMERIC:
13656: tok = jj_consume_token(EXACT_NUMERIC);
13657: /*
13658: ** The various java parse utilities can't handle leading +,
13659: ** so only concatenate leading -.
13660: */
13661:
13662: String num = tok.image;
13663:
13664: if (sign.equals("-"))
13665: num = sign.concat(num);
13666:
13667: {
13668: if (true)
13669: return getNumericNode(num);
13670: }
13671: break;
13672: case APPROXIMATE_NUMERIC:
13673: tok = jj_consume_token(APPROXIMATE_NUMERIC);
13674: StringBuffer doubleImage;
13675: String doubleString;
13676: int ePosn,
13677: dotPosn; // Position of letter e and '.' in value
13678: Double doubleValue;
13679:
13680: doubleImage = new StringBuffer(sign);
13681: doubleImage.append(tok.image);
13682: doubleString = doubleImage.toString();
13683:
13684: ePosn = doubleString.indexOf('E');
13685: if (ePosn == -1)
13686: ePosn = doubleString.indexOf('e');
13687: if (SanityManager.DEBUG)
13688: SanityManager.ASSERT(ePosn != -1,
13689: "no E or e in approximate numeric");
13690:
13691: // there is a limit on the length of a floatingpoint literal in DB2
13692: if (doubleString.length() > Limits.DB2_MAX_FLOATINGPOINT_LITERAL_LENGTH) {
13693: if (true)
13694: throw StandardException
13695: .newException(
13696: SQLState.LANG_DB2_TOO_LONG_FLOATING_POINT_LITERAL,
13697: doubleString, TypeId.DOUBLE_NAME);
13698: }
13699: // if there is no '.' before the e, put one in
13700: dotPosn = doubleString.substring(0, ePosn).indexOf('.');
13701: if (dotPosn == -1) {
13702: doubleImage.insert(ePosn, '.');
13703: doubleString = doubleImage.toString();
13704: ePosn++;
13705: }
13706:
13707: try {
13708: doubleValue = Double.valueOf(doubleString);
13709:
13710: } catch (NumberFormatException nfe) {
13711: {
13712: if (true)
13713: throw StandardException.newException(
13714: SQLState.LANG_FORMAT_EXCEPTION,
13715: TypeId.DOUBLE_NAME);
13716: }
13717: }
13718:
13719: double dv = doubleValue.doubleValue();
13720:
13721: // When the value is 0 it's possible rounded, try to detect it by checking if the mantissa is 0.0
13722: // "proof of correctness": any nonzero value (mantissa) with less than 30 characters will not be
13723: // rounded to 0.0 by a float/real. This correctly detects the case when
13724: // the radix/exponent being "too small" (1e-900) giving a value rounded to zero.
13725: if ((dv == 0.0d)
13726: && (Double.parseDouble(doubleString.substring(0,
13727: ePosn - 1)) != 0.0d)) {
13728: {
13729: if (true)
13730: throw StandardException
13731: .newException(
13732: SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE,
13733: TypeId.DOUBLE_NAME);
13734: }
13735: }
13736:
13737: if (Double.isNaN(dv) || Double.isInfinite(dv)) {
13738: if (true)
13739: throw StandardException.newException(
13740: SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE,
13741: TypeId.DOUBLE_NAME);
13742: }
13743:
13744: {
13745: if (true)
13746: return (ValueNode) nodeFactory.getNode(
13747: C_NodeTypes.DOUBLE_CONSTANT_NODE,
13748: doubleValue, getContextManager());
13749: }
13750: break;
13751: default:
13752: jj_la1[240] = jj_gen;
13753: jj_consume_token(-1);
13754: throw new ParseException();
13755: }
13756: throw new Error("Missing return statement in function");
13757: }
13758:
13759: /*
13760: * <A NAME="dateTimeLiteral">dateTimeLiteral</A>
13761: */
13762: final public ValueNode dateTimeLiteral() throws ParseException,
13763: StandardException {
13764: ValueNode constantNode;
13765: jj_consume_token(LEFT_BRACE);
13766: constantNode = escapedDateTimeLiteral();
13767: jj_consume_token(RIGHT_BRACE);
13768: {
13769: if (true)
13770: return constantNode;
13771: }
13772: throw new Error("Missing return statement in function");
13773: }
13774:
13775: /*
13776: * <A NAME="escapedDateTimeLiteral">escapedDateTimeLiteral</A>
13777: */
13778: final public ValueNode escapedDateTimeLiteral()
13779: throws ParseException, StandardException {
13780: ValueNode constantNode;
13781: switch (jj_nt.kind) {
13782: case D:
13783: jj_consume_token(D);
13784: constantNode = bareDateLiteral();
13785: {
13786: if (true)
13787: return constantNode;
13788: }
13789: break;
13790: case T:
13791: jj_consume_token(T);
13792: constantNode = bareTimeLiteral();
13793: {
13794: if (true)
13795: return constantNode;
13796: }
13797: break;
13798: case TS:
13799: jj_consume_token(TS);
13800: constantNode = bareTimestampLiteral();
13801: {
13802: if (true)
13803: return constantNode;
13804: }
13805: break;
13806: default:
13807: jj_la1[241] = jj_gen;
13808: jj_consume_token(-1);
13809: throw new ParseException();
13810: }
13811: throw new Error("Missing return statement in function");
13812: }
13813:
13814: /*
13815: * <A NAME="bareDateLiteral">bareDateLiteral</A>
13816: */
13817: final public ValueNode bareDateLiteral() throws ParseException,
13818: StandardException {
13819: String dateString;
13820: dateString = string();
13821: {
13822: if (true)
13823: return (ValueNode) nodeFactory.getNode(
13824: C_NodeTypes.USERTYPE_CONSTANT_NODE,
13825: getLanguageConnectionContext()
13826: .getDataValueFactory().getDateValue(
13827: dateString, true),
13828: getContextManager());
13829: }
13830: throw new Error("Missing return statement in function");
13831: }
13832:
13833: /*
13834: * <A NAME="bareTimeLiteral">bareTimeLiteral</A>
13835: */
13836: final public ValueNode bareTimeLiteral() throws ParseException,
13837: StandardException {
13838: String timeString;
13839: timeString = string();
13840: {
13841: if (true)
13842: return (ValueNode) nodeFactory.getNode(
13843: C_NodeTypes.USERTYPE_CONSTANT_NODE,
13844: getLanguageConnectionContext()
13845: .getDataValueFactory().getTimeValue(
13846: timeString, true),
13847: getContextManager());
13848: }
13849: throw new Error("Missing return statement in function");
13850: }
13851:
13852: /*
13853: * <A NAME="bareTimestampLiteral">bareTimestampLiteral</A>
13854: */
13855: final public ValueNode bareTimestampLiteral()
13856: throws ParseException, StandardException {
13857: String timestampString;
13858: timestampString = string();
13859: {
13860: if (true)
13861: return (ValueNode) nodeFactory.getNode(
13862: C_NodeTypes.USERTYPE_CONSTANT_NODE,
13863: getLanguageConnectionContext()
13864: .getDataValueFactory()
13865: .getTimestampValue(timestampString,
13866: true), getContextManager());
13867: }
13868: throw new Error("Missing return statement in function");
13869: }
13870:
13871: /*
13872: * <A NAME="string">string</A>
13873: */
13874: final public String string() throws ParseException,
13875: StandardException {
13876: Token tok;
13877: tok = jj_consume_token(STRING);
13878: verifyImageLength(tok.image);
13879: /* Trim off the leading and trailing ', and compress all '' to ' */
13880: {
13881: if (true)
13882: return compressQuotes(tok.image.substring(1, tok.image
13883: .length() - 1), SINGLEQUOTES);
13884: }
13885: throw new Error("Missing return statement in function");
13886: }
13887:
13888: /*
13889: * <A NAME="stringLiteral">stringLiteral</A>
13890: */
13891: final public CharConstantNode stringLiteral()
13892: throws ParseException, StandardException {
13893: Token tok;
13894: String string;
13895: tok = jj_consume_token(STRING);
13896: //there is a maximum limit on the length of the string
13897: if (tok.image.length() - 2 > Limits.DB2_MAX_CHARACTER_LITERAL_LENGTH)//-2 is for the beginning and ending quote
13898: {
13899: if (true)
13900: throw StandardException.newException(
13901: SQLState.LANG_DB2_STRING_CONSTANT_TOO_LONG,
13902: StringUtil.formatForPrint(tok.image));
13903: }
13904: string = compressQuotes(tok.image.substring(1, tok.image
13905: .length() - 1), SINGLEQUOTES);
13906: /* Trim quotes from string. */
13907: {
13908: if (true)
13909: return (CharConstantNode) nodeFactory.getNode(
13910: C_NodeTypes.CHAR_CONSTANT_NODE, string,
13911: getContextManager());
13912: }
13913: throw new Error("Missing return statement in function");
13914: }
13915:
13916: /*
13917: * <A NAME="hexLiteral">hexLiteral</A>
13918: */
13919: final public ValueNode hexLiteral() throws ParseException,
13920: StandardException {
13921: Token tok;
13922: tok = jj_consume_token(HEX_STRING);
13923: String hexLiteral = tok.image;
13924:
13925: //there is a maximum limit on the length of the hex constant
13926: if (hexLiteral.length() - 3 > Limits.DB2_MAX_HEX_LITERAL_LENGTH)//-3 is for X' at the beginning and ' at the end
13927: {
13928: if (true)
13929: throw StandardException.newException(
13930: SQLState.LANG_DB2_STRING_CONSTANT_TOO_LONG,
13931: StringUtil.formatForPrint(hexLiteral));
13932: }
13933: if ((hexLiteral.length() - 3) % 2 == 1) {
13934: if (true)
13935: throw StandardException.newException(
13936: SQLState.LANG_DB2_INVALID_HEXADECIMAL_CONSTANT,
13937: StringUtil.formatForPrint(hexLiteral));
13938: }
13939:
13940: int bitLength = ((hexLiteral.length() - 3) / 2);
13941: {
13942: if (true)
13943: return (ValueNode) nodeFactory.getNode(
13944: C_NodeTypes.VARBIT_CONSTANT_NODE, hexLiteral
13945: .substring(2, hexLiteral.length() - 1),
13946: ReuseFactory.getInteger(bitLength),
13947: getContextManager());
13948: }
13949: throw new Error("Missing return statement in function");
13950: }
13951:
13952: final public TableName constraintNameDefinition()
13953: throws ParseException, StandardException {
13954: TableName constraintName;
13955: jj_consume_token(CONSTRAINT);
13956: constraintName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
13957: {
13958: if (true)
13959: return constraintName;
13960: }
13961: throw new Error("Missing return statement in function");
13962: }
13963:
13964: /*
13965: * DB2 requires column check constraints to refer to only that column. Cloudscape currently
13966: * doesn't care if check constraints are column level or table level. For DB2 compatibility
13967: * check that column check constraints only refer to that column.
13968: */
13969: final public ConstraintDefinitionNode checkConstraintDefinition(
13970: TableName constraintName, String columnName)
13971: throws ParseException, StandardException {
13972: Token beginToken;
13973: Token endToken;
13974: ValueNode value;
13975: ResultColumnList rclList = null;
13976: jj_consume_token(CHECK);
13977: beginToken = jj_consume_token(LEFT_PAREN);
13978: value = valueExpression(false);
13979: endToken = jj_consume_token(RIGHT_PAREN);
13980: if (columnName != null) {
13981: /* Column check constraint */
13982: rclList = (ResultColumnList) nodeFactory
13983: .getNode(C_NodeTypes.RESULT_COLUMN_LIST,
13984: getContextManager());
13985: rclList.addElement((ResultColumn) nodeFactory.getNode(
13986: C_NodeTypes.RESULT_COLUMN, columnName, null,
13987: getContextManager()));
13988: }
13989:
13990: value.setBeginOffset(beginToken.beginOffset);
13991: value.setEndOffset(endToken.endOffset);
13992: {
13993: if (true)
13994: return (ConstraintDefinitionNode) nodeFactory
13995: .getNode(
13996: C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
13997: constraintName,
13998: ReuseFactory
13999: .getInteger(DataDictionary.CHECK_CONSTRAINT),
14000: rclList, null, value, StringUtil.slice(
14001: statementSQLText,
14002: beginToken.beginOffset,
14003: endToken.endOffset, true),
14004: getContextManager());
14005: }
14006: throw new Error("Missing return statement in function");
14007: }
14008:
14009: /*
14010: * <A NAME="spsRenameStatement">spsRenameStatement</A>
14011: */
14012: final public QueryTreeNode spsRenameStatement()
14013: throws ParseException, StandardException {
14014: QueryTreeNode qtn;
14015: jj_consume_token(RENAME);
14016: switch (jj_nt.kind) {
14017: case TABLE:
14018: qtn = renameTableStatement();
14019: break;
14020: case INDEX:
14021: qtn = renameIndexStatement();
14022: break;
14023: default:
14024: jj_la1[242] = jj_gen;
14025: jj_consume_token(-1);
14026: throw new ParseException();
14027: }
14028: {
14029: if (true)
14030: return qtn;
14031: }
14032: throw new Error("Missing return statement in function");
14033: }
14034:
14035: /*
14036: * <A NAME="renameTableStatement">renameTableStatement</A>
14037: */
14038: final public QueryTreeNode renameTableStatement()
14039: throws ParseException, StandardException {
14040: QueryTreeNode qtn;
14041: TableName tableName;
14042: String newTableName;
14043: jj_consume_token(TABLE);
14044: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
14045: jj_consume_token(TO);
14046: newTableName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
14047: {
14048: if (true)
14049: return (QueryTreeNode) nodeFactory
14050: .getNode(
14051: C_NodeTypes.RENAME_NODE,
14052: tableName,
14053: null,
14054: newTableName,
14055: Boolean.FALSE,
14056: ReuseFactory
14057: .getInteger(StatementType.RENAME_TABLE),
14058: getContextManager());
14059: }
14060: throw new Error("Missing return statement in function");
14061: }
14062:
14063: /*
14064: * <A NAME="renameIndexStatement">renameIndexStatement</A>
14065: */
14066: final public QueryTreeNode renameIndexStatement()
14067: throws ParseException, StandardException {
14068: String oldIndexName;
14069: String newIndexName;
14070: jj_consume_token(INDEX);
14071: oldIndexName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
14072: jj_consume_token(TO);
14073: newIndexName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
14074: QueryTreeNode qtn = nodeFactory.getNode(
14075: C_NodeTypes.RENAME_NODE, null, oldIndexName,
14076: newIndexName, Boolean.FALSE, ReuseFactory
14077: .getInteger(StatementType.RENAME_INDEX),
14078: getContextManager());
14079:
14080: {
14081: if (true)
14082: return qtn;
14083: }
14084: throw new Error("Missing return statement in function");
14085: }
14086:
14087: final public QueryTreeNode lockStatement() throws ParseException,
14088: StandardException {
14089: Boolean exclusiveMode;
14090: TableName tableName;
14091: jj_consume_token(LOCK);
14092: jj_consume_token(TABLE);
14093: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
14094: jj_consume_token(IN);
14095: exclusiveMode = lockMode();
14096: jj_consume_token(MODE);
14097: {
14098: if (true)
14099: return nodeFactory.getNode(C_NodeTypes.LOCK_TABLE_NODE,
14100: tableName, exclusiveMode, getContextManager());
14101: }
14102: throw new Error("Missing return statement in function");
14103: }
14104:
14105: final public Boolean lockMode() throws ParseException {
14106: switch (jj_nt.kind) {
14107: case EXCLUSIVE:
14108: jj_consume_token(EXCLUSIVE);
14109: {
14110: if (true)
14111: return Boolean.TRUE;
14112: }
14113: break;
14114: case SHARE:
14115: jj_consume_token(SHARE);
14116: {
14117: if (true)
14118: return Boolean.FALSE;
14119: }
14120: break;
14121: default:
14122: jj_la1[243] = jj_gen;
14123: jj_consume_token(-1);
14124: throw new ParseException();
14125: }
14126: throw new Error("Missing return statement in function");
14127: }
14128:
14129: final public QueryTreeNode execStatement() throws ParseException,
14130: StandardException {
14131: TableName stmtName;
14132: jj_consume_token(EXECUTE);
14133: jj_consume_token(STATEMENT);
14134: stmtName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
14135: {
14136: if (true)
14137: return (QueryTreeNode) nodeFactory.getNode(
14138: C_NodeTypes.EXEC_SPS_NODE, stmtName,
14139: getContextManager());
14140: }
14141: throw new Error("Missing return statement in function");
14142: }
14143:
14144: final public TransactionStatementNode setIsolationStatement()
14145: throws ParseException, StandardException {
14146: TransactionStatementNode tranNode;
14147: setIsolationHeader();
14148: switch (jj_nt.kind) {
14149: case TO:
14150: case EQUALS_OPERATOR:
14151: switch (jj_nt.kind) {
14152: case EQUALS_OPERATOR:
14153: jj_consume_token(EQUALS_OPERATOR);
14154: break;
14155: case TO:
14156: jj_consume_token(TO);
14157: break;
14158: default:
14159: jj_la1[244] = jj_gen;
14160: jj_consume_token(-1);
14161: throw new ParseException();
14162: }
14163: break;
14164: default:
14165: jj_la1[245] = jj_gen;
14166: ;
14167: }
14168: tranNode = transactionMode();
14169: {
14170: if (true)
14171: return tranNode;
14172: }
14173: throw new Error("Missing return statement in function");
14174: }
14175:
14176: final public void setIsolationHeader() throws ParseException,
14177: StandardException {
14178: switch (jj_nt.kind) {
14179: case ISOLATION:
14180: jj_consume_token(ISOLATION);
14181: break;
14182: default:
14183: jj_la1[246] = jj_gen;
14184: if (getToken(1).kind == CURRENT
14185: && getToken(2).kind == ISOLATION) {
14186: jj_consume_token(CURRENT);
14187: jj_consume_token(ISOLATION);
14188: } else {
14189: jj_consume_token(-1);
14190: throw new ParseException();
14191: }
14192: }
14193: }
14194:
14195: final public TransactionStatementNode transactionMode()
14196: throws ParseException, StandardException {
14197: int isolationLevel;
14198: isolationLevel = isolationLevelDB2OrReset();
14199: {
14200: if (true)
14201: return (TransactionStatementNode) nodeFactory.getNode(
14202: C_NodeTypes.SET_TRANSACTION_ISOLATION_NODE,
14203: ReuseFactory.getInteger(isolationLevel),
14204: getContextManager());
14205: }
14206: throw new Error("Missing return statement in function");
14207: }
14208:
14209: final public int isolationLevelDB2OrReset() throws ParseException {
14210: int isolationLevel;
14211: switch (jj_nt.kind) {
14212: case RESET:
14213: jj_consume_token(RESET);
14214: {
14215: if (true)
14216: return ExecutionContext.UNSPECIFIED_ISOLATION_LEVEL;
14217: }
14218: break;
14219: default:
14220: jj_la1[247] = jj_gen;
14221: if (jj_2_44(1)) {
14222: isolationLevel = isolationLevelDB2();
14223: {
14224: if (true)
14225: return isolationLevel;
14226: }
14227: } else {
14228: jj_consume_token(-1);
14229: throw new ParseException();
14230: }
14231: }
14232: throw new Error("Missing return statement in function");
14233: }
14234:
14235: final public int isolationLevelDB2() throws ParseException {
14236: int isolationLevel;
14237: switch (jj_nt.kind) {
14238: case CS:
14239: case RR:
14240: case RS:
14241: case UR:
14242: isolationLevel = isolationLevelDB2Abbrev();
14243: {
14244: if (true)
14245: return isolationLevel;
14246: }
14247: break;
14248: case REPEATABLE:
14249: case SERIALIZABLE:
14250: switch (jj_nt.kind) {
14251: case REPEATABLE:
14252: jj_consume_token(REPEATABLE);
14253: jj_consume_token(READ);
14254: break;
14255: case SERIALIZABLE:
14256: jj_consume_token(SERIALIZABLE);
14257: break;
14258: default:
14259: jj_la1[248] = jj_gen;
14260: jj_consume_token(-1);
14261: throw new ParseException();
14262: }
14263: {
14264: if (true)
14265: return ExecutionContext.SERIALIZABLE_ISOLATION_LEVEL;
14266: }
14267: break;
14268: case CURSOR:
14269: jj_consume_token(CURSOR);
14270: jj_consume_token(STABILITY);
14271: {
14272: if (true)
14273: return ExecutionContext.READ_COMMITTED_ISOLATION_LEVEL;
14274: }
14275: break;
14276: case DIRTY:
14277: jj_consume_token(DIRTY);
14278: jj_consume_token(READ);
14279: {
14280: if (true)
14281: return ExecutionContext.READ_UNCOMMITTED_ISOLATION_LEVEL;
14282: }
14283: break;
14284: default:
14285: jj_la1[249] = jj_gen;
14286: if (getToken(1).kind == READ
14287: && getToken(2).kind == COMMITTED) {
14288: jj_consume_token(READ);
14289: jj_consume_token(COMMITTED);
14290: {
14291: if (true)
14292: return ExecutionContext.READ_COMMITTED_ISOLATION_LEVEL;
14293: }
14294: } else if (getToken(1).kind == READ
14295: && getToken(2).kind == UNCOMMITTED) {
14296: jj_consume_token(READ);
14297: jj_consume_token(UNCOMMITTED);
14298: {
14299: if (true)
14300: return ExecutionContext.READ_UNCOMMITTED_ISOLATION_LEVEL;
14301: }
14302: } else {
14303: jj_consume_token(-1);
14304: throw new ParseException();
14305: }
14306: }
14307: throw new Error("Missing return statement in function");
14308: }
14309:
14310: final public int isolationLevelDB2Abbrev() throws ParseException {
14311: switch (jj_nt.kind) {
14312: case RR:
14313: jj_consume_token(RR);
14314: {
14315: if (true)
14316: return ExecutionContext.SERIALIZABLE_ISOLATION_LEVEL;
14317: }
14318: break;
14319: case RS:
14320: jj_consume_token(RS);
14321: {
14322: if (true)
14323: return ExecutionContext.REPEATABLE_READ_ISOLATION_LEVEL;
14324: }
14325: break;
14326: case CS:
14327: jj_consume_token(CS);
14328: {
14329: if (true)
14330: return ExecutionContext.READ_COMMITTED_ISOLATION_LEVEL;
14331: }
14332: break;
14333: case UR:
14334: jj_consume_token(UR);
14335: {
14336: if (true)
14337: return ExecutionContext.READ_UNCOMMITTED_ISOLATION_LEVEL;
14338: }
14339: break;
14340: default:
14341: jj_la1[250] = jj_gen;
14342: jj_consume_token(-1);
14343: throw new ParseException();
14344: }
14345: throw new Error("Missing return statement in function");
14346: }
14347:
14348: final public int isolationLevel() throws ParseException {
14349: int isolationLevel;
14350: jj_consume_token(ISOLATION);
14351: jj_consume_token(LEVEL);
14352: isolationLevel = levelOfIsolation();
14353: {
14354: if (true)
14355: return isolationLevel;
14356: }
14357: throw new Error("Missing return statement in function");
14358: }
14359:
14360: final public int levelOfIsolation() throws ParseException {
14361: switch (jj_nt.kind) {
14362: case READ:
14363: jj_consume_token(READ);
14364: {
14365: if (true)
14366: return levelOfIsolationRead();
14367: }
14368: break;
14369: case REPEATABLE:
14370: jj_consume_token(REPEATABLE);
14371: jj_consume_token(READ);
14372: {
14373: if (true)
14374: return ExecutionContext.REPEATABLE_READ_ISOLATION_LEVEL;
14375: }
14376: break;
14377: case SERIALIZABLE:
14378: jj_consume_token(SERIALIZABLE);
14379: {
14380: if (true)
14381: return ExecutionContext.SERIALIZABLE_ISOLATION_LEVEL;
14382: }
14383: break;
14384: default:
14385: jj_la1[251] = jj_gen;
14386: jj_consume_token(-1);
14387: throw new ParseException();
14388: }
14389: throw new Error("Missing return statement in function");
14390: }
14391:
14392: final public int levelOfIsolationRead() throws ParseException {
14393: switch (jj_nt.kind) {
14394: case UNCOMMITTED:
14395: jj_consume_token(UNCOMMITTED);
14396: {
14397: if (true)
14398: return ExecutionContext.READ_UNCOMMITTED_ISOLATION_LEVEL;
14399: }
14400: break;
14401: case COMMITTED:
14402: jj_consume_token(COMMITTED);
14403: {
14404: if (true)
14405: return ExecutionContext.READ_COMMITTED_ISOLATION_LEVEL;
14406: }
14407: break;
14408: default:
14409: jj_la1[252] = jj_gen;
14410: jj_consume_token(-1);
14411: throw new ParseException();
14412: }
14413: throw new Error("Missing return statement in function");
14414: }
14415:
14416: /*
14417: * <A NAME="simpleValueSpecification">simpleValueSpecification</A>
14418: */
14419: final public ValueNode simpleValueSpecification()
14420: throws ParseException, StandardException {
14421: ValueNode value;
14422: value = literal();
14423: {
14424: if (true)
14425: return value;
14426: }
14427: throw new Error("Missing return statement in function");
14428: }
14429:
14430: final public QueryTreeNode setSchemaStatement()
14431: throws ParseException, StandardException {
14432: QueryTreeNode setSchema = null;
14433: setSchemaHeader();
14434: switch (jj_nt.kind) {
14435: case EQUALS_OPERATOR:
14436: jj_consume_token(EQUALS_OPERATOR);
14437: break;
14438: default:
14439: jj_la1[253] = jj_gen;
14440: ;
14441: }
14442: setSchema = setSchemaValues();
14443: if (parameterList != null && parameterList.size() > 0) {
14444: setUpAndLinkParameters();
14445: // set the type of parameter node, it should be a varchar max Limits.MAX_IDENTIFIER_LENGTH - non nullable
14446: ParameterNode p = (ParameterNode) parameterList
14447: .elementAt(0);
14448: p.setType(new DataTypeDescriptor(TypeId
14449: .getBuiltInTypeId(Types.VARCHAR), false,
14450: Limits.MAX_IDENTIFIER_LENGTH));
14451: }
14452: {
14453: if (true)
14454: return setSchema;
14455: }
14456: throw new Error("Missing return statement in function");
14457: }
14458:
14459: final public void setSchemaHeader() throws ParseException,
14460: StandardException {
14461: switch (jj_nt.kind) {
14462: case SCHEMA:
14463: jj_consume_token(SCHEMA);
14464: break;
14465: default:
14466: jj_la1[255] = jj_gen;
14467: if (getToken(1).kind == CURRENT
14468: && (getToken(2).kind == SCHEMA || getToken(2).kind == SQLID)) {
14469: jj_consume_token(CURRENT);
14470: switch (jj_nt.kind) {
14471: case SCHEMA:
14472: jj_consume_token(SCHEMA);
14473: break;
14474: case SQLID:
14475: jj_consume_token(SQLID);
14476: break;
14477: default:
14478: jj_la1[254] = jj_gen;
14479: jj_consume_token(-1);
14480: throw new ParseException();
14481: }
14482: } else {
14483: jj_consume_token(-1);
14484: throw new ParseException();
14485: }
14486: }
14487: }
14488:
14489: final public QueryTreeNode setSchemaValues() throws ParseException,
14490: StandardException {
14491: String schemaName;
14492: switch (jj_nt.kind) {
14493: case BINARY:
14494: case COALESCE:
14495: case COUNT:
14496: case D:
14497: case MODULE:
14498: case T:
14499: case TS:
14500: case VALUE:
14501: case VARBINARY:
14502: case ABS:
14503: case ABSVAL:
14504: case ACTION:
14505: case ALWAYS:
14506: case BLOB:
14507: case C:
14508: case CALLED:
14509: case CLOB:
14510: case COBOL:
14511: case COMMITTED:
14512: case CONCAT:
14513: case CONTAINS:
14514: case DATA:
14515: case DATE:
14516: case DAY:
14517: case DYNAMIC:
14518: case FORTRAN:
14519: case GENERATED:
14520: case IDENTITY_VAL_LOCAL:
14521: case INCREMENT:
14522: case INITIAL:
14523: case INTERVAL:
14524: case LANGUAGE:
14525: case LARGE:
14526: case LENGTH:
14527: case LEVEL:
14528: case LOCKS:
14529: case LOCKSIZE:
14530: case LOGGED:
14531: case MOD:
14532: case MODIFIES:
14533: case MODIFY:
14534: case MONTH:
14535: case _MORE:
14536: case MUMPS:
14537: case NAME:
14538: case NCLOB:
14539: case NULLABLE:
14540: case NUMBER:
14541: case OBJECT:
14542: case PASCAL:
14543: case PLI:
14544: case PRECISION:
14545: case RELEASE:
14546: case REPEATABLE:
14547: case RESTART:
14548: case RETURNS:
14549: case ROW:
14550: case SAVEPOINT:
14551: case SCALE:
14552: case SERIALIZABLE:
14553: case SQL_TSI_FRAC_SECOND:
14554: case SQL_TSI_SECOND:
14555: case SQL_TSI_MINUTE:
14556: case SQL_TSI_HOUR:
14557: case SQL_TSI_DAY:
14558: case SQL_TSI_WEEK:
14559: case SQL_TSI_MONTH:
14560: case SQL_TSI_QUARTER:
14561: case SQL_TSI_YEAR:
14562: case START:
14563: case STATEMENT:
14564: case SYNONYM:
14565: case THEN:
14566: case TIME:
14567: case TIMESTAMP:
14568: case TIMESTAMPADD:
14569: case TIMESTAMPDIFF:
14570: case TRUNCATE:
14571: case TYPE:
14572: case UNCOMMITTED:
14573: case USAGE:
14574: case WHEN:
14575: case CURDATE:
14576: case CURTIME:
14577: case DATABASE:
14578: case LONG:
14579: case AFTER:
14580: case BEFORE:
14581: case CLASS:
14582: case COMPRESS:
14583: case CONTENT:
14584: case CS:
14585: case DB2SQL:
14586: case DIRTY:
14587: case DOCUMENT:
14588: case EACH:
14589: case EMPTY:
14590: case EXCLUSIVE:
14591: case FN:
14592: case INDEX:
14593: case JAVA:
14594: case LCASE:
14595: case LOCATE:
14596: case LOCK:
14597: case MESSAGE_LOCALE:
14598: case METHOD:
14599: case MODE:
14600: case NEW:
14601: case NEW_TABLE:
14602: case OJ:
14603: case OFF:
14604: case OLD:
14605: case OLD_TABLE:
14606: case PARAMETER:
14607: case PASSING:
14608: case PROPERTIES:
14609: case READS:
14610: case REF:
14611: case REFERENCING:
14612: case RENAME:
14613: case RESET:
14614: case RESULT:
14615: case RETAIN:
14616: case RETURNING:
14617: case RR:
14618: case RS:
14619: case SEQUENCE:
14620: case SEQUENTIAL:
14621: case SETS:
14622: case SHARE:
14623: case SQLID:
14624: case SPECIFIC:
14625: case SQRT:
14626: case STABILITY:
14627: case STRIP:
14628: case STYLE:
14629: case TRIGGER:
14630: case UCASE:
14631: case UR:
14632: case WHITESPACE:
14633: case IDENTIFIER:
14634: case DELIMITED_IDENTIFIER:
14635: schemaName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
14636: {
14637: if (true)
14638: return (QueryTreeNode) nodeFactory.getNode(
14639: C_NodeTypes.SET_SCHEMA_NODE, schemaName,
14640: null, getContextManager());
14641: }
14642: break;
14643: case USER:
14644: jj_consume_token(USER);
14645: {
14646: if (true)
14647: return (QueryTreeNode) nodeFactory
14648: .getNode(
14649: C_NodeTypes.SET_SCHEMA_NODE,
14650: null,
14651: ReuseFactory
14652: .getInteger(StatementType.SET_SCHEMA_USER),
14653: getContextManager());
14654: }
14655: break;
14656: case QUESTION_MARK:
14657: dynamicParameterSpecification();
14658: {
14659: if (true)
14660: return (QueryTreeNode) nodeFactory
14661: .getNode(
14662: C_NodeTypes.SET_SCHEMA_NODE,
14663: null,
14664: ReuseFactory
14665: .getInteger(StatementType.SET_SCHEMA_DYNAMIC),
14666: getContextManager());
14667: }
14668: break;
14669: case STRING:
14670: schemaName = string();
14671: /* Max length for schema name is Limits.MAX_IDENTIFIER_LENGTH */
14672: checkIdentifierLengthLimit(schemaName,
14673: Limits.MAX_IDENTIFIER_LENGTH);
14674: {
14675: if (true)
14676: return (QueryTreeNode) nodeFactory.getNode(
14677: C_NodeTypes.SET_SCHEMA_NODE, schemaName,
14678: null, getContextManager());
14679: }
14680: break;
14681: default:
14682: jj_la1[256] = jj_gen;
14683: jj_consume_token(-1);
14684: throw new ParseException();
14685: }
14686: throw new Error("Missing return statement in function");
14687: }
14688:
14689: // Set the locale for messages coming from the database system. This
14690: // is for support only, so we can get messages in our preferred language
14691: // (usually English). I didn't want to create all the execution wiring
14692: // to do this, so this command executes in the parser
14693: final public QueryTreeNode setMessageLocaleStatement()
14694: throws ParseException, StandardException {
14695: String messageLocale;
14696: jj_consume_token(MESSAGE_LOCALE);
14697: messageLocale = string();
14698: getContextManager().setMessageLocale(messageLocale);
14699:
14700: {
14701: if (true)
14702: return nodeFactory.getNode(
14703: C_NodeTypes.NOP_STATEMENT_NODE,
14704: getContextManager());
14705: }
14706: throw new Error("Missing return statement in function");
14707: }
14708:
14709: /*
14710: * <A NAME="valueSpecification">valueSpecification</A>
14711: */
14712: final public ValueNode valueSpecification() throws ParseException,
14713: StandardException {
14714: ValueNode value;
14715: ValueNode leftExpression;
14716: ValueNode rightExpression;
14717: switch (jj_nt.kind) {
14718: case FALSE:
14719: case TRUE:
14720: case LEFT_BRACE:
14721: case PLUS_SIGN:
14722: case MINUS_SIGN:
14723: case EXACT_NUMERIC:
14724: case STRING:
14725: case HEX_STRING:
14726: case APPROXIMATE_NUMERIC:
14727: value = literal();
14728: {
14729: if (true)
14730: return value;
14731: }
14732: break;
14733: case CURRENT_USER:
14734: case SESSION_USER:
14735: case USER:
14736: case QUESTION_MARK:
14737: value = generalValueSpecification();
14738: {
14739: if (true)
14740: return value;
14741: }
14742: break;
14743: case NULLIF:
14744: jj_consume_token(NULLIF);
14745: jj_consume_token(LEFT_PAREN);
14746: leftExpression = additiveExpression(null, 0, false);
14747: jj_consume_token(COMMA);
14748: rightExpression = additiveExpression(null, 0, false);
14749: jj_consume_token(RIGHT_PAREN);
14750: // "NULLIF(L, R)" is the same as "L=R ? untyped NULL : L"
14751: // An impl assumption here is that Cloudscape can promote CHAR to any comparable datatypes such as numeric
14752: ContextManager cm = getContextManager();
14753: ValueNodeList thenElseList = (ValueNodeList) nodeFactory
14754: .getNode(C_NodeTypes.VALUE_NODE_LIST, cm);
14755:
14756: //Use untyped null for then clause at this point. At the bind time, we will cast it to the datatype of L
14757: thenElseList.addElement((ValueNode) nodeFactory.getNode(
14758: C_NodeTypes.UNTYPED_NULL_CONSTANT_NODE, cm));
14759: thenElseList.addElement(leftExpression);
14760:
14761: {
14762: if (true)
14763: return (ValueNode) nodeFactory
14764: .getNode(
14765: C_NodeTypes.CONDITIONAL_NODE,
14766: (ValueNode) nodeFactory
14767: .getNode(
14768: C_NodeTypes.BINARY_EQUALS_OPERATOR_NODE,
14769: leftExpression,
14770: rightExpression, cm),
14771: thenElseList, Boolean.TRUE,//this node is for nullif
14772: cm);
14773: }
14774: break;
14775: case CASE:
14776: jj_consume_token(CASE);
14777: value = whenThenExpression();
14778: {
14779: if (true)
14780: return value;
14781: }
14782: break;
14783: default:
14784: jj_la1[257] = jj_gen;
14785: jj_consume_token(-1);
14786: throw new ParseException();
14787: }
14788: throw new Error("Missing return statement in function");
14789: }
14790:
14791: /*
14792: * <A NAME="caseExpression">caseExpression</A>
14793: */
14794: final public ValueNode caseExpression() throws ParseException,
14795: StandardException {
14796: ValueNode expr;
14797: switch (jj_nt.kind) {
14798: case END:
14799: jj_consume_token(END);
14800: {
14801: if (true)
14802: return ((ValueNode) nodeFactory
14803: .getNode(
14804: C_NodeTypes.CAST_NODE,
14805: (ValueNode) nodeFactory
14806: .getNode(
14807: C_NodeTypes.UNTYPED_NULL_CONSTANT_NODE,
14808: getContextManager()),
14809: DataTypeDescriptor
14810: .getBuiltInDataTypeDescriptor(
14811: Types.CHAR, 1),
14812: getContextManager()));
14813: }
14814: break;
14815: case ELSE:
14816: jj_consume_token(ELSE);
14817: expr = thenElseExpression();
14818: jj_consume_token(END);
14819: {
14820: if (true)
14821: return expr;
14822: }
14823: break;
14824: case WHEN:
14825: expr = whenThenExpression();
14826: {
14827: if (true)
14828: return expr;
14829: }
14830: break;
14831: default:
14832: jj_la1[258] = jj_gen;
14833: jj_consume_token(-1);
14834: throw new ParseException();
14835: }
14836: throw new Error("Missing return statement in function");
14837: }
14838:
14839: /*
14840: * <A NAME="whenThenExpression">whenThenExpression</A>
14841: */
14842: final public ValueNode whenThenExpression() throws ParseException,
14843: StandardException {
14844: ValueNode expr;
14845: ValueNode thenExpr;
14846: ValueNode elseExpr;
14847: jj_consume_token(WHEN);
14848: expr = orExpression(null, false);
14849: label_39: while (true) {
14850: switch (jj_nt.kind) {
14851: case OR:
14852: ;
14853: break;
14854: default:
14855: jj_la1[259] = jj_gen;
14856: break label_39;
14857: }
14858: jj_consume_token(OR);
14859: expr = orExpression(expr, false);
14860: }
14861: jj_consume_token(THEN);
14862: thenExpr = thenElseExpression();
14863: elseExpr = caseExpression();
14864: ContextManager cm = getContextManager();
14865: ValueNodeList thenElseList = (ValueNodeList) nodeFactory
14866: .getNode(C_NodeTypes.VALUE_NODE_LIST, cm);
14867: thenElseList.addElement(thenExpr); // then
14868: thenElseList.addElement(elseExpr); // else
14869:
14870: {
14871: if (true)
14872: return ((ValueNode) nodeFactory.getNode(
14873: C_NodeTypes.CONDITIONAL_NODE, expr,
14874: thenElseList, Boolean.FALSE, cm));
14875: }
14876: throw new Error("Missing return statement in function");
14877: }
14878:
14879: /*
14880: * <A NAME="thenElseExpression">thenElseExpression</A>
14881: */
14882: final public ValueNode thenElseExpression() throws ParseException,
14883: StandardException {
14884: ValueNode expr;
14885: if (getToken(1).kind == NULL) {
14886: jj_consume_token(NULL);
14887: {
14888: if (true)
14889: return ((ValueNode) nodeFactory
14890: .getNode(
14891: C_NodeTypes.CAST_NODE,
14892: (ValueNode) nodeFactory
14893: .getNode(
14894: C_NodeTypes.UNTYPED_NULL_CONSTANT_NODE,
14895: getContextManager()),
14896: DataTypeDescriptor
14897: .getBuiltInDataTypeDescriptor(
14898: Types.CHAR, 1),
14899: getContextManager()));
14900: }
14901: } else if (jj_2_45(1)) {
14902: expr = additiveExpression(null, 0, false);
14903: {
14904: if (true)
14905: return expr;
14906: }
14907: } else {
14908: jj_consume_token(-1);
14909: throw new ParseException();
14910: }
14911: throw new Error("Missing return statement in function");
14912: }
14913:
14914: final public TableElementNode tableConstraintDefinition()
14915: throws ParseException, StandardException {
14916: Properties properties = null;
14917: ConstraintDefinitionNode tcdn;
14918: TableName constraintName = null;
14919: //initialize following two booleans before handling table level constraints
14920: explicitNotNull = false;
14921: explicitNull = false;
14922: switch (jj_nt.kind) {
14923: case CONSTRAINT:
14924: constraintName = constraintNameDefinition();
14925: break;
14926: default:
14927: jj_la1[260] = jj_gen;
14928: ;
14929: }
14930: tcdn = tableConstraint(constraintName);
14931: switch (jj_nt.kind) {
14932: case DERBYDASHPROPERTIES:
14933: properties = propertyList(false);
14934: jj_consume_token(CHECK_PROPERTIES);
14935: break;
14936: default:
14937: jj_la1[261] = jj_gen;
14938: ;
14939: }
14940: if (properties != null) {
14941: tcdn.setProperties(properties);
14942: }
14943: {
14944: if (true)
14945: return tcdn;
14946: }
14947: throw new Error("Missing return statement in function");
14948: }
14949:
14950: final public ConstraintDefinitionNode tableConstraint(
14951: TableName constraintName) throws ParseException,
14952: StandardException {
14953: ConstraintDefinitionNode tcdn;
14954: switch (jj_nt.kind) {
14955: case PRIMARY:
14956: case UNIQUE:
14957: tcdn = uniqueConstraintDefinition(constraintName);
14958: {
14959: if (true)
14960: return tcdn;
14961: }
14962: break;
14963: case FOREIGN:
14964: tcdn = referentialConstraintDefinition(constraintName);
14965: {
14966: if (true)
14967: return tcdn;
14968: }
14969: break;
14970: case CHECK:
14971: tcdn = checkConstraintDefinition(constraintName, null);
14972: {
14973: if (true)
14974: return tcdn;
14975: }
14976: break;
14977: default:
14978: jj_la1[262] = jj_gen;
14979: jj_consume_token(-1);
14980: throw new ParseException();
14981: }
14982: throw new Error("Missing return statement in function");
14983: }
14984:
14985: final public ConstraintDefinitionNode uniqueConstraintDefinition(
14986: TableName constraintName) throws ParseException,
14987: StandardException {
14988: int constraintType;
14989: ResultColumnList uniqueColumnList;
14990: //for table level constraint, second parameter will be null
14991: constraintType = uniqueSpecification((DataTypeDescriptor) null,
14992: null);
14993: jj_consume_token(LEFT_PAREN);
14994: uniqueColumnList = uniqueColumnList();
14995: jj_consume_token(RIGHT_PAREN);
14996: //go through the unique columns list and if any of the columns in the
14997: //list is explicitly defined null, throw an exception for this. Columns
14998: //for which no nullability is defined are by default nullable. But in
14999: //case of create table, there nullability changes automatically to
15000: //non-nullable if primary key is defined on it. But if user explicitly
15001: //defines the nullability, then defining a primary key on it in create
15002: //table will result in an exception.
15003: if (constraintType == DataDictionary.PRIMARYKEY_CONSTRAINT) {
15004: for (int index = 0; index < uniqueColumnList.size(); index++) {
15005: String primaryKeyColumnName = ((ResultColumn) uniqueColumnList
15006: .elementAt(index)).getName();
15007: if (explicitlyNullableColumnsList
15008: .contains(primaryKeyColumnName)) {
15009: String errorState = SQLState.LANG_DB2_ADD_UNIQUE_OR_PRIMARY_KEY_ON_NULL_COLS;
15010: {
15011: if (true)
15012: throw StandardException.newException(
15013: errorState, primaryKeyColumnName);
15014: }
15015: }
15016: }
15017: }
15018: {
15019: if (true)
15020: return (ConstraintDefinitionNode) nodeFactory.getNode(
15021: C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
15022: constraintName, ReuseFactory
15023: .getInteger(constraintType),
15024: uniqueColumnList, null, null, null,
15025: getContextManager());
15026: }
15027: throw new Error("Missing return statement in function");
15028: }
15029:
15030: //the second parameter to the following method will always be null for a table level
15031: //constraint but not for a column level constraint
15032: final public int uniqueSpecification(
15033: DataTypeDescriptor dataTypeDescriptor, String columnName)
15034: throws ParseException, StandardException {
15035: switch (jj_nt.kind) {
15036: case UNIQUE:
15037: jj_consume_token(UNIQUE);
15038: {
15039: if (true)
15040: return DataDictionary.UNIQUE_CONSTRAINT;
15041: }
15042: break;
15043: case PRIMARY:
15044: jj_consume_token(PRIMARY);
15045: jj_consume_token(KEY);
15046: //explicitNull can be true only if it's column level constraint and
15047: //that column has null constraint defined on it. In that case, defining
15048: //a column-level constraint of primary key on it will result in an error.
15049: if (explicitNull) {
15050: String errorState = SQLState.LANG_DB2_ADD_UNIQUE_OR_PRIMARY_KEY_ON_NULL_COLS;
15051: {
15052: if (true)
15053: throw StandardException.newException(
15054: errorState, columnName);
15055: }
15056: }
15057: {
15058: if (true)
15059: return DataDictionary.PRIMARYKEY_CONSTRAINT;
15060: }
15061: break;
15062: default:
15063: jj_la1[263] = jj_gen;
15064: jj_consume_token(-1);
15065: throw new ParseException();
15066: }
15067: throw new Error("Missing return statement in function");
15068: }
15069:
15070: final public ResultColumnList uniqueColumnList()
15071: throws ParseException, StandardException {
15072: ResultColumnList resultColumns = (ResultColumnList) nodeFactory
15073: .getNode(C_NodeTypes.RESULT_COLUMN_LIST,
15074: getContextManager());
15075: columnNameList(resultColumns);
15076: {
15077: if (true)
15078: return resultColumns;
15079: }
15080: throw new Error("Missing return statement in function");
15081: }
15082:
15083: final public ConstraintDefinitionNode referentialConstraintDefinition(
15084: TableName constraintName) throws ParseException,
15085: StandardException {
15086: ResultColumnList fkRcl = (ResultColumnList) nodeFactory
15087: .getNode(C_NodeTypes.RESULT_COLUMN_LIST,
15088: getContextManager());
15089: ResultColumnList refRcl = (ResultColumnList) nodeFactory
15090: .getNode(C_NodeTypes.RESULT_COLUMN_LIST,
15091: getContextManager());
15092: TableName referencedTable;
15093: int[] refActions = { StatementType.RA_NOACTION,
15094: StatementType.RA_NOACTION };
15095: jj_consume_token(FOREIGN);
15096: jj_consume_token(KEY);
15097: jj_consume_token(LEFT_PAREN);
15098: columnNameList(fkRcl);
15099: jj_consume_token(RIGHT_PAREN);
15100: referencedTable = referencesSpecification(refRcl, refActions);
15101: {
15102: if (true)
15103: return (ConstraintDefinitionNode) nodeFactory.getNode(
15104: C_NodeTypes.FK_CONSTRAINT_DEFINITION_NODE,
15105: constraintName, referencedTable, fkRcl, refRcl,
15106: refActions, getContextManager());
15107: }
15108: throw new Error("Missing return statement in function");
15109: }
15110:
15111: final public TableName referencesSpecification(
15112: ResultColumnList rcl, int[] refActions)
15113: throws ParseException, StandardException {
15114: TableName tableName = null;
15115: jj_consume_token(REFERENCES);
15116: tableName = referencedTableAndColumns(rcl);
15117: switch (jj_nt.kind) {
15118: case ON:
15119: jj_consume_token(ON);
15120: referentialTriggeredAction(refActions);
15121: break;
15122: default:
15123: jj_la1[264] = jj_gen;
15124: ;
15125: }
15126: {
15127: if (true)
15128: return tableName;
15129: }
15130: throw new Error("Missing return statement in function");
15131: }
15132:
15133: final public TableName referencedTableAndColumns(
15134: ResultColumnList rcl) throws ParseException,
15135: StandardException {
15136: TableName tableName = null;
15137: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
15138: switch (jj_nt.kind) {
15139: case LEFT_PAREN:
15140: jj_consume_token(LEFT_PAREN);
15141: columnNameList(rcl);
15142: jj_consume_token(RIGHT_PAREN);
15143: break;
15144: default:
15145: jj_la1[265] = jj_gen;
15146: ;
15147: }
15148: {
15149: if (true)
15150: return tableName;
15151: }
15152: throw new Error("Missing return statement in function");
15153: }
15154:
15155: final public void referentialTriggeredAction(int[] refActions)
15156: throws ParseException, StandardException {
15157: switch (jj_nt.kind) {
15158: case UPDATE:
15159: refActions[1] = updateRule();
15160: switch (jj_nt.kind) {
15161: case ON:
15162: jj_consume_token(ON);
15163: refActions[0] = deleteRule();
15164: break;
15165: default:
15166: jj_la1[266] = jj_gen;
15167: ;
15168: }
15169: break;
15170: case DELETE:
15171: refActions[0] = deleteRule();
15172: switch (jj_nt.kind) {
15173: case ON:
15174: jj_consume_token(ON);
15175: refActions[1] = updateRule();
15176: break;
15177: default:
15178: jj_la1[267] = jj_gen;
15179: ;
15180: }
15181: break;
15182: default:
15183: jj_la1[268] = jj_gen;
15184: jj_consume_token(-1);
15185: throw new ParseException();
15186: }
15187: }
15188:
15189: final public int updateRule() throws ParseException {
15190: int action;
15191: jj_consume_token(UPDATE);
15192: action = updateReferentialAction();
15193: {
15194: if (true)
15195: return action;
15196: }
15197: throw new Error("Missing return statement in function");
15198: }
15199:
15200: final public int deleteRule() throws ParseException {
15201: int action;
15202: jj_consume_token(DELETE);
15203: action = deleteReferentialAction();
15204: {
15205: if (true)
15206: return action;
15207: }
15208: throw new Error("Missing return statement in function");
15209: }
15210:
15211: final public int updateReferentialAction() throws ParseException {
15212: switch (jj_nt.kind) {
15213: case RESTRICT:
15214: jj_consume_token(RESTRICT);
15215: {
15216: if (true)
15217: return StatementType.RA_RESTRICT;
15218: }
15219: break;
15220: case NO:
15221: jj_consume_token(NO);
15222: jj_consume_token(ACTION);
15223: {
15224: if (true)
15225: return StatementType.RA_NOACTION;
15226: }
15227: break;
15228: default:
15229: jj_la1[269] = jj_gen;
15230: jj_consume_token(-1);
15231: throw new ParseException();
15232: }
15233: throw new Error("Missing return statement in function");
15234: }
15235:
15236: final public int deleteReferentialAction() throws ParseException {
15237: switch (jj_nt.kind) {
15238: case CASCADE:
15239: jj_consume_token(CASCADE);
15240: {
15241: if (true)
15242: return StatementType.RA_CASCADE;
15243: }
15244: break;
15245: case RESTRICT:
15246: jj_consume_token(RESTRICT);
15247: {
15248: if (true)
15249: return StatementType.RA_RESTRICT;
15250: }
15251: break;
15252: case NO:
15253: jj_consume_token(NO);
15254: jj_consume_token(ACTION);
15255: {
15256: if (true)
15257: return StatementType.RA_NOACTION;
15258: }
15259: break;
15260: case SET:
15261: jj_consume_token(SET);
15262: switch (jj_nt.kind) {
15263: case NULL:
15264: jj_consume_token(NULL);
15265: {
15266: if (true)
15267: return StatementType.RA_SETNULL;
15268: }
15269: break;
15270: case _DEFAULT:
15271: jj_consume_token(_DEFAULT);
15272: {
15273: if (true)
15274: return StatementType.RA_SETDEFAULT;
15275: }
15276: break;
15277: default:
15278: jj_la1[270] = jj_gen;
15279: jj_consume_token(-1);
15280: throw new ParseException();
15281: }
15282: break;
15283: default:
15284: jj_la1[271] = jj_gen;
15285: jj_consume_token(-1);
15286: throw new ParseException();
15287: }
15288: throw new Error("Missing return statement in function");
15289: }
15290:
15291: /*
15292: * <A NAME="columnConstraintDefinition">columnConstraintDefinition</A>
15293: */
15294: final public void columnConstraintDefinition(
15295: DataTypeDescriptor dataTypeDescriptor,
15296: TableElementList tableElementList, String columnName)
15297: throws ParseException, StandardException {
15298: int constraintType;
15299: TableElementNode tcdn;
15300: TableName constraintName = null;
15301: switch (jj_nt.kind) {
15302: case CONSTRAINT:
15303: constraintName = constraintNameDefinition();
15304: break;
15305: default:
15306: jj_la1[272] = jj_gen;
15307: ;
15308: }
15309: tcdn = columnConstraint(constraintName, dataTypeDescriptor,
15310: columnName);
15311: /* NOT NULL constraints are handled by marking the dataTypeDescriptor
15312: * as being non-nullable.
15313: */
15314: if (tcdn == null) {
15315: {
15316: if (true)
15317: return;
15318: }
15319: }
15320:
15321: /* All other constraints, whether column or table will be added as
15322: * table constraints. We do this to facilitate the handling of
15323: * multiple column constraints on the same column.
15324: */
15325: tableElementList.addTableElement(tcdn);
15326: }
15327:
15328: /*
15329: * <A NAME="columnConstraint">columnConstraint</A>
15330: */
15331: final public ConstraintDefinitionNode columnConstraint(
15332: TableName constraintName,
15333: DataTypeDescriptor dataTypeDescriptor, String columnName)
15334: throws ParseException, StandardException {
15335: int constraintType;
15336: Properties properties = null;
15337: ConstraintDefinitionNode tcdn;
15338: ResultColumnList refRcl = (ResultColumnList) nodeFactory
15339: .getNode(C_NodeTypes.RESULT_COLUMN_LIST,
15340: getContextManager());
15341: TableName referencedTable;
15342: int[] refActions = { StatementType.RA_NOACTION,
15343: StatementType.RA_NOACTION };
15344: switch (jj_nt.kind) {
15345: case NOT:
15346: jj_consume_token(NOT);
15347: jj_consume_token(NULL);
15348: //if column is explicitly defined not nullable, set following flag
15349: explicitNotNull = true;
15350: //if both null and not null constraints are defined for a column,
15351: //throw an exception
15352: if (explicitNull) {
15353: if (true)
15354: throw StandardException
15355: .newException(
15356: SQLState.LANG_ADDING_COLUMN_WITH_NULL_AND_NOT_NULL_CONSTRAINT,
15357: columnName);
15358: }
15359: dataTypeDescriptor.setNullability(false);
15360: {
15361: if (true)
15362: return null;
15363: }
15364: break;
15365: case PRIMARY:
15366: case UNIQUE:
15367: //pass the columnname as the second parameter. It will be used to throw an
15368: //exception if null constraint is defined for this column-level primary
15369: //key constraint
15370: constraintType = uniqueSpecification(dataTypeDescriptor,
15371: columnName);
15372: switch (jj_nt.kind) {
15373: case DERBYDASHPROPERTIES:
15374: properties = propertyList(false);
15375: jj_consume_token(CHECK_PROPERTIES);
15376: break;
15377: default:
15378: jj_la1[273] = jj_gen;
15379: ;
15380: }
15381: ResultColumnList uniqueColumnList = (ResultColumnList) nodeFactory
15382: .getNode(C_NodeTypes.RESULT_COLUMN_LIST,
15383: getContextManager());
15384: uniqueColumnList.addElement((ResultColumn) nodeFactory
15385: .getNode(C_NodeTypes.RESULT_COLUMN, columnName,
15386: null, getContextManager()));
15387:
15388: {
15389: if (true)
15390: return (ConstraintDefinitionNode) nodeFactory
15391: .getNode(
15392: C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
15393: constraintName,
15394: ReuseFactory
15395: .getInteger(constraintType),
15396: uniqueColumnList, properties, null,
15397: null, getContextManager());
15398: }
15399: break;
15400: case REFERENCES:
15401: referencedTable = referencesSpecification(refRcl,
15402: refActions);
15403: switch (jj_nt.kind) {
15404: case DERBYDASHPROPERTIES:
15405: properties = propertyList(false);
15406: jj_consume_token(CHECK_PROPERTIES);
15407: break;
15408: default:
15409: jj_la1[274] = jj_gen;
15410: ;
15411: }
15412: ResultColumnList fkRcl = (ResultColumnList) nodeFactory
15413: .getNode(C_NodeTypes.RESULT_COLUMN_LIST,
15414: getContextManager());
15415: fkRcl.addElement((ResultColumn) nodeFactory.getNode(
15416: C_NodeTypes.RESULT_COLUMN, columnName, null,
15417: getContextManager()));
15418: tcdn = (ConstraintDefinitionNode) nodeFactory.getNode(
15419: C_NodeTypes.FK_CONSTRAINT_DEFINITION_NODE,
15420: constraintName, referencedTable, fkRcl, refRcl,
15421: refActions, getContextManager());
15422: if (properties != null) {
15423: tcdn.setProperties(properties);
15424: }
15425: {
15426: if (true)
15427: return tcdn;
15428: }
15429: break;
15430: case CHECK:
15431: tcdn = checkConstraintDefinition(constraintName, columnName);
15432: {
15433: if (true)
15434: return tcdn;
15435: }
15436: break;
15437: default:
15438: jj_la1[275] = jj_gen;
15439: jj_consume_token(-1);
15440: throw new ParseException();
15441: }
15442: throw new Error("Missing return statement in function");
15443: }
15444:
15445: final public QueryTreeNode dropSchemaStatement()
15446: throws ParseException, StandardException {
15447: String schemaName;
15448: jj_consume_token(SCHEMA);
15449: schemaName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
15450: jj_consume_token(RESTRICT);
15451: QueryTreeNode stmt = nodeFactory.getNode(
15452: C_NodeTypes.DROP_SCHEMA_NODE, schemaName, new Integer(
15453: StatementType.DROP_RESTRICT),
15454: getContextManager());
15455:
15456: {
15457: if (true)
15458: return stmt;
15459: }
15460: throw new Error("Missing return statement in function");
15461: }
15462:
15463: final public QueryTreeNode alterTableStatement()
15464: throws ParseException, StandardException {
15465: QueryTreeNode node;
15466: TableName tableName;
15467: jj_consume_token(TABLE);
15468: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
15469: node = alterTableBody(tableName);
15470: {
15471: if (true)
15472: return node;
15473: }
15474: throw new Error("Missing return statement in function");
15475: }
15476:
15477: final public QueryTreeNode alterTableBody(TableName tableName)
15478: throws ParseException, StandardException {
15479: QueryTreeNode qtn;
15480: char lockGranularity = '\0';
15481: String newTableName;
15482: TableElementList tableElementList = (TableElementList) nodeFactory
15483: .getNode(C_NodeTypes.TABLE_ELEMENT_LIST,
15484: getContextManager());
15485: Token tok = null;
15486: int[] changeType = new int[1];
15487: int[] behavior = new int[1];
15488: boolean[] sequential = new boolean[1];
15489: switch (jj_nt.kind) {
15490: case COMPRESS:
15491: jj_consume_token(COMPRESS);
15492: switch (jj_nt.kind) {
15493: case SEQUENTIAL:
15494: tok = jj_consume_token(SEQUENTIAL);
15495: break;
15496: default:
15497: jj_la1[276] = jj_gen;
15498: ;
15499: }
15500: checkInternalFeature("COMPRESS");
15501: {
15502: if (true)
15503: return (QueryTreeNode) nodeFactory.getNode(
15504: C_NodeTypes.ALTER_TABLE_NODE, tableName,
15505: new Boolean(tok != null),
15506: getContextManager());
15507: }
15508: break;
15509: default:
15510: jj_la1[277] = jj_gen;
15511: if (jj_2_46(1)) {
15512: lockGranularity = alterTableAction(tableElementList,
15513: changeType, behavior, sequential);
15514: {
15515: if (true)
15516: return (QueryTreeNode) nodeFactory.getNode(
15517: C_NodeTypes.ALTER_TABLE_NODE,
15518: tableName, tableElementList,
15519: new Character(lockGranularity),
15520: changeType, behavior, sequential,
15521: getContextManager());
15522: }
15523: } else {
15524: jj_consume_token(-1);
15525: throw new ParseException();
15526: }
15527: }
15528: throw new Error("Missing return statement in function");
15529: }
15530:
15531: /*
15532: * <A NAME="alterTableRenameTableStatement">alterTableRenameTableStatement</A>
15533: */
15534: /*
15535: QueryTreeNode
15536: alterTableRenameTableStatement(TableName tableName) throws StandardException :
15537: {
15538: String newTableName;
15539: }
15540: {
15541: <TO> newTableName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
15542: {
15543: return (QueryTreeNode) nodeFactory.getNode(
15544: C_NodeTypes.RENAME_NODE,
15545: tableName,
15546: null,
15547: newTableName,
15548: Boolean.TRUE,
15549: ReuseFactory.getInteger(StatementType.RENAME_TABLE),
15550: getContextManager());
15551: }
15552: }
15553: */
15554:
15555: /*
15556: * <A NAME="alterTableRenameColumnStatement">alterTableRenameColumnStatement</A>
15557: */
15558: /*
15559: QueryTreeNode
15560: alterTableRenameColumnStatement(TableName tableName) throws StandardException :
15561: {
15562: String oldColumnName;
15563: String newColumnName;
15564: }
15565: {
15566: oldColumnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true) <TO> newColumnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true)
15567: {
15568: return (QueryTreeNode) nodeFactory.getNode(
15569: C_NodeTypes.RENAME_NODE,
15570: tableName,
15571: oldColumnName,
15572: newColumnName,
15573: Boolean.TRUE,
15574: ReuseFactory.getInteger(StatementType.RENAME_COLUMN),
15575: getContextManager());
15576: }
15577: }
15578: */
15579: final public char alterTableAction(
15580: TableElementList tableElementList, int[] changeType,
15581: int[] behavior, boolean[] sequential)
15582: throws ParseException, StandardException {
15583: char lockGranularity = '\0';
15584: TableElementNode tableElement;
15585: DataTypeDescriptor typeDescriptor;
15586: Token tok = null;
15587: String columnName;
15588: long[] autoIncrementInfo = new long[4];
15589: switch (jj_nt.kind) {
15590: case ADD:
15591: jj_consume_token(ADD);
15592: switch (jj_nt.kind) {
15593: case BINARY:
15594: case COALESCE:
15595: case COLUMN:
15596: case COUNT:
15597: case D:
15598: case MODULE:
15599: case T:
15600: case TS:
15601: case VALUE:
15602: case VARBINARY:
15603: case ABS:
15604: case ABSVAL:
15605: case ACTION:
15606: case ALWAYS:
15607: case BLOB:
15608: case C:
15609: case CALLED:
15610: case CLOB:
15611: case COBOL:
15612: case COMMITTED:
15613: case CONCAT:
15614: case CONTAINS:
15615: case DATA:
15616: case DATE:
15617: case DAY:
15618: case DYNAMIC:
15619: case FORTRAN:
15620: case GENERATED:
15621: case IDENTITY_VAL_LOCAL:
15622: case INCREMENT:
15623: case INITIAL:
15624: case INTERVAL:
15625: case LANGUAGE:
15626: case LARGE:
15627: case LENGTH:
15628: case LEVEL:
15629: case LOCKS:
15630: case LOCKSIZE:
15631: case LOGGED:
15632: case MOD:
15633: case MODIFIES:
15634: case MODIFY:
15635: case MONTH:
15636: case _MORE:
15637: case MUMPS:
15638: case NAME:
15639: case NCLOB:
15640: case NULLABLE:
15641: case NUMBER:
15642: case OBJECT:
15643: case PASCAL:
15644: case PLI:
15645: case PRECISION:
15646: case RELEASE:
15647: case REPEATABLE:
15648: case RESTART:
15649: case RETURNS:
15650: case ROW:
15651: case SAVEPOINT:
15652: case SCALE:
15653: case SERIALIZABLE:
15654: case SQL_TSI_FRAC_SECOND:
15655: case SQL_TSI_SECOND:
15656: case SQL_TSI_MINUTE:
15657: case SQL_TSI_HOUR:
15658: case SQL_TSI_DAY:
15659: case SQL_TSI_WEEK:
15660: case SQL_TSI_MONTH:
15661: case SQL_TSI_QUARTER:
15662: case SQL_TSI_YEAR:
15663: case START:
15664: case STATEMENT:
15665: case SYNONYM:
15666: case THEN:
15667: case TIME:
15668: case TIMESTAMP:
15669: case TIMESTAMPADD:
15670: case TIMESTAMPDIFF:
15671: case TRUNCATE:
15672: case TYPE:
15673: case UNCOMMITTED:
15674: case USAGE:
15675: case WHEN:
15676: case CURDATE:
15677: case CURTIME:
15678: case DATABASE:
15679: case LONG:
15680: case AFTER:
15681: case BEFORE:
15682: case CLASS:
15683: case COMPRESS:
15684: case CONTENT:
15685: case CS:
15686: case DB2SQL:
15687: case DIRTY:
15688: case DOCUMENT:
15689: case EACH:
15690: case EMPTY:
15691: case EXCLUSIVE:
15692: case FN:
15693: case INDEX:
15694: case JAVA:
15695: case LCASE:
15696: case LOCATE:
15697: case LOCK:
15698: case MESSAGE_LOCALE:
15699: case METHOD:
15700: case MODE:
15701: case NEW:
15702: case NEW_TABLE:
15703: case OJ:
15704: case OFF:
15705: case OLD:
15706: case OLD_TABLE:
15707: case PARAMETER:
15708: case PASSING:
15709: case PROPERTIES:
15710: case READS:
15711: case REF:
15712: case REFERENCING:
15713: case RENAME:
15714: case RESET:
15715: case RESULT:
15716: case RETAIN:
15717: case RETURNING:
15718: case RR:
15719: case RS:
15720: case SEQUENCE:
15721: case SEQUENTIAL:
15722: case SETS:
15723: case SHARE:
15724: case SQLID:
15725: case SPECIFIC:
15726: case SQRT:
15727: case STABILITY:
15728: case STRIP:
15729: case STYLE:
15730: case TRIGGER:
15731: case UCASE:
15732: case UR:
15733: case WHITESPACE:
15734: case IDENTIFIER:
15735: case DELIMITED_IDENTIFIER:
15736: tableElement = addColumnDefinition(tableElementList);
15737: break;
15738: case CHECK:
15739: case CONSTRAINT:
15740: case FOREIGN:
15741: case PRIMARY:
15742: case UNIQUE:
15743: tableElement = tableConstraintDefinition();
15744: break;
15745: default:
15746: jj_la1[278] = jj_gen;
15747: jj_consume_token(-1);
15748: throw new ParseException();
15749: }
15750: if (tableElement instanceof ColumnDefinitionNode) {
15751: //bug 5724 - auto increment columns not allowed in ALTER TABLE statement
15752: ColumnDefinitionNode cdn = (ColumnDefinitionNode) tableElement;
15753: if (cdn.isAutoincrementColumn()) {
15754: if (true)
15755: throw StandardException
15756: .newException(SQLState.LANG_ALTER_TABLE_AUTOINCREMENT_COLUMN_NOT_ALLOWED);
15757: }
15758: }
15759: changeType[0] = DDLStatementNode.ADD_TYPE;
15760: tableElementList.addTableElement(tableElement);
15761: {
15762: if (true)
15763: return lockGranularity;
15764: }
15765: break;
15766: case ALTER:
15767: jj_consume_token(ALTER);
15768: switch (jj_nt.kind) {
15769: case COLUMN:
15770: jj_consume_token(COLUMN);
15771: break;
15772: default:
15773: jj_la1[279] = jj_gen;
15774: ;
15775: }
15776: columnName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
15777: tableElement = columnAlterClause(columnName);
15778: changeType[0] = DDLStatementNode.MODIFY_TYPE;
15779: tableElementList.addTableElement(tableElement);
15780: {
15781: if (true)
15782: return lockGranularity;
15783: }
15784: break;
15785: default:
15786: jj_la1[280] = jj_gen;
15787: if (getToken(1).kind == DROP
15788: && (getToken(2).kind == CONSTRAINT
15789: || getToken(2).kind == PRIMARY
15790: || getToken(2).kind == FOREIGN
15791: || getToken(2).kind == UNIQUE || getToken(2).kind == CHECK)) {
15792: tableElement = dropTableConstraintDefinition();
15793: changeType[0] = DDLStatementNode.DROP_TYPE;
15794: tableElementList.addTableElement(tableElement);
15795: {
15796: if (true)
15797: return lockGranularity;
15798: }
15799: } else {
15800: switch (jj_nt.kind) {
15801: case LOCKSIZE:
15802: lockGranularity = DB2lockGranularityClause();
15803: changeType[0] = DDLStatementNode.LOCKING_TYPE;
15804: {
15805: if (true)
15806: return lockGranularity;
15807: }
15808: break;
15809: default:
15810: jj_la1[281] = jj_gen;
15811: jj_consume_token(-1);
15812: throw new ParseException();
15813: }
15814: }
15815: }
15816: throw new Error("Missing return statement in function");
15817: }
15818:
15819: final public TableElementNode addColumnDefinition(
15820: TableElementList tableElementList) throws ParseException,
15821: StandardException {
15822: TableElementNode tableElement;
15823: switch (jj_nt.kind) {
15824: case COLUMN:
15825: jj_consume_token(COLUMN);
15826: break;
15827: default:
15828: jj_la1[282] = jj_gen;
15829: ;
15830: }
15831: tableElement = columnDefinition(tableElementList);
15832: {
15833: if (true)
15834: return tableElement;
15835: }
15836: throw new Error("Missing return statement in function");
15837: }
15838:
15839: /*
15840: * Various variants of the ALTER TABLE ALTER COLUMN statement.
15841: *
15842: * By the type we get here, we've parsed
15843: * ALTER TABLE tablename ALTER [COLUMN] columnname
15844: * and here we parse the remainder of the ALTER COLUMN clause, one of:
15845: * SET DATA TYPE data_type
15846: * SET INCREMENT BY increment_value
15847: * RESTART WITH increment_restart_value
15848: * [WITH] DEFAULT default_value
15849: * [NOT] NULL
15850: */
15851: final public TableElementNode columnAlterClause(String columnName)
15852: throws ParseException, StandardException {
15853: ValueNode defaultNode;
15854: long[] autoIncrementInfo = new long[4];
15855: long autoIncrementIncrement = 1;
15856: long autoIncrementRestartWith = 1;
15857: DataTypeDescriptor typeDescriptor = null;
15858: if (getToken(2).kind == DATA) {
15859: jj_consume_token(SET);
15860: jj_consume_token(DATA);
15861: jj_consume_token(TYPE);
15862: typeDescriptor = dataTypeDDL();
15863: {
15864: if (true)
15865: return (TableElementNode) nodeFactory.getNode(
15866: C_NodeTypes.MODIFY_COLUMN_TYPE_NODE,
15867: columnName, null, typeDescriptor, null,
15868: getContextManager());
15869: }
15870: } else if (getToken(2).kind == INCREMENT) {
15871: jj_consume_token(SET);
15872: jj_consume_token(INCREMENT);
15873: jj_consume_token(BY);
15874: autoIncrementIncrement = exactNumber();
15875: autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_INC_INDEX] = autoIncrementIncrement;
15876: autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_CREATE_MODIFY] = ColumnDefinitionNode.MODIFY_AUTOINCREMENT_INC_VALUE;
15877: {
15878: if (true)
15879: return (TableElementNode) nodeFactory.getNode(
15880: C_NodeTypes.MODIFY_COLUMN_DEFAULT_NODE,
15881: columnName, null, null, autoIncrementInfo,
15882: getContextManager());
15883: }
15884: } else {
15885: switch (jj_nt.kind) {
15886: case RESTART:
15887: jj_consume_token(RESTART);
15888: jj_consume_token(WITH);
15889: autoIncrementRestartWith = exactNumber();
15890: autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_START_INDEX] = autoIncrementRestartWith;
15891: autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_CREATE_MODIFY] = ColumnDefinitionNode.MODIFY_AUTOINCREMENT_RESTART_VALUE;
15892: {
15893: if (true)
15894: return (TableElementNode) nodeFactory.getNode(
15895: C_NodeTypes.MODIFY_COLUMN_DEFAULT_NODE,
15896: columnName, null, null,
15897: autoIncrementInfo, getContextManager());
15898: }
15899: break;
15900: default:
15901: jj_la1[283] = jj_gen;
15902: if (getToken(1).kind == WITH
15903: || getToken(1).kind == _DEFAULT) {
15904: defaultNode = defaultClause(autoIncrementInfo,
15905: columnName);
15906: if (autoIncrementInfo[QueryTreeNode.AUTOINCREMENT_IS_AUTOINCREMENT_INDEX] == 0) {
15907: autoIncrementInfo = null;
15908: }
15909:
15910: {
15911: if (true)
15912: return (TableElementNode) nodeFactory
15913: .getNode(
15914: C_NodeTypes.MODIFY_COLUMN_DEFAULT_NODE,
15915: columnName, defaultNode,
15916: null, autoIncrementInfo,
15917: getContextManager());
15918: }
15919: } else if (getToken(1).kind == NULL) {
15920: jj_consume_token(NULL);
15921: // for a MODIFY column NULL clause form a modify_column node
15922: // with all null values. In a column definition a [NOT] NULL
15923: // column constraint is specified by setting the right value
15924: // in the nullability field of the data type but we don't have
15925: // a datatype here.
15926: {
15927: if (true)
15928: return (TableElementNode) nodeFactory
15929: .getNode(
15930: C_NodeTypes.MODIFY_COLUMN_CONSTRAINT_NODE,
15931: columnName, null, null,
15932: null, getContextManager());
15933: }
15934: } else if (getToken(1).kind == NOT) {
15935: jj_consume_token(NOT);
15936: jj_consume_token(NULL);
15937: // for a MODIFY column NOT NULL clause form a modify_column node
15938: // with all null values. In a column definition a [NOT] NULL
15939: // column constraint is specified by setting the right value
15940: // in the nullability field of the data type but we don't have
15941: // a datatype here.
15942: {
15943: if (true)
15944: return (TableElementNode) nodeFactory
15945: .getNode(
15946: C_NodeTypes.MODIFY_COLUMN_CONSTRAINT_NOT_NULL_NODE,
15947: columnName, null, null,
15948: null, getContextManager());
15949: }
15950: } else {
15951: jj_consume_token(-1);
15952: throw new ParseException();
15953: }
15954: }
15955: }
15956: throw new Error("Missing return statement in function");
15957: }
15958:
15959: final public TableElementNode dropTableConstraintDefinition()
15960: throws ParseException, StandardException {
15961: TableName constraintName;
15962: if (getToken(2).kind == CONSTRAINT) {
15963: jj_consume_token(DROP);
15964: jj_consume_token(CONSTRAINT);
15965: constraintName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
15966: {
15967: if (true)
15968: return (TableElementNode) nodeFactory
15969: .getNode(
15970: C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
15971: constraintName,
15972: ReuseFactory
15973: .getInteger(DataDictionary.DROP_CONSTRAINT),
15974: null,
15975: null,
15976: null,
15977: null,
15978: ReuseFactory
15979: .getInteger(StatementType.DROP_DEFAULT),
15980: getContextManager());
15981: }
15982: } else if (getToken(2).kind == PRIMARY) {
15983: jj_consume_token(DROP);
15984: jj_consume_token(PRIMARY);
15985: jj_consume_token(KEY);
15986: {
15987: if (true)
15988: return (TableElementNode) nodeFactory
15989: .getNode(
15990: C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
15991: null,
15992: ReuseFactory
15993: .getInteger(DataDictionary.DROP_CONSTRAINT),
15994: null,
15995: null,
15996: null,
15997: null,
15998: ReuseFactory
15999: .getInteger(StatementType.DROP_DEFAULT),
16000: getContextManager());
16001: }
16002: } else if (getToken(2).kind == FOREIGN) {
16003: jj_consume_token(DROP);
16004: jj_consume_token(FOREIGN);
16005: jj_consume_token(KEY);
16006: constraintName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
16007: {
16008: if (true)
16009: return (TableElementNode) nodeFactory
16010: .getNode(
16011: C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
16012: constraintName,
16013: ReuseFactory
16014: .getInteger(DataDictionary.DROP_CONSTRAINT),
16015: null,
16016: null,
16017: null,
16018: null,
16019: ReuseFactory
16020: .getInteger(StatementType.DROP_DEFAULT),
16021: ReuseFactory
16022: .getInteger(DataDictionary.FOREIGNKEY_CONSTRAINT),
16023: getContextManager());
16024: }
16025: } else if (getToken(2).kind == UNIQUE) {
16026: jj_consume_token(DROP);
16027: jj_consume_token(UNIQUE);
16028: constraintName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
16029: {
16030: if (true)
16031: return (TableElementNode) nodeFactory
16032: .getNode(
16033: C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
16034: constraintName,
16035: ReuseFactory
16036: .getInteger(DataDictionary.DROP_CONSTRAINT),
16037: null,
16038: null,
16039: null,
16040: null,
16041: ReuseFactory
16042: .getInteger(StatementType.DROP_DEFAULT),
16043: ReuseFactory
16044: .getInteger(DataDictionary.UNIQUE_CONSTRAINT),
16045: getContextManager());
16046: }
16047: } else {
16048: switch (jj_nt.kind) {
16049: case DROP:
16050: jj_consume_token(DROP);
16051: jj_consume_token(CHECK);
16052: constraintName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
16053: {
16054: if (true)
16055: return (TableElementNode) nodeFactory
16056: .getNode(
16057: C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
16058: constraintName,
16059: ReuseFactory
16060: .getInteger(DataDictionary.DROP_CONSTRAINT),
16061: null,
16062: null,
16063: null,
16064: null,
16065: ReuseFactory
16066: .getInteger(StatementType.DROP_DEFAULT),
16067: ReuseFactory
16068: .getInteger(DataDictionary.CHECK_CONSTRAINT),
16069: getContextManager());
16070: }
16071: break;
16072: default:
16073: jj_la1[284] = jj_gen;
16074: jj_consume_token(-1);
16075: throw new ParseException();
16076: }
16077: }
16078: throw new Error("Missing return statement in function");
16079: }
16080:
16081: /*
16082: * <A NAME="dropTableStatement">dropTableStatement</A>
16083: */
16084: final public QueryTreeNode dropTableStatement()
16085: throws ParseException, StandardException {
16086: TableName tableName;
16087: jj_consume_token(TABLE);
16088: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
16089: // DB2 does not support a drop behaviour
16090: {
16091: if (true)
16092: return (QueryTreeNode) nodeFactory.getNode(
16093: C_NodeTypes.DROP_TABLE_NODE, tableName,
16094: new Integer(StatementType.DROP_DEFAULT),
16095: getContextManager());
16096: }
16097: throw new Error("Missing return statement in function");
16098: }
16099:
16100: /*
16101: * <A NAME="dropIndexStatement">dropIndexStatement</A>
16102: */
16103: final public QueryTreeNode dropIndexStatement()
16104: throws ParseException, StandardException {
16105: TableName indexName;
16106: jj_consume_token(INDEX);
16107: indexName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
16108: {
16109: if (true)
16110: return (QueryTreeNode) nodeFactory.getNode(
16111: C_NodeTypes.DROP_INDEX_NODE, indexName,
16112: getContextManager());
16113: }
16114: throw new Error("Missing return statement in function");
16115: }
16116:
16117: /*
16118: * <A NAME="dropAliasStatement">dropAliasStatement</A>
16119: */
16120: final public QueryTreeNode dropAliasStatement()
16121: throws ParseException, StandardException {
16122: Object aliasName;
16123: switch (jj_nt.kind) {
16124: case PROCEDURE:
16125: jj_consume_token(PROCEDURE);
16126: aliasName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
16127: {
16128: if (true)
16129: return dropAliasNode(aliasName,
16130: AliasInfo.ALIAS_TYPE_PROCEDURE_AS_CHAR);
16131: }
16132: break;
16133: case FUNCTION:
16134: jj_consume_token(FUNCTION);
16135: aliasName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
16136: {
16137: if (true)
16138: return dropAliasNode(aliasName,
16139: AliasInfo.ALIAS_TYPE_FUNCTION_AS_CHAR);
16140: }
16141: break;
16142: case SYNONYM:
16143: jj_consume_token(SYNONYM);
16144: aliasName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
16145: checkVersion(DataDictionary.DD_VERSION_DERBY_10_1,
16146: "DROP SYNONYM");
16147:
16148: {
16149: if (true)
16150: return dropAliasNode(aliasName,
16151: AliasInfo.ALIAS_TYPE_SYNONYM_AS_CHAR);
16152: }
16153: break;
16154: default:
16155: jj_la1[285] = jj_gen;
16156: jj_consume_token(-1);
16157: throw new ParseException();
16158: }
16159: throw new Error("Missing return statement in function");
16160: }
16161:
16162: final public QueryTreeNode dropViewStatement()
16163: throws ParseException, StandardException {
16164: TableName viewName;
16165: jj_consume_token(VIEW);
16166: viewName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
16167: {
16168: if (true)
16169: return (QueryTreeNode) nodeFactory.getNode(
16170: C_NodeTypes.DROP_VIEW_NODE, viewName,
16171: getContextManager());
16172: }
16173: throw new Error("Missing return statement in function");
16174: }
16175:
16176: final public QueryTreeNode dropTriggerStatement()
16177: throws ParseException, StandardException {
16178: TableName triggerName;
16179: jj_consume_token(TRIGGER);
16180: triggerName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
16181: {
16182: if (true)
16183: return (QueryTreeNode) nodeFactory.getNode(
16184: C_NodeTypes.DROP_TRIGGER_NODE, triggerName,
16185: getContextManager());
16186: }
16187: throw new Error("Missing return statement in function");
16188: }
16189:
16190: final public QueryTreeNode truncateTableStatement()
16191: throws ParseException, StandardException {
16192: TableName tableName;
16193: jj_consume_token(TRUNCATE);
16194: jj_consume_token(TABLE);
16195: tableName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
16196: {
16197: if (true)
16198: return (QueryTreeNode) nodeFactory.getNode(
16199: C_NodeTypes.ALTER_TABLE_NODE, tableName,
16200: getContextManager());
16201: }
16202: throw new Error("Missing return statement in function");
16203: }
16204:
16205: /*
16206: * <A NAME="grantStatement">grantStatement</A>
16207: */
16208: final public QueryTreeNode grantStatement() throws ParseException,
16209: StandardException {
16210: QueryTreeNode node;
16211: jj_consume_token(GRANT);
16212: checkVersion(DataDictionary.DD_VERSION_DERBY_10_2, "GRANT");
16213: checkSqlStandardAccess("GRANT");
16214: switch (jj_nt.kind) {
16215: case ALL:
16216: case DELETE:
16217: case INSERT:
16218: case REFERENCES:
16219: case SELECT:
16220: case UPDATE:
16221: case TRIGGER:
16222: node = tableGrantStatement();
16223: break;
16224: case EXECUTE:
16225: node = routineGrantStatement();
16226: break;
16227: default:
16228: jj_la1[286] = jj_gen;
16229: jj_consume_token(-1);
16230: throw new ParseException();
16231: }
16232: {
16233: if (true)
16234: return node;
16235: }
16236: throw new Error("Missing return statement in function");
16237: }
16238:
16239: /*
16240: * <A NAME="tableGrantStatement">tableGrantStatement</A>
16241: */
16242: final public QueryTreeNode tableGrantStatement()
16243: throws ParseException, StandardException {
16244: PrivilegeNode privileges = null;
16245: List grantees;
16246: privileges = tablePrivileges();
16247: jj_consume_token(TO);
16248: grantees = granteeList();
16249: {
16250: if (true)
16251: return nodeFactory.getNode(C_NodeTypes.GRANT_NODE,
16252: privileges, grantees, getContextManager());
16253: }
16254: throw new Error("Missing return statement in function");
16255: }
16256:
16257: // end of tableGrantStatement
16258:
16259: /*
16260: * <A NAME="tablePrivileges">tablePrivileges</A>
16261: */
16262: final public PrivilegeNode tablePrivileges() throws ParseException,
16263: StandardException {
16264: TablePrivilegesNode tablePrivilegesNode = null;
16265: TableName objectName = null;
16266: tablePrivilegesNode = tableActions();
16267: jj_consume_token(ON);
16268: switch (jj_nt.kind) {
16269: case TABLE:
16270: jj_consume_token(TABLE);
16271: break;
16272: default:
16273: jj_la1[287] = jj_gen;
16274: ;
16275: }
16276: objectName = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
16277: {
16278: if (true)
16279: return (PrivilegeNode) nodeFactory
16280: .getNode(
16281: C_NodeTypes.PRIVILEGE_NODE,
16282: ReuseFactory
16283: .getInteger(PrivilegeNode.TABLE_PRIVILEGES),
16284: objectName, tablePrivilegesNode,
16285: getContextManager());
16286: }
16287: throw new Error("Missing return statement in function");
16288: }
16289:
16290: // end of tablePrivilege
16291:
16292: /*
16293: * <A NAME="tableActions">tableActions</A>
16294: */
16295: final public TablePrivilegesNode tableActions()
16296: throws ParseException, StandardException {
16297: TablePrivilegesNode tableActionsNode = (TablePrivilegesNode) nodeFactory
16298: .getNode(C_NodeTypes.TABLE_PRIVILEGES_NODE,
16299: getContextManager());
16300: switch (jj_nt.kind) {
16301: case ALL:
16302: jj_consume_token(ALL);
16303: jj_consume_token(PRIVILEGES);
16304: tableActionsNode.addAll();
16305: {
16306: if (true)
16307: return tableActionsNode;
16308: }
16309: break;
16310: case DELETE:
16311: case INSERT:
16312: case REFERENCES:
16313: case SELECT:
16314: case UPDATE:
16315: case TRIGGER:
16316: tableAction(tableActionsNode);
16317: label_40: while (true) {
16318: switch (jj_nt.kind) {
16319: case COMMA:
16320: ;
16321: break;
16322: default:
16323: jj_la1[288] = jj_gen;
16324: break label_40;
16325: }
16326: jj_consume_token(COMMA);
16327: tableAction(tableActionsNode);
16328: }
16329: {
16330: if (true)
16331: return tableActionsNode;
16332: }
16333: break;
16334: default:
16335: jj_la1[289] = jj_gen;
16336: jj_consume_token(-1);
16337: throw new ParseException();
16338: }
16339: throw new Error("Missing return statement in function");
16340: }
16341:
16342: // end of tableActions
16343:
16344: /*
16345: * <A NAME="routineGrantStatement">routineGrantStatement</A>
16346: */
16347: final public QueryTreeNode routineGrantStatement()
16348: throws ParseException, StandardException {
16349: List grantees;
16350: RoutineDesignator routine = null;
16351: jj_consume_token(EXECUTE);
16352: jj_consume_token(ON);
16353: routine = routineDesignator();
16354: jj_consume_token(TO);
16355: grantees = granteeList();
16356: PrivilegeNode routinePrivilege = (PrivilegeNode) nodeFactory
16357: .getNode(C_NodeTypes.PRIVILEGE_NODE, ReuseFactory
16358: .getInteger(PrivilegeNode.ROUTINE_PRIVILEGES),
16359: routine, null, getContextManager());
16360: {
16361: if (true)
16362: return nodeFactory
16363: .getNode(C_NodeTypes.GRANT_NODE,
16364: routinePrivilege, grantees,
16365: getContextManager());
16366: }
16367: throw new Error("Missing return statement in function");
16368: }
16369:
16370: // end of routineGrantStatement
16371:
16372: /*
16373: * <A NAME="routineAlias">routineAlias</A>
16374: */
16375: final public RoutineDesignator routineDesignator()
16376: throws ParseException, StandardException {
16377: Token procOrFunction;
16378: RoutineDesignator routine = null;
16379: TableName name = null;
16380: List paramTypeList = null;
16381: switch (jj_nt.kind) {
16382: case FUNCTION:
16383: procOrFunction = jj_consume_token(FUNCTION);
16384: break;
16385: case PROCEDURE:
16386: procOrFunction = jj_consume_token(PROCEDURE);
16387: break;
16388: default:
16389: jj_la1[290] = jj_gen;
16390: jj_consume_token(-1);
16391: throw new ParseException();
16392: }
16393: name = qualifiedName(Limits.MAX_IDENTIFIER_LENGTH);
16394: switch (jj_nt.kind) {
16395: case LEFT_PAREN:
16396: jj_consume_token(LEFT_PAREN);
16397: paramTypeList = parameterTypeList();
16398: jj_consume_token(RIGHT_PAREN);
16399: break;
16400: default:
16401: jj_la1[291] = jj_gen;
16402: ;
16403: }
16404: {
16405: if (true)
16406: return new RoutineDesignator(false, name,
16407: (procOrFunction.kind == FUNCTION),
16408: paramTypeList);
16409: }
16410: throw new Error("Missing return statement in function");
16411: }
16412:
16413: // end of routineDesignator
16414:
16415: /*
16416: * <A NAME="parameterTypeList">parameterTypeList</A>
16417: */
16418: final public List parameterTypeList() throws ParseException,
16419: StandardException {
16420: ArrayList list = new ArrayList();
16421: DataTypeDescriptor dtd;
16422: if (jj_2_47(1)) {
16423: dtd = dataTypeCommon();
16424: list.add(dtd);
16425: label_41: while (true) {
16426: switch (jj_nt.kind) {
16427: case COMMA:
16428: ;
16429: break;
16430: default:
16431: jj_la1[292] = jj_gen;
16432: break label_41;
16433: }
16434: jj_consume_token(COMMA);
16435: dtd = dataTypeCommon();
16436: list.add(dtd);
16437: }
16438: } else {
16439: ;
16440: }
16441: {
16442: if (true)
16443: return list;
16444: }
16445: throw new Error("Missing return statement in function");
16446: }
16447:
16448: // end of parameterTypeList
16449:
16450: /*
16451: * <A NAME="tableAction">tableAction</A>
16452: */
16453: final public void tableAction(
16454: TablePrivilegesNode tablePrivilegesNode)
16455: throws ParseException, StandardException {
16456: ResultColumnList columnList = null;
16457: switch (jj_nt.kind) {
16458: case SELECT:
16459: jj_consume_token(SELECT);
16460: switch (jj_nt.kind) {
16461: case LEFT_PAREN:
16462: columnList = privilegeColumnList();
16463: break;
16464: default:
16465: jj_la1[293] = jj_gen;
16466: ;
16467: }
16468: tablePrivilegesNode.addAction(
16469: TablePrivilegeInfo.SELECT_ACTION, columnList);
16470: break;
16471: case DELETE:
16472: jj_consume_token(DELETE);
16473: tablePrivilegesNode.addAction(
16474: TablePrivilegeInfo.DELETE_ACTION,
16475: (ResultColumnList) null);
16476: break;
16477: case INSERT:
16478: jj_consume_token(INSERT);
16479: tablePrivilegesNode.addAction(
16480: TablePrivilegeInfo.INSERT_ACTION,
16481: (ResultColumnList) null);
16482: break;
16483: case UPDATE:
16484: jj_consume_token(UPDATE);
16485: switch (jj_nt.kind) {
16486: case LEFT_PAREN:
16487: columnList = privilegeColumnList();
16488: break;
16489: default:
16490: jj_la1[294] = jj_gen;
16491: ;
16492: }
16493: tablePrivilegesNode.addAction(
16494: TablePrivilegeInfo.UPDATE_ACTION, columnList);
16495: break;
16496: case REFERENCES:
16497: jj_consume_token(REFERENCES);
16498: switch (jj_nt.kind) {
16499: case LEFT_PAREN:
16500: columnList = privilegeColumnList();
16501: break;
16502: default:
16503: jj_la1[295] = jj_gen;
16504: ;
16505: }
16506: tablePrivilegesNode.addAction(
16507: TablePrivilegeInfo.REFERENCES_ACTION, columnList);
16508: break;
16509: case TRIGGER:
16510: jj_consume_token(TRIGGER);
16511: tablePrivilegesNode.addAction(
16512: TablePrivilegeInfo.TRIGGER_ACTION,
16513: (ResultColumnList) null);
16514: break;
16515: default:
16516: jj_la1[296] = jj_gen;
16517: jj_consume_token(-1);
16518: throw new ParseException();
16519: }
16520: }
16521:
16522: // end of tableAction
16523:
16524: /*
16525: * <A NAME="privilegeColumnList">privilegeColumnList</A>
16526: */
16527: final public ResultColumnList privilegeColumnList()
16528: throws ParseException, StandardException {
16529: ResultColumnList cl = (ResultColumnList) nodeFactory.getNode(
16530: C_NodeTypes.RESULT_COLUMN_LIST, getContextManager());
16531: jj_consume_token(LEFT_PAREN);
16532: columnNameList(cl);
16533: jj_consume_token(RIGHT_PAREN);
16534: {
16535: if (true)
16536: return cl;
16537: }
16538: throw new Error("Missing return statement in function");
16539: }
16540:
16541: // end of privilegeColumnList
16542:
16543: /*
16544: * <A NAME="granteeList">granteeList</A>
16545: */
16546: final public List granteeList() throws ParseException,
16547: StandardException {
16548: ArrayList list = new ArrayList();
16549: grantee(list);
16550: label_42: while (true) {
16551: switch (jj_nt.kind) {
16552: case COMMA:
16553: ;
16554: break;
16555: default:
16556: jj_la1[297] = jj_gen;
16557: break label_42;
16558: }
16559: jj_consume_token(COMMA);
16560: grantee(list);
16561: }
16562: {
16563: if (true)
16564: return list;
16565: }
16566: throw new Error("Missing return statement in function");
16567: }
16568:
16569: final public void grantee(List list) throws ParseException,
16570: StandardException {
16571: String str;
16572: switch (jj_nt.kind) {
16573: case BINARY:
16574: case COALESCE:
16575: case COUNT:
16576: case D:
16577: case MODULE:
16578: case T:
16579: case TS:
16580: case VALUE:
16581: case VARBINARY:
16582: case ABS:
16583: case ABSVAL:
16584: case ACTION:
16585: case ALWAYS:
16586: case BLOB:
16587: case C:
16588: case CALLED:
16589: case CLOB:
16590: case COBOL:
16591: case COMMITTED:
16592: case CONCAT:
16593: case CONTAINS:
16594: case DATA:
16595: case DATE:
16596: case DAY:
16597: case DYNAMIC:
16598: case FORTRAN:
16599: case GENERATED:
16600: case IDENTITY_VAL_LOCAL:
16601: case INCREMENT:
16602: case INITIAL:
16603: case INTERVAL:
16604: case LANGUAGE:
16605: case LARGE:
16606: case LENGTH:
16607: case LEVEL:
16608: case LOCKS:
16609: case LOCKSIZE:
16610: case LOGGED:
16611: case MOD:
16612: case MODIFIES:
16613: case MODIFY:
16614: case MONTH:
16615: case _MORE:
16616: case MUMPS:
16617: case NAME:
16618: case NCLOB:
16619: case NULLABLE:
16620: case NUMBER:
16621: case OBJECT:
16622: case PASCAL:
16623: case PLI:
16624: case PRECISION:
16625: case RELEASE:
16626: case REPEATABLE:
16627: case RESTART:
16628: case RETURNS:
16629: case ROW:
16630: case SAVEPOINT:
16631: case SCALE:
16632: case SERIALIZABLE:
16633: case SQL_TSI_FRAC_SECOND:
16634: case SQL_TSI_SECOND:
16635: case SQL_TSI_MINUTE:
16636: case SQL_TSI_HOUR:
16637: case SQL_TSI_DAY:
16638: case SQL_TSI_WEEK:
16639: case SQL_TSI_MONTH:
16640: case SQL_TSI_QUARTER:
16641: case SQL_TSI_YEAR:
16642: case START:
16643: case STATEMENT:
16644: case SYNONYM:
16645: case THEN:
16646: case TIME:
16647: case TIMESTAMP:
16648: case TIMESTAMPADD:
16649: case TIMESTAMPDIFF:
16650: case TRUNCATE:
16651: case TYPE:
16652: case UNCOMMITTED:
16653: case USAGE:
16654: case WHEN:
16655: case CURDATE:
16656: case CURTIME:
16657: case DATABASE:
16658: case LONG:
16659: case AFTER:
16660: case BEFORE:
16661: case CLASS:
16662: case COMPRESS:
16663: case CONTENT:
16664: case CS:
16665: case DB2SQL:
16666: case DIRTY:
16667: case DOCUMENT:
16668: case EACH:
16669: case EMPTY:
16670: case EXCLUSIVE:
16671: case FN:
16672: case INDEX:
16673: case JAVA:
16674: case LCASE:
16675: case LOCATE:
16676: case LOCK:
16677: case MESSAGE_LOCALE:
16678: case METHOD:
16679: case MODE:
16680: case NEW:
16681: case NEW_TABLE:
16682: case OJ:
16683: case OFF:
16684: case OLD:
16685: case OLD_TABLE:
16686: case PARAMETER:
16687: case PASSING:
16688: case PROPERTIES:
16689: case READS:
16690: case REF:
16691: case REFERENCING:
16692: case RENAME:
16693: case RESET:
16694: case RESULT:
16695: case RETAIN:
16696: case RETURNING:
16697: case RR:
16698: case RS:
16699: case SEQUENCE:
16700: case SEQUENTIAL:
16701: case SETS:
16702: case SHARE:
16703: case SQLID:
16704: case SPECIFIC:
16705: case SQRT:
16706: case STABILITY:
16707: case STRIP:
16708: case STYLE:
16709: case TRIGGER:
16710: case UCASE:
16711: case UR:
16712: case WHITESPACE:
16713: case IDENTIFIER:
16714: case DELIMITED_IDENTIFIER:
16715: str = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
16716: checkAuthorizationLength(str);
16717: list.add(str);
16718: break;
16719: case PUBLIC:
16720: jj_consume_token(PUBLIC);
16721: list.add(Authorizer.PUBLIC_AUTHORIZATION_ID);
16722: break;
16723: default:
16724: jj_la1[298] = jj_gen;
16725: jj_consume_token(-1);
16726: throw new ParseException();
16727: }
16728: }
16729:
16730: /*
16731: * <A NAME="revokeStatement">revokeStatement</A>
16732: */
16733: final public QueryTreeNode revokeStatement() throws ParseException,
16734: StandardException {
16735: QueryTreeNode node;
16736: jj_consume_token(REVOKE);
16737: checkVersion(DataDictionary.DD_VERSION_DERBY_10_2, "REVOKE");
16738: checkSqlStandardAccess("REVOKE");
16739: switch (jj_nt.kind) {
16740: case ALL:
16741: case DELETE:
16742: case INSERT:
16743: case REFERENCES:
16744: case SELECT:
16745: case UPDATE:
16746: case TRIGGER:
16747: node = tableRevokeStatement();
16748: break;
16749: case EXECUTE:
16750: node = routineRevokeStatement();
16751: break;
16752: default:
16753: jj_la1[299] = jj_gen;
16754: jj_consume_token(-1);
16755: throw new ParseException();
16756: }
16757: {
16758: if (true)
16759: return node;
16760: }
16761: throw new Error("Missing return statement in function");
16762: }
16763:
16764: /*
16765: * <A NAME="tableRevokeStatement">tableRevokeStatement</A>
16766: */
16767: final public QueryTreeNode tableRevokeStatement()
16768: throws ParseException, StandardException {
16769: PrivilegeNode privileges = null;
16770: List grantees;
16771: privileges = tablePrivileges();
16772: jj_consume_token(FROM);
16773: grantees = granteeList();
16774: {
16775: if (true)
16776: return nodeFactory.getNode(C_NodeTypes.REVOKE_NODE,
16777: privileges, grantees, getContextManager());
16778: }
16779: throw new Error("Missing return statement in function");
16780: }
16781:
16782: // end of tableRevokeStatement
16783:
16784: /*
16785: * <A NAME="routineRevokeStatement">routineRevokeStatement</A>
16786: */
16787: final public QueryTreeNode routineRevokeStatement()
16788: throws ParseException, StandardException {
16789: List grantees;
16790: RoutineDesignator routine = null;
16791: jj_consume_token(EXECUTE);
16792: jj_consume_token(ON);
16793: routine = routineDesignator();
16794: jj_consume_token(FROM);
16795: grantees = granteeList();
16796: jj_consume_token(RESTRICT);
16797: PrivilegeNode routinePrivilege = (PrivilegeNode) nodeFactory
16798: .getNode(C_NodeTypes.PRIVILEGE_NODE, ReuseFactory
16799: .getInteger(PrivilegeNode.ROUTINE_PRIVILEGES),
16800: routine, null, getContextManager());
16801: {
16802: if (true)
16803: return nodeFactory
16804: .getNode(C_NodeTypes.REVOKE_NODE,
16805: routinePrivilege, grantees,
16806: getContextManager());
16807: }
16808: throw new Error("Missing return statement in function");
16809: }
16810:
16811: // end of routineRevokeStatement
16812:
16813: /*
16814: * <A NAME="identifier">identifier</A>
16815: */
16816: final public String internalIdentifier(int id_length_limit,
16817: boolean useANSICasing, boolean checkLength)
16818: throws ParseException, StandardException {
16819: String str;
16820: Token tok;
16821: switch (jj_nt.kind) {
16822: case IDENTIFIER:
16823: tok = jj_consume_token(IDENTIFIER);
16824: if (useANSICasing)
16825: str = StringUtil.SQLToUpperCase(tok.image);
16826: else
16827: str = getLanguageConnectionContext()
16828: .convertIdentifierCase(tok.image);
16829: if (checkLength) {//if checkLength false, then calling method would do the length limit checks
16830: //limit the identifier to the id length limit passed to this method
16831: checkIdentifierLengthLimit(str, id_length_limit);
16832: }
16833: // Remember whether last token was a delimited identifier
16834: nextToLastTokenDelimitedIdentifier = lastTokenDelimitedIdentifier;
16835: lastTokenDelimitedIdentifier = Boolean.FALSE;
16836: nextToLastIdentifierToken = lastIdentifierToken;
16837: lastIdentifierToken = tok;
16838: {
16839: if (true)
16840: return str;
16841: }
16842: break;
16843: case DELIMITED_IDENTIFIER:
16844: str = delimitedIdentifier();
16845: if (checkLength) {//if checkLength false, then calling method would do the length limit checks
16846: //limit the identifier to the id length limit passed to this method
16847: checkIdentifierLengthLimit(str, id_length_limit);
16848: }
16849: {
16850: if (true)
16851: return str;
16852: }
16853: break;
16854: case BINARY:
16855: case COALESCE:
16856: case COUNT:
16857: case D:
16858: case MODULE:
16859: case T:
16860: case TS:
16861: case VALUE:
16862: case VARBINARY:
16863: case ABS:
16864: case ABSVAL:
16865: case ACTION:
16866: case ALWAYS:
16867: case BLOB:
16868: case C:
16869: case CALLED:
16870: case CLOB:
16871: case COBOL:
16872: case COMMITTED:
16873: case CONCAT:
16874: case CONTAINS:
16875: case DATA:
16876: case DATE:
16877: case DAY:
16878: case DYNAMIC:
16879: case FORTRAN:
16880: case GENERATED:
16881: case IDENTITY_VAL_LOCAL:
16882: case INCREMENT:
16883: case INITIAL:
16884: case INTERVAL:
16885: case LANGUAGE:
16886: case LARGE:
16887: case LENGTH:
16888: case LEVEL:
16889: case LOCKS:
16890: case LOCKSIZE:
16891: case LOGGED:
16892: case MOD:
16893: case MODIFIES:
16894: case MODIFY:
16895: case MONTH:
16896: case _MORE:
16897: case MUMPS:
16898: case NAME:
16899: case NCLOB:
16900: case NULLABLE:
16901: case NUMBER:
16902: case OBJECT:
16903: case PASCAL:
16904: case PLI:
16905: case PRECISION:
16906: case RELEASE:
16907: case REPEATABLE:
16908: case RESTART:
16909: case RETURNS:
16910: case ROW:
16911: case SAVEPOINT:
16912: case SCALE:
16913: case SERIALIZABLE:
16914: case SQL_TSI_FRAC_SECOND:
16915: case SQL_TSI_SECOND:
16916: case SQL_TSI_MINUTE:
16917: case SQL_TSI_HOUR:
16918: case SQL_TSI_DAY:
16919: case SQL_TSI_WEEK:
16920: case SQL_TSI_MONTH:
16921: case SQL_TSI_QUARTER:
16922: case SQL_TSI_YEAR:
16923: case START:
16924: case STATEMENT:
16925: case SYNONYM:
16926: case THEN:
16927: case TIME:
16928: case TIMESTAMP:
16929: case TIMESTAMPADD:
16930: case TIMESTAMPDIFF:
16931: case TRUNCATE:
16932: case TYPE:
16933: case UNCOMMITTED:
16934: case USAGE:
16935: case WHEN:
16936: case CURDATE:
16937: case CURTIME:
16938: case DATABASE:
16939: case LONG:
16940: case AFTER:
16941: case BEFORE:
16942: case CLASS:
16943: case COMPRESS:
16944: case CONTENT:
16945: case CS:
16946: case DB2SQL:
16947: case DIRTY:
16948: case DOCUMENT:
16949: case EACH:
16950: case EMPTY:
16951: case EXCLUSIVE:
16952: case FN:
16953: case INDEX:
16954: case JAVA:
16955: case LCASE:
16956: case LOCATE:
16957: case LOCK:
16958: case MESSAGE_LOCALE:
16959: case METHOD:
16960: case MODE:
16961: case NEW:
16962: case NEW_TABLE:
16963: case OJ:
16964: case OFF:
16965: case OLD:
16966: case OLD_TABLE:
16967: case PARAMETER:
16968: case PASSING:
16969: case PROPERTIES:
16970: case READS:
16971: case REF:
16972: case REFERENCING:
16973: case RENAME:
16974: case RESET:
16975: case RESULT:
16976: case RETAIN:
16977: case RETURNING:
16978: case RR:
16979: case RS:
16980: case SEQUENCE:
16981: case SEQUENTIAL:
16982: case SETS:
16983: case SHARE:
16984: case SQLID:
16985: case SPECIFIC:
16986: case SQRT:
16987: case STABILITY:
16988: case STRIP:
16989: case STYLE:
16990: case TRIGGER:
16991: case UCASE:
16992: case UR:
16993: case WHITESPACE:
16994: str = nonReservedKeyword();
16995: {
16996: if (true)
16997: return getLanguageConnectionContext()
16998: .convertIdentifierCase(str);
16999: }
17000: break;
17001: default:
17002: jj_la1[300] = jj_gen;
17003: jj_consume_token(-1);
17004: throw new ParseException();
17005: }
17006: throw new Error("Missing return statement in function");
17007: }
17008:
17009: final public String identifier(int id_length_limit,
17010: boolean checkLength) throws ParseException,
17011: StandardException {
17012: String id;
17013: id = internalIdentifier(id_length_limit, false, checkLength);
17014: {
17015: if (true)
17016: return id;
17017: }
17018: throw new Error("Missing return statement in function");
17019: }
17020:
17021: /*
17022: * <A NAME="delimitedIdentifier">delimitedIdentifier</A>
17023: */
17024: final public String delimitedIdentifier() throws ParseException {
17025: String str;
17026: Token tok;
17027: tok = jj_consume_token(DELIMITED_IDENTIFIER);
17028: str = tok.image.substring(1, tok.image.length() - 1);
17029: str = normalizeDelimitedID(str);
17030: // Remember whether last token was a delimited identifier
17031: nextToLastTokenDelimitedIdentifier = lastTokenDelimitedIdentifier;
17032: lastTokenDelimitedIdentifier = Boolean.TRUE;
17033: nextToLastIdentifierToken = lastIdentifierToken;
17034: lastIdentifierToken = tok;
17035:
17036: {
17037: if (true)
17038: return str;
17039: }
17040: throw new Error("Missing return statement in function");
17041: }
17042:
17043: /*
17044: * <A NAME="reservedKeyword">reservedKeyword</A>
17045: */
17046: final public String reservedKeyword() throws ParseException {
17047: Token tok;
17048: switch (jj_nt.kind) {
17049: case ADD:
17050: /* SQL92 reserved Keywords */
17051: tok = jj_consume_token(ADD);
17052: break;
17053: case ALL:
17054: tok = jj_consume_token(ALL);
17055: break;
17056: case ALLOCATE:
17057: tok = jj_consume_token(ALLOCATE);
17058: break;
17059: case ALTER:
17060: tok = jj_consume_token(ALTER);
17061: break;
17062: case AND:
17063: tok = jj_consume_token(AND);
17064: break;
17065: case ANY:
17066: tok = jj_consume_token(ANY);
17067: break;
17068: case ARE:
17069: tok = jj_consume_token(ARE);
17070: break;
17071: case AS:
17072: tok = jj_consume_token(AS);
17073: break;
17074: case ASC:
17075: tok = jj_consume_token(ASC);
17076: break;
17077: case ASSERTION:
17078: tok = jj_consume_token(ASSERTION);
17079: break;
17080: case AT:
17081: tok = jj_consume_token(AT);
17082: break;
17083: case AUTHORIZATION:
17084: tok = jj_consume_token(AUTHORIZATION);
17085: break;
17086: case AVG:
17087: tok = jj_consume_token(AVG);
17088: break;
17089: case BEGIN:
17090: tok = jj_consume_token(BEGIN);
17091: break;
17092: case BETWEEN:
17093: tok = jj_consume_token(BETWEEN);
17094: break;
17095: case BIT:
17096: tok = jj_consume_token(BIT);
17097: break;
17098: case BOTH:
17099: tok = jj_consume_token(BOTH);
17100: break;
17101: case BY:
17102: tok = jj_consume_token(BY);
17103: break;
17104: case CASCADE:
17105: tok = jj_consume_token(CASCADE);
17106: break;
17107: case CASCADED:
17108: tok = jj_consume_token(CASCADED);
17109: break;
17110: case CASE:
17111: tok = jj_consume_token(CASE);
17112: break;
17113: case CAST:
17114: tok = jj_consume_token(CAST);
17115: break;
17116: case CHAR:
17117: tok = jj_consume_token(CHAR);
17118: break;
17119: case CHARACTER:
17120: tok = jj_consume_token(CHARACTER);
17121: break;
17122: case CHECK:
17123: tok = jj_consume_token(CHECK);
17124: break;
17125: case CLOSE:
17126: tok = jj_consume_token(CLOSE);
17127: break;
17128: case COLLATE:
17129: tok = jj_consume_token(COLLATE);
17130: break;
17131: case COLLATION:
17132: tok = jj_consume_token(COLLATION);
17133: break;
17134: case COLUMN:
17135: tok = jj_consume_token(COLUMN);
17136: break;
17137: case COMMIT:
17138: tok = jj_consume_token(COMMIT);
17139: break;
17140: case CONNECT:
17141: tok = jj_consume_token(CONNECT);
17142: break;
17143: case CONNECTION:
17144: tok = jj_consume_token(CONNECTION);
17145: break;
17146: case CONSTRAINT:
17147: tok = jj_consume_token(CONSTRAINT);
17148: break;
17149: case CONSTRAINTS:
17150: tok = jj_consume_token(CONSTRAINTS);
17151: break;
17152: case CONTINUE:
17153: tok = jj_consume_token(CONTINUE);
17154: break;
17155: case CONVERT:
17156: tok = jj_consume_token(CONVERT);
17157: break;
17158: case CORRESPONDING:
17159: tok = jj_consume_token(CORRESPONDING);
17160: break;
17161: case CREATE:
17162: tok = jj_consume_token(CREATE);
17163: break;
17164: case CURRENT:
17165: tok = jj_consume_token(CURRENT);
17166: break;
17167: case CURRENT_DATE:
17168: tok = jj_consume_token(CURRENT_DATE);
17169: break;
17170: case CURRENT_TIME:
17171: tok = jj_consume_token(CURRENT_TIME);
17172: break;
17173: case CURRENT_TIMESTAMP:
17174: tok = jj_consume_token(CURRENT_TIMESTAMP);
17175: break;
17176: case CURRENT_USER:
17177: tok = jj_consume_token(CURRENT_USER);
17178: break;
17179: case CURSOR:
17180: tok = jj_consume_token(CURSOR);
17181: break;
17182: case DEALLOCATE:
17183: tok = jj_consume_token(DEALLOCATE);
17184: break;
17185: case DEC:
17186: tok = jj_consume_token(DEC);
17187: break;
17188: case DECIMAL:
17189: tok = jj_consume_token(DECIMAL);
17190: break;
17191: case DECLARE:
17192: tok = jj_consume_token(DECLARE);
17193: break;
17194: case _DEFAULT:
17195: tok = jj_consume_token(_DEFAULT);
17196: break;
17197: case DEFERRABLE:
17198: tok = jj_consume_token(DEFERRABLE);
17199: break;
17200: case DEFERRED:
17201: tok = jj_consume_token(DEFERRED);
17202: break;
17203: case DELETE:
17204: tok = jj_consume_token(DELETE);
17205: break;
17206: case DESC:
17207: tok = jj_consume_token(DESC);
17208: break;
17209: case DESCRIBE:
17210: tok = jj_consume_token(DESCRIBE);
17211: break;
17212: case DIAGNOSTICS:
17213: tok = jj_consume_token(DIAGNOSTICS);
17214: break;
17215: case DISCONNECT:
17216: tok = jj_consume_token(DISCONNECT);
17217: break;
17218: case DISTINCT:
17219: tok = jj_consume_token(DISTINCT);
17220: break;
17221: case DOUBLE:
17222: tok = jj_consume_token(DOUBLE);
17223: break;
17224: case DROP:
17225: tok = jj_consume_token(DROP);
17226: break;
17227: case ELSE:
17228: tok = jj_consume_token(ELSE);
17229: break;
17230: case END:
17231: tok = jj_consume_token(END);
17232: break;
17233: case ENDEXEC:
17234: tok = jj_consume_token(ENDEXEC);
17235: break;
17236: case ESCAPE:
17237: tok = jj_consume_token(ESCAPE);
17238: break;
17239: case EXCEPT:
17240: tok = jj_consume_token(EXCEPT);
17241: break;
17242: case EXCEPTION:
17243: tok = jj_consume_token(EXCEPTION);
17244: break;
17245: case EXEC:
17246: tok = jj_consume_token(EXEC);
17247: break;
17248: case EXECUTE:
17249: tok = jj_consume_token(EXECUTE);
17250: break;
17251: case EXISTS:
17252: tok = jj_consume_token(EXISTS);
17253: break;
17254: case EXTERNAL:
17255: tok = jj_consume_token(EXTERNAL);
17256: break;
17257: case FALSE:
17258: tok = jj_consume_token(FALSE);
17259: break;
17260: case FETCH:
17261: tok = jj_consume_token(FETCH);
17262: break;
17263: case FIRST:
17264: tok = jj_consume_token(FIRST);
17265: break;
17266: case FLOAT:
17267: tok = jj_consume_token(FLOAT);
17268: break;
17269: case FOR:
17270: tok = jj_consume_token(FOR);
17271: break;
17272: case FOREIGN:
17273: tok = jj_consume_token(FOREIGN);
17274: break;
17275: case FOUND:
17276: tok = jj_consume_token(FOUND);
17277: break;
17278: case FROM:
17279: tok = jj_consume_token(FROM);
17280: break;
17281: case FULL:
17282: tok = jj_consume_token(FULL);
17283: break;
17284: case FUNCTION:
17285: tok = jj_consume_token(FUNCTION);
17286: break;
17287: case GET:
17288: tok = jj_consume_token(GET);
17289: break;
17290: case GET_CURRENT_CONNECTION:
17291: tok = jj_consume_token(GET_CURRENT_CONNECTION);
17292: break;
17293: case GLOBAL:
17294: tok = jj_consume_token(GLOBAL);
17295: break;
17296: case GO:
17297: tok = jj_consume_token(GO);
17298: break;
17299: case GOTO:
17300: tok = jj_consume_token(GOTO);
17301: break;
17302: case GRANT:
17303: tok = jj_consume_token(GRANT);
17304: break;
17305: case GROUP:
17306: tok = jj_consume_token(GROUP);
17307: break;
17308: case HAVING:
17309: tok = jj_consume_token(HAVING);
17310: break;
17311: case HOUR:
17312: tok = jj_consume_token(HOUR);
17313: break;
17314: case IDENTITY:
17315: tok = jj_consume_token(IDENTITY);
17316: break;
17317: case IMMEDIATE:
17318: tok = jj_consume_token(IMMEDIATE);
17319: break;
17320: case IN:
17321: tok = jj_consume_token(IN);
17322: break;
17323: case INDICATOR:
17324: tok = jj_consume_token(INDICATOR);
17325: break;
17326: case INITIALLY:
17327: tok = jj_consume_token(INITIALLY);
17328: break;
17329: case INNER:
17330: tok = jj_consume_token(INNER);
17331: break;
17332: case INOUT:
17333: tok = jj_consume_token(INOUT);
17334: break;
17335: case INPUT:
17336: tok = jj_consume_token(INPUT);
17337: break;
17338: case INSENSITIVE:
17339: tok = jj_consume_token(INSENSITIVE);
17340: break;
17341: case INSERT:
17342: tok = jj_consume_token(INSERT);
17343: break;
17344: case INT:
17345: tok = jj_consume_token(INT);
17346: break;
17347: case INTEGER:
17348: tok = jj_consume_token(INTEGER);
17349: break;
17350: case INTERSECT:
17351: tok = jj_consume_token(INTERSECT);
17352: break;
17353: case INTO:
17354: tok = jj_consume_token(INTO);
17355: break;
17356: case IS:
17357: tok = jj_consume_token(IS);
17358: break;
17359: case ISOLATION:
17360: tok = jj_consume_token(ISOLATION);
17361: break;
17362: case JOIN:
17363: tok = jj_consume_token(JOIN);
17364: break;
17365: case KEY:
17366: tok = jj_consume_token(KEY);
17367: break;
17368: case LAST:
17369: tok = jj_consume_token(LAST);
17370: break;
17371: case LEFT:
17372: tok = jj_consume_token(LEFT);
17373: break;
17374: case LIKE:
17375: tok = jj_consume_token(LIKE);
17376: break;
17377: case LOWER:
17378: tok = jj_consume_token(LOWER);
17379: break;
17380: case MATCH:
17381: tok = jj_consume_token(MATCH);
17382: break;
17383: case MAX:
17384: tok = jj_consume_token(MAX);
17385: break;
17386: case MIN:
17387: tok = jj_consume_token(MIN);
17388: break;
17389: case MINUTE:
17390: tok = jj_consume_token(MINUTE);
17391: break;
17392: case NATIONAL:
17393: tok = jj_consume_token(NATIONAL);
17394: break;
17395: case NATURAL:
17396: tok = jj_consume_token(NATURAL);
17397: break;
17398: case NCHAR:
17399: tok = jj_consume_token(NCHAR);
17400: break;
17401: case NVARCHAR:
17402: tok = jj_consume_token(NVARCHAR);
17403: break;
17404: case NEXT:
17405: tok = jj_consume_token(NEXT);
17406: break;
17407: case NO:
17408: tok = jj_consume_token(NO);
17409: break;
17410: case NOT:
17411: tok = jj_consume_token(NOT);
17412: break;
17413: case NULL:
17414: tok = jj_consume_token(NULL);
17415: break;
17416: case NULLIF:
17417: tok = jj_consume_token(NULLIF);
17418: break;
17419: case NUMERIC:
17420: tok = jj_consume_token(NUMERIC);
17421: break;
17422: case OF:
17423: tok = jj_consume_token(OF);
17424: break;
17425: case ON:
17426: tok = jj_consume_token(ON);
17427: break;
17428: case ONLY:
17429: tok = jj_consume_token(ONLY);
17430: break;
17431: case OPEN:
17432: tok = jj_consume_token(OPEN);
17433: break;
17434: case OPTION:
17435: tok = jj_consume_token(OPTION);
17436: break;
17437: case OR:
17438: tok = jj_consume_token(OR);
17439: break;
17440: case ORDER:
17441: tok = jj_consume_token(ORDER);
17442: break;
17443: case OUT:
17444: tok = jj_consume_token(OUT);
17445: break;
17446: case OUTER:
17447: tok = jj_consume_token(OUTER);
17448: break;
17449: case OUTPUT:
17450: tok = jj_consume_token(OUTPUT);
17451: break;
17452: case OVERLAPS:
17453: tok = jj_consume_token(OVERLAPS);
17454: break;
17455: case PAD:
17456: tok = jj_consume_token(PAD);
17457: break;
17458: case PARTIAL:
17459: tok = jj_consume_token(PARTIAL);
17460: break;
17461: case PREPARE:
17462: tok = jj_consume_token(PREPARE);
17463: break;
17464: case PRESERVE:
17465: tok = jj_consume_token(PRESERVE);
17466: break;
17467: case PRIMARY:
17468: tok = jj_consume_token(PRIMARY);
17469: break;
17470: case PRIOR:
17471: tok = jj_consume_token(PRIOR);
17472: break;
17473: case PRIVILEGES:
17474: tok = jj_consume_token(PRIVILEGES);
17475: break;
17476: case PROCEDURE:
17477: tok = jj_consume_token(PROCEDURE);
17478: break;
17479: case PUBLIC:
17480: tok = jj_consume_token(PUBLIC);
17481: break;
17482: case READ:
17483: tok = jj_consume_token(READ);
17484: break;
17485: case REAL:
17486: tok = jj_consume_token(REAL);
17487: break;
17488: case REFERENCES:
17489: tok = jj_consume_token(REFERENCES);
17490: break;
17491: case RELATIVE:
17492: tok = jj_consume_token(RELATIVE);
17493: break;
17494: case RESTRICT:
17495: tok = jj_consume_token(RESTRICT);
17496: break;
17497: case REVOKE:
17498: tok = jj_consume_token(REVOKE);
17499: break;
17500: case RIGHT:
17501: tok = jj_consume_token(RIGHT);
17502: break;
17503: case ROLLBACK:
17504: tok = jj_consume_token(ROLLBACK);
17505: break;
17506: case ROWS:
17507: tok = jj_consume_token(ROWS);
17508: break;
17509: case SCHEMA:
17510: tok = jj_consume_token(SCHEMA);
17511: break;
17512: case SCROLL:
17513: tok = jj_consume_token(SCROLL);
17514: break;
17515: case SECOND:
17516: tok = jj_consume_token(SECOND);
17517: break;
17518: case SELECT:
17519: tok = jj_consume_token(SELECT);
17520: break;
17521: case SESSION_USER:
17522: tok = jj_consume_token(SESSION_USER);
17523: break;
17524: case SET:
17525: tok = jj_consume_token(SET);
17526: break;
17527: case SMALLINT:
17528: tok = jj_consume_token(SMALLINT);
17529: break;
17530: case SOME:
17531: tok = jj_consume_token(SOME);
17532: break;
17533: case SPACE:
17534: tok = jj_consume_token(SPACE);
17535: break;
17536: case SQL:
17537: tok = jj_consume_token(SQL);
17538: break;
17539: case SQLCODE:
17540: tok = jj_consume_token(SQLCODE);
17541: break;
17542: case SQLERROR:
17543: tok = jj_consume_token(SQLERROR);
17544: break;
17545: case SQLSTATE:
17546: tok = jj_consume_token(SQLSTATE);
17547: break;
17548: case SUBSTRING:
17549: tok = jj_consume_token(SUBSTRING);
17550: break;
17551: case SUM:
17552: tok = jj_consume_token(SUM);
17553: break;
17554: case SYSTEM_USER:
17555: tok = jj_consume_token(SYSTEM_USER);
17556: break;
17557: case TABLE:
17558: tok = jj_consume_token(TABLE);
17559: break;
17560: case TEMPORARY:
17561: tok = jj_consume_token(TEMPORARY);
17562: break;
17563: case TIMEZONE_HOUR:
17564: tok = jj_consume_token(TIMEZONE_HOUR);
17565: break;
17566: case TIMEZONE_MINUTE:
17567: tok = jj_consume_token(TIMEZONE_MINUTE);
17568: break;
17569: case TO:
17570: tok = jj_consume_token(TO);
17571: break;
17572: case TRANSACTION:
17573: tok = jj_consume_token(TRANSACTION);
17574: break;
17575: case TRANSLATE:
17576: tok = jj_consume_token(TRANSLATE);
17577: break;
17578: case TRANSLATION:
17579: tok = jj_consume_token(TRANSLATION);
17580: break;
17581: case TRUE:
17582: tok = jj_consume_token(TRUE);
17583: break;
17584: case UNION:
17585: tok = jj_consume_token(UNION);
17586: break;
17587: case UNIQUE:
17588: tok = jj_consume_token(UNIQUE);
17589: break;
17590: case UNKNOWN:
17591: tok = jj_consume_token(UNKNOWN);
17592: break;
17593: case UPDATE:
17594: tok = jj_consume_token(UPDATE);
17595: break;
17596: case UPPER:
17597: tok = jj_consume_token(UPPER);
17598: break;
17599: case USER:
17600: tok = jj_consume_token(USER);
17601: break;
17602: case USING:
17603: tok = jj_consume_token(USING);
17604: break;
17605: case VALUES:
17606: tok = jj_consume_token(VALUES);
17607: break;
17608: case VARCHAR:
17609: tok = jj_consume_token(VARCHAR);
17610: break;
17611: case VARYING:
17612: tok = jj_consume_token(VARYING);
17613: break;
17614: case VIEW:
17615: tok = jj_consume_token(VIEW);
17616: break;
17617: case WHENEVER:
17618: tok = jj_consume_token(WHENEVER);
17619: break;
17620: case WHERE:
17621: tok = jj_consume_token(WHERE);
17622: break;
17623: case WITH:
17624: tok = jj_consume_token(WITH);
17625: break;
17626: case WORK:
17627: tok = jj_consume_token(WORK);
17628: break;
17629: case WRITE:
17630: tok = jj_consume_token(WRITE);
17631: break;
17632: case YEAR:
17633: tok = jj_consume_token(YEAR);
17634: break;
17635: case BOOLEAN:
17636: tok = jj_consume_token(BOOLEAN);
17637: break;
17638: case CALL:
17639: tok = jj_consume_token(CALL);
17640: break;
17641: case EXPLAIN:
17642: tok = jj_consume_token(EXPLAIN);
17643: break;
17644: case LONGINT:
17645: tok = jj_consume_token(LONGINT);
17646: break;
17647: case LTRIM:
17648: tok = jj_consume_token(LTRIM);
17649: break;
17650: case RTRIM:
17651: tok = jj_consume_token(RTRIM);
17652: break;
17653: case SUBSTR:
17654: tok = jj_consume_token(SUBSTR);
17655: break;
17656: case XML:
17657: tok = jj_consume_token(XML);
17658: break;
17659: case XMLPARSE:
17660: tok = jj_consume_token(XMLPARSE);
17661: break;
17662: case XMLSERIALIZE:
17663: tok = jj_consume_token(XMLSERIALIZE);
17664: break;
17665: case XMLEXISTS:
17666: tok = jj_consume_token(XMLEXISTS);
17667: break;
17668: case XMLQUERY:
17669: tok = jj_consume_token(XMLQUERY);
17670: break;
17671: default:
17672: jj_la1[301] = jj_gen;
17673: jj_consume_token(-1);
17674: throw new ParseException();
17675: }
17676: // Remember whether last token was a delimited identifier
17677: nextToLastTokenDelimitedIdentifier = lastTokenDelimitedIdentifier;
17678: lastTokenDelimitedIdentifier = Boolean.FALSE;
17679: {
17680: if (true)
17681: return tok.image;
17682: }
17683: throw new Error("Missing return statement in function");
17684: }
17685:
17686: /*
17687: * <A NAME="nonReservedKeyword">nonReservedKeyword</A>
17688: */
17689: final public String nonReservedKeyword() throws ParseException {
17690: Token tok;
17691: switch (jj_nt.kind) {
17692: case ABS:
17693: tok = jj_consume_token(ABS);
17694: break;
17695: case ABSVAL:
17696: tok = jj_consume_token(ABSVAL);
17697: break;
17698: case ACTION:
17699: tok = jj_consume_token(ACTION);
17700: break;
17701: case AFTER:
17702: tok = jj_consume_token(AFTER);
17703: break;
17704: case ALWAYS:
17705: tok = jj_consume_token(ALWAYS);
17706: break;
17707: case BEFORE:
17708: tok = jj_consume_token(BEFORE);
17709: break;
17710: case BINARY:
17711: tok = jj_consume_token(BINARY);
17712: break;
17713: case BLOB:
17714: tok = jj_consume_token(BLOB);
17715: break;
17716: case C:
17717: tok = jj_consume_token(C);
17718: break;
17719: case CALLED:
17720: tok = jj_consume_token(CALLED);
17721: break;
17722: case CLASS:
17723: tok = jj_consume_token(CLASS);
17724: break;
17725: case CLOB:
17726: tok = jj_consume_token(CLOB);
17727: break;
17728: case COALESCE:
17729: tok = jj_consume_token(COALESCE);
17730: break;
17731: case COBOL:
17732: tok = jj_consume_token(COBOL);
17733: break;
17734: case COMMITTED:
17735: tok = jj_consume_token(COMMITTED);
17736: break;
17737: case COMPRESS:
17738: tok = jj_consume_token(COMPRESS);
17739: break;
17740: case CONCAT:
17741: tok = jj_consume_token(CONCAT);
17742: break;
17743: case CONTAINS:
17744: tok = jj_consume_token(CONTAINS);
17745: break;
17746: case CONTENT:
17747: tok = jj_consume_token(CONTENT);
17748: break;
17749: case COUNT:
17750: tok = jj_consume_token(COUNT);
17751: break;
17752: case CS:
17753: tok = jj_consume_token(CS);
17754: break;
17755: case CURDATE:
17756: tok = jj_consume_token(CURDATE);
17757: break;
17758: case CURTIME:
17759: tok = jj_consume_token(CURTIME);
17760: break;
17761: case D:
17762: tok = jj_consume_token(D);
17763: break;
17764: case DATA:
17765: tok = jj_consume_token(DATA);
17766: break;
17767: case DATE:
17768: tok = jj_consume_token(DATE);
17769: break;
17770: case DAY:
17771: tok = jj_consume_token(DAY);
17772: break;
17773: case DIRTY:
17774: tok = jj_consume_token(DIRTY);
17775: break;
17776: case DYNAMIC:
17777: tok = jj_consume_token(DYNAMIC);
17778: break;
17779: case DATABASE:
17780: tok = jj_consume_token(DATABASE);
17781: break;
17782: case DB2SQL:
17783: tok = jj_consume_token(DB2SQL);
17784: break;
17785: case DOCUMENT:
17786: tok = jj_consume_token(DOCUMENT);
17787: break;
17788: case EACH:
17789: tok = jj_consume_token(EACH);
17790: break;
17791: case EMPTY:
17792: tok = jj_consume_token(EMPTY);
17793: break;
17794: case EXCLUSIVE:
17795: tok = jj_consume_token(EXCLUSIVE);
17796: break;
17797: case FN:
17798: tok = jj_consume_token(FN);
17799: break;
17800: case FORTRAN:
17801: tok = jj_consume_token(FORTRAN);
17802: break;
17803: case GENERATED:
17804: tok = jj_consume_token(GENERATED);
17805: break;
17806: case IDENTITY_VAL_LOCAL:
17807: tok = jj_consume_token(IDENTITY_VAL_LOCAL);
17808: break;
17809: case INCREMENT:
17810: tok = jj_consume_token(INCREMENT);
17811: break;
17812: case INDEX:
17813: tok = jj_consume_token(INDEX);
17814: break;
17815: case INITIAL:
17816: tok = jj_consume_token(INITIAL);
17817: break;
17818: case INTERVAL:
17819: tok = jj_consume_token(INTERVAL);
17820: break;
17821: case JAVA:
17822: tok = jj_consume_token(JAVA);
17823: break;
17824: case LANGUAGE:
17825: tok = jj_consume_token(LANGUAGE);
17826: break;
17827: case LARGE:
17828: tok = jj_consume_token(LARGE);
17829: break;
17830: case LCASE:
17831: tok = jj_consume_token(LCASE);
17832: break;
17833: case LENGTH:
17834: tok = jj_consume_token(LENGTH);
17835: break;
17836: case LEVEL:
17837: tok = jj_consume_token(LEVEL);
17838: break;
17839: case LOCATE:
17840: tok = jj_consume_token(LOCATE);
17841: break;
17842: case LOCK:
17843: tok = jj_consume_token(LOCK);
17844: break;
17845: case LOCKS:
17846: tok = jj_consume_token(LOCKS);
17847: break;
17848: case LOCKSIZE:
17849: tok = jj_consume_token(LOCKSIZE);
17850: break;
17851: case LOGGED:
17852: tok = jj_consume_token(LOGGED);
17853: break;
17854: case LONG:
17855: tok = jj_consume_token(LONG);
17856: break;
17857: case MESSAGE_LOCALE:
17858: tok = jj_consume_token(MESSAGE_LOCALE);
17859: break;
17860: case METHOD:
17861: tok = jj_consume_token(METHOD);
17862: break;
17863: case MOD:
17864: tok = jj_consume_token(MOD);
17865: break;
17866: case MODE:
17867: tok = jj_consume_token(MODE);
17868: break;
17869: case MODIFIES:
17870: tok = jj_consume_token(MODIFIES);
17871: break;
17872: case MODIFY:
17873: tok = jj_consume_token(MODIFY);
17874: break;
17875: case MODULE:
17876: tok = jj_consume_token(MODULE);
17877: break;
17878: case MONTH:
17879: tok = jj_consume_token(MONTH);
17880: break;
17881: case _MORE:
17882: tok = jj_consume_token(_MORE);
17883: break;
17884: case MUMPS:
17885: tok = jj_consume_token(MUMPS);
17886: break;
17887: case NAME:
17888: tok = jj_consume_token(NAME);
17889: break;
17890: case NCLOB:
17891: tok = jj_consume_token(NCLOB);
17892: break;
17893: case NEW:
17894: tok = jj_consume_token(NEW);
17895: break;
17896: case NEW_TABLE:
17897: tok = jj_consume_token(NEW_TABLE);
17898: break;
17899: case NULLABLE:
17900: tok = jj_consume_token(NULLABLE);
17901: break;
17902: case NUMBER:
17903: tok = jj_consume_token(NUMBER);
17904: break;
17905: case OBJECT:
17906: tok = jj_consume_token(OBJECT);
17907: break;
17908: case OFF:
17909: tok = jj_consume_token(OFF);
17910: break;
17911: case OLD:
17912: tok = jj_consume_token(OLD);
17913: break;
17914: case OLD_TABLE:
17915: tok = jj_consume_token(OLD_TABLE);
17916: break;
17917: case OJ:
17918: tok = jj_consume_token(OJ);
17919: break;
17920: case PASCAL:
17921: tok = jj_consume_token(PASCAL);
17922: break;
17923: case PASSING:
17924: tok = jj_consume_token(PASSING);
17925: break;
17926: case PLI:
17927: tok = jj_consume_token(PLI);
17928: break;
17929: case PRECISION:
17930: tok = jj_consume_token(PRECISION);
17931: break;
17932: case PROPERTIES:
17933: tok = jj_consume_token(PROPERTIES);
17934: break;
17935: case READS:
17936: tok = jj_consume_token(READS);
17937: break;
17938: case REF:
17939: tok = jj_consume_token(REF);
17940: break;
17941: case RELEASE:
17942: tok = jj_consume_token(RELEASE);
17943: break;
17944: case RENAME:
17945: tok = jj_consume_token(RENAME);
17946: break;
17947: case REPEATABLE:
17948: tok = jj_consume_token(REPEATABLE);
17949: break;
17950: case REFERENCING:
17951: tok = jj_consume_token(REFERENCING);
17952: break;
17953: case RESET:
17954: tok = jj_consume_token(RESET);
17955: break;
17956: case RESTART:
17957: tok = jj_consume_token(RESTART);
17958: break;
17959: case RESULT:
17960: tok = jj_consume_token(RESULT);
17961: break;
17962: case RETAIN:
17963: tok = jj_consume_token(RETAIN);
17964: break;
17965: case RETURNING:
17966: tok = jj_consume_token(RETURNING);
17967: break;
17968: case RETURNS:
17969: tok = jj_consume_token(RETURNS);
17970: break;
17971: case ROW:
17972: tok = jj_consume_token(ROW);
17973: break;
17974: case RR:
17975: tok = jj_consume_token(RR);
17976: break;
17977: case RS:
17978: tok = jj_consume_token(RS);
17979: break;
17980: case SCALE:
17981: tok = jj_consume_token(SCALE);
17982: break;
17983: case SAVEPOINT:
17984: tok = jj_consume_token(SAVEPOINT);
17985: break;
17986: case SEQUENCE:
17987: tok = jj_consume_token(SEQUENCE);
17988: break;
17989: case SEQUENTIAL:
17990: tok = jj_consume_token(SEQUENTIAL);
17991: break;
17992: case SERIALIZABLE:
17993: tok = jj_consume_token(SERIALIZABLE);
17994: break;
17995: case SETS:
17996: tok = jj_consume_token(SETS);
17997: break;
17998: case SHARE:
17999: tok = jj_consume_token(SHARE);
18000: break;
18001: case SPECIFIC:
18002: tok = jj_consume_token(SPECIFIC);
18003: break;
18004: case SQLID:
18005: tok = jj_consume_token(SQLID);
18006: break;
18007: case SQL_TSI_FRAC_SECOND:
18008: tok = jj_consume_token(SQL_TSI_FRAC_SECOND);
18009: break;
18010: case SQL_TSI_SECOND:
18011: tok = jj_consume_token(SQL_TSI_SECOND);
18012: break;
18013: case SQL_TSI_MINUTE:
18014: tok = jj_consume_token(SQL_TSI_MINUTE);
18015: break;
18016: case SQL_TSI_HOUR:
18017: tok = jj_consume_token(SQL_TSI_HOUR);
18018: break;
18019: case SQL_TSI_DAY:
18020: tok = jj_consume_token(SQL_TSI_DAY);
18021: break;
18022: case SQL_TSI_WEEK:
18023: tok = jj_consume_token(SQL_TSI_WEEK);
18024: break;
18025: case SQL_TSI_MONTH:
18026: tok = jj_consume_token(SQL_TSI_MONTH);
18027: break;
18028: case SQL_TSI_QUARTER:
18029: tok = jj_consume_token(SQL_TSI_QUARTER);
18030: break;
18031: case SQL_TSI_YEAR:
18032: tok = jj_consume_token(SQL_TSI_YEAR);
18033: break;
18034: case SQRT:
18035: tok = jj_consume_token(SQRT);
18036: break;
18037: case STABILITY:
18038: tok = jj_consume_token(STABILITY);
18039: break;
18040: case START:
18041: tok = jj_consume_token(START);
18042: break;
18043: case STATEMENT:
18044: tok = jj_consume_token(STATEMENT);
18045: break;
18046: case STRIP:
18047: tok = jj_consume_token(STRIP);
18048: break;
18049: case SYNONYM:
18050: tok = jj_consume_token(SYNONYM);
18051: break;
18052: case STYLE:
18053: tok = jj_consume_token(STYLE);
18054: break;
18055: case T:
18056: tok = jj_consume_token(T);
18057: break;
18058: case THEN:
18059: tok = jj_consume_token(THEN);
18060: break;
18061: case TIME:
18062: tok = jj_consume_token(TIME);
18063: break;
18064: case TIMESTAMP:
18065: tok = jj_consume_token(TIMESTAMP);
18066: break;
18067: case TIMESTAMPADD:
18068: tok = jj_consume_token(TIMESTAMPADD);
18069: break;
18070: case TIMESTAMPDIFF:
18071: tok = jj_consume_token(TIMESTAMPDIFF);
18072: break;
18073: case TRIGGER:
18074: tok = jj_consume_token(TRIGGER);
18075: break;
18076: case TRUNCATE:
18077: tok = jj_consume_token(TRUNCATE);
18078: break;
18079: case TS:
18080: tok = jj_consume_token(TS);
18081: break;
18082: case TYPE:
18083: tok = jj_consume_token(TYPE);
18084: break;
18085: case UCASE:
18086: tok = jj_consume_token(UCASE);
18087: break;
18088: case UNCOMMITTED:
18089: tok = jj_consume_token(UNCOMMITTED);
18090: break;
18091: case UR:
18092: tok = jj_consume_token(UR);
18093: break;
18094: case USAGE:
18095: tok = jj_consume_token(USAGE);
18096: break;
18097: case VALUE:
18098: tok = jj_consume_token(VALUE);
18099: break;
18100: case VARBINARY:
18101: tok = jj_consume_token(VARBINARY);
18102: break;
18103: case PARAMETER:
18104: tok = jj_consume_token(PARAMETER);
18105: break;
18106: case WHEN:
18107: tok = jj_consume_token(WHEN);
18108: break;
18109: case WHITESPACE:
18110: tok = jj_consume_token(WHITESPACE);
18111: break;
18112: default:
18113: jj_la1[302] = jj_gen;
18114: jj_consume_token(-1);
18115: throw new ParseException();
18116: }
18117: // Remember whether last token was a delimited identifier
18118: nextToLastTokenDelimitedIdentifier = lastTokenDelimitedIdentifier;
18119: lastTokenDelimitedIdentifier = Boolean.FALSE;
18120: nextToLastIdentifierToken = lastIdentifierToken;
18121: lastIdentifierToken = tok;
18122: {
18123: if (true)
18124: return tok.image;
18125: }
18126: throw new Error("Missing return statement in function");
18127: }
18128:
18129: /*
18130: * <A NAME="caseSensitiveIdentifierPlusReservedWords">caseSensitiveIdentifierPlusReservedWords</A>
18131: */
18132: final public String caseSensitiveIdentifierPlusReservedWords()
18133: throws ParseException {
18134: String str;
18135: switch (jj_nt.kind) {
18136: case BINARY:
18137: case COALESCE:
18138: case COUNT:
18139: case D:
18140: case MODULE:
18141: case T:
18142: case TS:
18143: case VALUE:
18144: case VARBINARY:
18145: case ABS:
18146: case ABSVAL:
18147: case ACTION:
18148: case ALWAYS:
18149: case BLOB:
18150: case C:
18151: case CALLED:
18152: case CLOB:
18153: case COBOL:
18154: case COMMITTED:
18155: case CONCAT:
18156: case CONTAINS:
18157: case DATA:
18158: case DATE:
18159: case DAY:
18160: case DYNAMIC:
18161: case FORTRAN:
18162: case GENERATED:
18163: case IDENTITY_VAL_LOCAL:
18164: case INCREMENT:
18165: case INITIAL:
18166: case INTERVAL:
18167: case LANGUAGE:
18168: case LARGE:
18169: case LENGTH:
18170: case LEVEL:
18171: case LOCKS:
18172: case LOCKSIZE:
18173: case LOGGED:
18174: case MOD:
18175: case MODIFIES:
18176: case MODIFY:
18177: case MONTH:
18178: case _MORE:
18179: case MUMPS:
18180: case NAME:
18181: case NCLOB:
18182: case NULLABLE:
18183: case NUMBER:
18184: case OBJECT:
18185: case PASCAL:
18186: case PLI:
18187: case PRECISION:
18188: case RELEASE:
18189: case REPEATABLE:
18190: case RESTART:
18191: case RETURNS:
18192: case ROW:
18193: case SAVEPOINT:
18194: case SCALE:
18195: case SERIALIZABLE:
18196: case SQL_TSI_FRAC_SECOND:
18197: case SQL_TSI_SECOND:
18198: case SQL_TSI_MINUTE:
18199: case SQL_TSI_HOUR:
18200: case SQL_TSI_DAY:
18201: case SQL_TSI_WEEK:
18202: case SQL_TSI_MONTH:
18203: case SQL_TSI_QUARTER:
18204: case SQL_TSI_YEAR:
18205: case START:
18206: case STATEMENT:
18207: case SYNONYM:
18208: case THEN:
18209: case TIME:
18210: case TIMESTAMP:
18211: case TIMESTAMPADD:
18212: case TIMESTAMPDIFF:
18213: case TRUNCATE:
18214: case TYPE:
18215: case UNCOMMITTED:
18216: case USAGE:
18217: case WHEN:
18218: case CURDATE:
18219: case CURTIME:
18220: case DATABASE:
18221: case LONG:
18222: case AFTER:
18223: case BEFORE:
18224: case CLASS:
18225: case COMPRESS:
18226: case CONTENT:
18227: case CS:
18228: case DB2SQL:
18229: case DIRTY:
18230: case DOCUMENT:
18231: case EACH:
18232: case EMPTY:
18233: case EXCLUSIVE:
18234: case FN:
18235: case INDEX:
18236: case JAVA:
18237: case LCASE:
18238: case LOCATE:
18239: case LOCK:
18240: case MESSAGE_LOCALE:
18241: case METHOD:
18242: case MODE:
18243: case NEW:
18244: case NEW_TABLE:
18245: case OJ:
18246: case OFF:
18247: case OLD:
18248: case OLD_TABLE:
18249: case PARAMETER:
18250: case PASSING:
18251: case PROPERTIES:
18252: case READS:
18253: case REF:
18254: case REFERENCING:
18255: case RENAME:
18256: case RESET:
18257: case RESULT:
18258: case RETAIN:
18259: case RETURNING:
18260: case RR:
18261: case RS:
18262: case SEQUENCE:
18263: case SEQUENTIAL:
18264: case SETS:
18265: case SHARE:
18266: case SQLID:
18267: case SPECIFIC:
18268: case SQRT:
18269: case STABILITY:
18270: case STRIP:
18271: case STYLE:
18272: case TRIGGER:
18273: case UCASE:
18274: case UR:
18275: case WHITESPACE:
18276: case IDENTIFIER:
18277: case DELIMITED_IDENTIFIER:
18278: str = caseSensitiveIdentifier();
18279: {
18280: if (true)
18281: return str;
18282: }
18283: break;
18284: case ADD:
18285: case ALL:
18286: case ALLOCATE:
18287: case ALTER:
18288: case AND:
18289: case ANY:
18290: case ARE:
18291: case AS:
18292: case ASC:
18293: case ASSERTION:
18294: case AT:
18295: case AUTHORIZATION:
18296: case AVG:
18297: case BEGIN:
18298: case BETWEEN:
18299: case BIT:
18300: case BOTH:
18301: case BY:
18302: case CASCADE:
18303: case CASCADED:
18304: case CASE:
18305: case CAST:
18306: case CHAR:
18307: case CHARACTER:
18308: case CHECK:
18309: case CLOSE:
18310: case COLLATE:
18311: case COLLATION:
18312: case COLUMN:
18313: case COMMIT:
18314: case CONNECT:
18315: case CONNECTION:
18316: case CONSTRAINT:
18317: case CONSTRAINTS:
18318: case CONTINUE:
18319: case CONVERT:
18320: case CORRESPONDING:
18321: case CREATE:
18322: case CURRENT:
18323: case CURRENT_DATE:
18324: case CURRENT_TIME:
18325: case CURRENT_TIMESTAMP:
18326: case CURRENT_USER:
18327: case CURSOR:
18328: case DEALLOCATE:
18329: case DEC:
18330: case DECIMAL:
18331: case DECLARE:
18332: case _DEFAULT:
18333: case DEFERRABLE:
18334: case DEFERRED:
18335: case DELETE:
18336: case DESC:
18337: case DESCRIBE:
18338: case DIAGNOSTICS:
18339: case DISCONNECT:
18340: case DISTINCT:
18341: case DOUBLE:
18342: case DROP:
18343: case ELSE:
18344: case END:
18345: case ENDEXEC:
18346: case ESCAPE:
18347: case EXCEPT:
18348: case EXCEPTION:
18349: case EXEC:
18350: case EXECUTE:
18351: case EXISTS:
18352: case EXTERNAL:
18353: case FALSE:
18354: case FETCH:
18355: case FIRST:
18356: case FLOAT:
18357: case FOR:
18358: case FOREIGN:
18359: case FOUND:
18360: case FROM:
18361: case FULL:
18362: case FUNCTION:
18363: case GET:
18364: case GLOBAL:
18365: case GO:
18366: case GOTO:
18367: case GRANT:
18368: case GROUP:
18369: case HAVING:
18370: case HOUR:
18371: case IDENTITY:
18372: case IMMEDIATE:
18373: case IN:
18374: case INDICATOR:
18375: case INITIALLY:
18376: case INNER:
18377: case INPUT:
18378: case INSENSITIVE:
18379: case INSERT:
18380: case INT:
18381: case INTEGER:
18382: case INTERSECT:
18383: case INTO:
18384: case IS:
18385: case ISOLATION:
18386: case JOIN:
18387: case KEY:
18388: case LAST:
18389: case LEFT:
18390: case LIKE:
18391: case LOWER:
18392: case MATCH:
18393: case MAX:
18394: case MIN:
18395: case MINUTE:
18396: case NATIONAL:
18397: case NATURAL:
18398: case NCHAR:
18399: case NEXT:
18400: case NO:
18401: case NOT:
18402: case NULL:
18403: case NULLIF:
18404: case NUMERIC:
18405: case OF:
18406: case ON:
18407: case ONLY:
18408: case OPEN:
18409: case OPTION:
18410: case OR:
18411: case ORDER:
18412: case OUTER:
18413: case OUTPUT:
18414: case OVERLAPS:
18415: case PAD:
18416: case PARTIAL:
18417: case PREPARE:
18418: case PRESERVE:
18419: case PRIMARY:
18420: case PRIOR:
18421: case PRIVILEGES:
18422: case PROCEDURE:
18423: case PUBLIC:
18424: case READ:
18425: case REAL:
18426: case REFERENCES:
18427: case RELATIVE:
18428: case RESTRICT:
18429: case REVOKE:
18430: case RIGHT:
18431: case ROLLBACK:
18432: case ROWS:
18433: case SCHEMA:
18434: case SCROLL:
18435: case SECOND:
18436: case SELECT:
18437: case SESSION_USER:
18438: case SET:
18439: case SMALLINT:
18440: case SOME:
18441: case SPACE:
18442: case SQL:
18443: case SQLCODE:
18444: case SQLERROR:
18445: case SQLSTATE:
18446: case SUBSTRING:
18447: case SUM:
18448: case SYSTEM_USER:
18449: case TABLE:
18450: case TEMPORARY:
18451: case TIMEZONE_HOUR:
18452: case TIMEZONE_MINUTE:
18453: case TO:
18454: case TRANSACTION:
18455: case TRANSLATE:
18456: case TRANSLATION:
18457: case TRUE:
18458: case UNION:
18459: case UNIQUE:
18460: case UNKNOWN:
18461: case UPDATE:
18462: case UPPER:
18463: case USER:
18464: case USING:
18465: case VALUES:
18466: case VARCHAR:
18467: case VARYING:
18468: case VIEW:
18469: case WHENEVER:
18470: case WHERE:
18471: case WITH:
18472: case WORK:
18473: case WRITE:
18474: case YEAR:
18475: case INOUT:
18476: case BOOLEAN:
18477: case CALL:
18478: case GET_CURRENT_CONNECTION:
18479: case EXPLAIN:
18480: case LONGINT:
18481: case LTRIM:
18482: case RTRIM:
18483: case SUBSTR:
18484: case XML:
18485: case XMLEXISTS:
18486: case XMLPARSE:
18487: case XMLQUERY:
18488: case XMLSERIALIZE:
18489: case NVARCHAR:
18490: case OUT:
18491: str = reservedKeyword();
18492: {
18493: if (true)
18494: return str;
18495: }
18496: break;
18497: default:
18498: jj_la1[303] = jj_gen;
18499: jj_consume_token(-1);
18500: throw new ParseException();
18501: }
18502: throw new Error("Missing return statement in function");
18503: }
18504:
18505: /*
18506: * <A NAME="caseInsensitiveIdentifierPlusReservedWords">caseInsensitiveIdentifierPlusReservedWords</A>
18507: */
18508: final public String caseInsensitiveIdentifierPlusReservedWords()
18509: throws ParseException, StandardException {
18510: String str;
18511: switch (jj_nt.kind) {
18512: case BINARY:
18513: case COALESCE:
18514: case COUNT:
18515: case D:
18516: case MODULE:
18517: case T:
18518: case TS:
18519: case VALUE:
18520: case VARBINARY:
18521: case ABS:
18522: case ABSVAL:
18523: case ACTION:
18524: case ALWAYS:
18525: case BLOB:
18526: case C:
18527: case CALLED:
18528: case CLOB:
18529: case COBOL:
18530: case COMMITTED:
18531: case CONCAT:
18532: case CONTAINS:
18533: case DATA:
18534: case DATE:
18535: case DAY:
18536: case DYNAMIC:
18537: case FORTRAN:
18538: case GENERATED:
18539: case IDENTITY_VAL_LOCAL:
18540: case INCREMENT:
18541: case INITIAL:
18542: case INTERVAL:
18543: case LANGUAGE:
18544: case LARGE:
18545: case LENGTH:
18546: case LEVEL:
18547: case LOCKS:
18548: case LOCKSIZE:
18549: case LOGGED:
18550: case MOD:
18551: case MODIFIES:
18552: case MODIFY:
18553: case MONTH:
18554: case _MORE:
18555: case MUMPS:
18556: case NAME:
18557: case NCLOB:
18558: case NULLABLE:
18559: case NUMBER:
18560: case OBJECT:
18561: case PASCAL:
18562: case PLI:
18563: case PRECISION:
18564: case RELEASE:
18565: case REPEATABLE:
18566: case RESTART:
18567: case RETURNS:
18568: case ROW:
18569: case SAVEPOINT:
18570: case SCALE:
18571: case SERIALIZABLE:
18572: case SQL_TSI_FRAC_SECOND:
18573: case SQL_TSI_SECOND:
18574: case SQL_TSI_MINUTE:
18575: case SQL_TSI_HOUR:
18576: case SQL_TSI_DAY:
18577: case SQL_TSI_WEEK:
18578: case SQL_TSI_MONTH:
18579: case SQL_TSI_QUARTER:
18580: case SQL_TSI_YEAR:
18581: case START:
18582: case STATEMENT:
18583: case SYNONYM:
18584: case THEN:
18585: case TIME:
18586: case TIMESTAMP:
18587: case TIMESTAMPADD:
18588: case TIMESTAMPDIFF:
18589: case TRUNCATE:
18590: case TYPE:
18591: case UNCOMMITTED:
18592: case USAGE:
18593: case WHEN:
18594: case CURDATE:
18595: case CURTIME:
18596: case DATABASE:
18597: case LONG:
18598: case AFTER:
18599: case BEFORE:
18600: case CLASS:
18601: case COMPRESS:
18602: case CONTENT:
18603: case CS:
18604: case DB2SQL:
18605: case DIRTY:
18606: case DOCUMENT:
18607: case EACH:
18608: case EMPTY:
18609: case EXCLUSIVE:
18610: case FN:
18611: case INDEX:
18612: case JAVA:
18613: case LCASE:
18614: case LOCATE:
18615: case LOCK:
18616: case MESSAGE_LOCALE:
18617: case METHOD:
18618: case MODE:
18619: case NEW:
18620: case NEW_TABLE:
18621: case OJ:
18622: case OFF:
18623: case OLD:
18624: case OLD_TABLE:
18625: case PARAMETER:
18626: case PASSING:
18627: case PROPERTIES:
18628: case READS:
18629: case REF:
18630: case REFERENCING:
18631: case RENAME:
18632: case RESET:
18633: case RESULT:
18634: case RETAIN:
18635: case RETURNING:
18636: case RR:
18637: case RS:
18638: case SEQUENCE:
18639: case SEQUENTIAL:
18640: case SETS:
18641: case SHARE:
18642: case SQLID:
18643: case SPECIFIC:
18644: case SQRT:
18645: case STABILITY:
18646: case STRIP:
18647: case STYLE:
18648: case TRIGGER:
18649: case UCASE:
18650: case UR:
18651: case WHITESPACE:
18652: case IDENTIFIER:
18653: case DELIMITED_IDENTIFIER:
18654: str = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
18655: {
18656: if (true)
18657: return str;
18658: }
18659: break;
18660: case ADD:
18661: case ALL:
18662: case ALLOCATE:
18663: case ALTER:
18664: case AND:
18665: case ANY:
18666: case ARE:
18667: case AS:
18668: case ASC:
18669: case ASSERTION:
18670: case AT:
18671: case AUTHORIZATION:
18672: case AVG:
18673: case BEGIN:
18674: case BETWEEN:
18675: case BIT:
18676: case BOTH:
18677: case BY:
18678: case CASCADE:
18679: case CASCADED:
18680: case CASE:
18681: case CAST:
18682: case CHAR:
18683: case CHARACTER:
18684: case CHECK:
18685: case CLOSE:
18686: case COLLATE:
18687: case COLLATION:
18688: case COLUMN:
18689: case COMMIT:
18690: case CONNECT:
18691: case CONNECTION:
18692: case CONSTRAINT:
18693: case CONSTRAINTS:
18694: case CONTINUE:
18695: case CONVERT:
18696: case CORRESPONDING:
18697: case CREATE:
18698: case CURRENT:
18699: case CURRENT_DATE:
18700: case CURRENT_TIME:
18701: case CURRENT_TIMESTAMP:
18702: case CURRENT_USER:
18703: case CURSOR:
18704: case DEALLOCATE:
18705: case DEC:
18706: case DECIMAL:
18707: case DECLARE:
18708: case _DEFAULT:
18709: case DEFERRABLE:
18710: case DEFERRED:
18711: case DELETE:
18712: case DESC:
18713: case DESCRIBE:
18714: case DIAGNOSTICS:
18715: case DISCONNECT:
18716: case DISTINCT:
18717: case DOUBLE:
18718: case DROP:
18719: case ELSE:
18720: case END:
18721: case ENDEXEC:
18722: case ESCAPE:
18723: case EXCEPT:
18724: case EXCEPTION:
18725: case EXEC:
18726: case EXECUTE:
18727: case EXISTS:
18728: case EXTERNAL:
18729: case FALSE:
18730: case FETCH:
18731: case FIRST:
18732: case FLOAT:
18733: case FOR:
18734: case FOREIGN:
18735: case FOUND:
18736: case FROM:
18737: case FULL:
18738: case FUNCTION:
18739: case GET:
18740: case GLOBAL:
18741: case GO:
18742: case GOTO:
18743: case GRANT:
18744: case GROUP:
18745: case HAVING:
18746: case HOUR:
18747: case IDENTITY:
18748: case IMMEDIATE:
18749: case IN:
18750: case INDICATOR:
18751: case INITIALLY:
18752: case INNER:
18753: case INPUT:
18754: case INSENSITIVE:
18755: case INSERT:
18756: case INT:
18757: case INTEGER:
18758: case INTERSECT:
18759: case INTO:
18760: case IS:
18761: case ISOLATION:
18762: case JOIN:
18763: case KEY:
18764: case LAST:
18765: case LEFT:
18766: case LIKE:
18767: case LOWER:
18768: case MATCH:
18769: case MAX:
18770: case MIN:
18771: case MINUTE:
18772: case NATIONAL:
18773: case NATURAL:
18774: case NCHAR:
18775: case NEXT:
18776: case NO:
18777: case NOT:
18778: case NULL:
18779: case NULLIF:
18780: case NUMERIC:
18781: case OF:
18782: case ON:
18783: case ONLY:
18784: case OPEN:
18785: case OPTION:
18786: case OR:
18787: case ORDER:
18788: case OUTER:
18789: case OUTPUT:
18790: case OVERLAPS:
18791: case PAD:
18792: case PARTIAL:
18793: case PREPARE:
18794: case PRESERVE:
18795: case PRIMARY:
18796: case PRIOR:
18797: case PRIVILEGES:
18798: case PROCEDURE:
18799: case PUBLIC:
18800: case READ:
18801: case REAL:
18802: case REFERENCES:
18803: case RELATIVE:
18804: case RESTRICT:
18805: case REVOKE:
18806: case RIGHT:
18807: case ROLLBACK:
18808: case ROWS:
18809: case SCHEMA:
18810: case SCROLL:
18811: case SECOND:
18812: case SELECT:
18813: case SESSION_USER:
18814: case SET:
18815: case SMALLINT:
18816: case SOME:
18817: case SPACE:
18818: case SQL:
18819: case SQLCODE:
18820: case SQLERROR:
18821: case SQLSTATE:
18822: case SUBSTRING:
18823: case SUM:
18824: case SYSTEM_USER:
18825: case TABLE:
18826: case TEMPORARY:
18827: case TIMEZONE_HOUR:
18828: case TIMEZONE_MINUTE:
18829: case TO:
18830: case TRANSACTION:
18831: case TRANSLATE:
18832: case TRANSLATION:
18833: case TRUE:
18834: case UNION:
18835: case UNIQUE:
18836: case UNKNOWN:
18837: case UPDATE:
18838: case UPPER:
18839: case USER:
18840: case USING:
18841: case VALUES:
18842: case VARCHAR:
18843: case VARYING:
18844: case VIEW:
18845: case WHENEVER:
18846: case WHERE:
18847: case WITH:
18848: case WORK:
18849: case WRITE:
18850: case YEAR:
18851: case INOUT:
18852: case BOOLEAN:
18853: case CALL:
18854: case GET_CURRENT_CONNECTION:
18855: case EXPLAIN:
18856: case LONGINT:
18857: case LTRIM:
18858: case RTRIM:
18859: case SUBSTR:
18860: case XML:
18861: case XMLEXISTS:
18862: case XMLPARSE:
18863: case XMLQUERY:
18864: case XMLSERIALIZE:
18865: case NVARCHAR:
18866: case OUT:
18867: str = reservedKeyword();
18868: {
18869: if (true)
18870: return getLanguageConnectionContext()
18871: .convertIdentifierCase(str);
18872: }
18873: break;
18874: default:
18875: jj_la1[304] = jj_gen;
18876: jj_consume_token(-1);
18877: throw new ParseException();
18878: }
18879: throw new Error("Missing return statement in function");
18880: }
18881:
18882: /*
18883: * <A NAME="caseSensitiveIdentifier">caseSensitiveIdentifier</A>
18884: */
18885: final public String caseSensitiveIdentifier() throws ParseException {
18886: String str;
18887: Token tok;
18888: switch (jj_nt.kind) {
18889: case IDENTIFIER:
18890: tok = jj_consume_token(IDENTIFIER);
18891: // Remember whether last token was a delimited identifier
18892: nextToLastTokenDelimitedIdentifier = lastTokenDelimitedIdentifier;
18893: lastTokenDelimitedIdentifier = Boolean.FALSE;
18894: {
18895: if (true)
18896: return tok.image;
18897: }
18898: break;
18899: case DELIMITED_IDENTIFIER:
18900: str = delimitedIdentifier();
18901: {
18902: if (true)
18903: return str;
18904: }
18905: break;
18906: case BINARY:
18907: case COALESCE:
18908: case COUNT:
18909: case D:
18910: case MODULE:
18911: case T:
18912: case TS:
18913: case VALUE:
18914: case VARBINARY:
18915: case ABS:
18916: case ABSVAL:
18917: case ACTION:
18918: case ALWAYS:
18919: case BLOB:
18920: case C:
18921: case CALLED:
18922: case CLOB:
18923: case COBOL:
18924: case COMMITTED:
18925: case CONCAT:
18926: case CONTAINS:
18927: case DATA:
18928: case DATE:
18929: case DAY:
18930: case DYNAMIC:
18931: case FORTRAN:
18932: case GENERATED:
18933: case IDENTITY_VAL_LOCAL:
18934: case INCREMENT:
18935: case INITIAL:
18936: case INTERVAL:
18937: case LANGUAGE:
18938: case LARGE:
18939: case LENGTH:
18940: case LEVEL:
18941: case LOCKS:
18942: case LOCKSIZE:
18943: case LOGGED:
18944: case MOD:
18945: case MODIFIES:
18946: case MODIFY:
18947: case MONTH:
18948: case _MORE:
18949: case MUMPS:
18950: case NAME:
18951: case NCLOB:
18952: case NULLABLE:
18953: case NUMBER:
18954: case OBJECT:
18955: case PASCAL:
18956: case PLI:
18957: case PRECISION:
18958: case RELEASE:
18959: case REPEATABLE:
18960: case RESTART:
18961: case RETURNS:
18962: case ROW:
18963: case SAVEPOINT:
18964: case SCALE:
18965: case SERIALIZABLE:
18966: case SQL_TSI_FRAC_SECOND:
18967: case SQL_TSI_SECOND:
18968: case SQL_TSI_MINUTE:
18969: case SQL_TSI_HOUR:
18970: case SQL_TSI_DAY:
18971: case SQL_TSI_WEEK:
18972: case SQL_TSI_MONTH:
18973: case SQL_TSI_QUARTER:
18974: case SQL_TSI_YEAR:
18975: case START:
18976: case STATEMENT:
18977: case SYNONYM:
18978: case THEN:
18979: case TIME:
18980: case TIMESTAMP:
18981: case TIMESTAMPADD:
18982: case TIMESTAMPDIFF:
18983: case TRUNCATE:
18984: case TYPE:
18985: case UNCOMMITTED:
18986: case USAGE:
18987: case WHEN:
18988: case CURDATE:
18989: case CURTIME:
18990: case DATABASE:
18991: case LONG:
18992: case AFTER:
18993: case BEFORE:
18994: case CLASS:
18995: case COMPRESS:
18996: case CONTENT:
18997: case CS:
18998: case DB2SQL:
18999: case DIRTY:
19000: case DOCUMENT:
19001: case EACH:
19002: case EMPTY:
19003: case EXCLUSIVE:
19004: case FN:
19005: case INDEX:
19006: case JAVA:
19007: case LCASE:
19008: case LOCATE:
19009: case LOCK:
19010: case MESSAGE_LOCALE:
19011: case METHOD:
19012: case MODE:
19013: case NEW:
19014: case NEW_TABLE:
19015: case OJ:
19016: case OFF:
19017: case OLD:
19018: case OLD_TABLE:
19019: case PARAMETER:
19020: case PASSING:
19021: case PROPERTIES:
19022: case READS:
19023: case REF:
19024: case REFERENCING:
19025: case RENAME:
19026: case RESET:
19027: case RESULT:
19028: case RETAIN:
19029: case RETURNING:
19030: case RR:
19031: case RS:
19032: case SEQUENCE:
19033: case SEQUENTIAL:
19034: case SETS:
19035: case SHARE:
19036: case SQLID:
19037: case SPECIFIC:
19038: case SQRT:
19039: case STABILITY:
19040: case STRIP:
19041: case STYLE:
19042: case TRIGGER:
19043: case UCASE:
19044: case UR:
19045: case WHITESPACE:
19046: str = nonReservedKeyword();
19047: {
19048: if (true)
19049: return str;
19050: }
19051: break;
19052: default:
19053: jj_la1[305] = jj_gen;
19054: jj_consume_token(-1);
19055: throw new ParseException();
19056: }
19057: throw new Error("Missing return statement in function");
19058: }
19059:
19060: final private boolean jj_2_1(int xla) {
19061: jj_la = xla;
19062: jj_lastpos = jj_scanpos = token;
19063: try {
19064: return !jj_3_1();
19065: } catch (LookaheadSuccess ls) {
19066: return true;
19067: } finally {
19068: jj_save(0, xla);
19069: }
19070: }
19071:
19072: final private boolean jj_2_2(int xla) {
19073: jj_la = xla;
19074: jj_lastpos = jj_scanpos = token;
19075: try {
19076: return !jj_3_2();
19077: } catch (LookaheadSuccess ls) {
19078: return true;
19079: } finally {
19080: jj_save(1, xla);
19081: }
19082: }
19083:
19084: final private boolean jj_2_3(int xla) {
19085: jj_la = xla;
19086: jj_lastpos = jj_scanpos = token;
19087: try {
19088: return !jj_3_3();
19089: } catch (LookaheadSuccess ls) {
19090: return true;
19091: } finally {
19092: jj_save(2, xla);
19093: }
19094: }
19095:
19096: final private boolean jj_2_4(int xla) {
19097: jj_la = xla;
19098: jj_lastpos = jj_scanpos = token;
19099: try {
19100: return !jj_3_4();
19101: } catch (LookaheadSuccess ls) {
19102: return true;
19103: } finally {
19104: jj_save(3, xla);
19105: }
19106: }
19107:
19108: final private boolean jj_2_5(int xla) {
19109: jj_la = xla;
19110: jj_lastpos = jj_scanpos = token;
19111: try {
19112: return !jj_3_5();
19113: } catch (LookaheadSuccess ls) {
19114: return true;
19115: } finally {
19116: jj_save(4, xla);
19117: }
19118: }
19119:
19120: final private boolean jj_2_6(int xla) {
19121: jj_la = xla;
19122: jj_lastpos = jj_scanpos = token;
19123: try {
19124: return !jj_3_6();
19125: } catch (LookaheadSuccess ls) {
19126: return true;
19127: } finally {
19128: jj_save(5, xla);
19129: }
19130: }
19131:
19132: final private boolean jj_2_7(int xla) {
19133: jj_la = xla;
19134: jj_lastpos = jj_scanpos = token;
19135: try {
19136: return !jj_3_7();
19137: } catch (LookaheadSuccess ls) {
19138: return true;
19139: } finally {
19140: jj_save(6, xla);
19141: }
19142: }
19143:
19144: final private boolean jj_2_8(int xla) {
19145: jj_la = xla;
19146: jj_lastpos = jj_scanpos = token;
19147: try {
19148: return !jj_3_8();
19149: } catch (LookaheadSuccess ls) {
19150: return true;
19151: } finally {
19152: jj_save(7, xla);
19153: }
19154: }
19155:
19156: final private boolean jj_2_9(int xla) {
19157: jj_la = xla;
19158: jj_lastpos = jj_scanpos = token;
19159: try {
19160: return !jj_3_9();
19161: } catch (LookaheadSuccess ls) {
19162: return true;
19163: } finally {
19164: jj_save(8, xla);
19165: }
19166: }
19167:
19168: final private boolean jj_2_10(int xla) {
19169: jj_la = xla;
19170: jj_lastpos = jj_scanpos = token;
19171: try {
19172: return !jj_3_10();
19173: } catch (LookaheadSuccess ls) {
19174: return true;
19175: } finally {
19176: jj_save(9, xla);
19177: }
19178: }
19179:
19180: final private boolean jj_2_11(int xla) {
19181: jj_la = xla;
19182: jj_lastpos = jj_scanpos = token;
19183: try {
19184: return !jj_3_11();
19185: } catch (LookaheadSuccess ls) {
19186: return true;
19187: } finally {
19188: jj_save(10, xla);
19189: }
19190: }
19191:
19192: final private boolean jj_2_12(int xla) {
19193: jj_la = xla;
19194: jj_lastpos = jj_scanpos = token;
19195: try {
19196: return !jj_3_12();
19197: } catch (LookaheadSuccess ls) {
19198: return true;
19199: } finally {
19200: jj_save(11, xla);
19201: }
19202: }
19203:
19204: final private boolean jj_2_13(int xla) {
19205: jj_la = xla;
19206: jj_lastpos = jj_scanpos = token;
19207: try {
19208: return !jj_3_13();
19209: } catch (LookaheadSuccess ls) {
19210: return true;
19211: } finally {
19212: jj_save(12, xla);
19213: }
19214: }
19215:
19216: final private boolean jj_2_14(int xla) {
19217: jj_la = xla;
19218: jj_lastpos = jj_scanpos = token;
19219: try {
19220: return !jj_3_14();
19221: } catch (LookaheadSuccess ls) {
19222: return true;
19223: } finally {
19224: jj_save(13, xla);
19225: }
19226: }
19227:
19228: final private boolean jj_2_15(int xla) {
19229: jj_la = xla;
19230: jj_lastpos = jj_scanpos = token;
19231: try {
19232: return !jj_3_15();
19233: } catch (LookaheadSuccess ls) {
19234: return true;
19235: } finally {
19236: jj_save(14, xla);
19237: }
19238: }
19239:
19240: final private boolean jj_2_16(int xla) {
19241: jj_la = xla;
19242: jj_lastpos = jj_scanpos = token;
19243: try {
19244: return !jj_3_16();
19245: } catch (LookaheadSuccess ls) {
19246: return true;
19247: } finally {
19248: jj_save(15, xla);
19249: }
19250: }
19251:
19252: final private boolean jj_2_17(int xla) {
19253: jj_la = xla;
19254: jj_lastpos = jj_scanpos = token;
19255: try {
19256: return !jj_3_17();
19257: } catch (LookaheadSuccess ls) {
19258: return true;
19259: } finally {
19260: jj_save(16, xla);
19261: }
19262: }
19263:
19264: final private boolean jj_2_18(int xla) {
19265: jj_la = xla;
19266: jj_lastpos = jj_scanpos = token;
19267: try {
19268: return !jj_3_18();
19269: } catch (LookaheadSuccess ls) {
19270: return true;
19271: } finally {
19272: jj_save(17, xla);
19273: }
19274: }
19275:
19276: final private boolean jj_2_19(int xla) {
19277: jj_la = xla;
19278: jj_lastpos = jj_scanpos = token;
19279: try {
19280: return !jj_3_19();
19281: } catch (LookaheadSuccess ls) {
19282: return true;
19283: } finally {
19284: jj_save(18, xla);
19285: }
19286: }
19287:
19288: final private boolean jj_2_20(int xla) {
19289: jj_la = xla;
19290: jj_lastpos = jj_scanpos = token;
19291: try {
19292: return !jj_3_20();
19293: } catch (LookaheadSuccess ls) {
19294: return true;
19295: } finally {
19296: jj_save(19, xla);
19297: }
19298: }
19299:
19300: final private boolean jj_2_21(int xla) {
19301: jj_la = xla;
19302: jj_lastpos = jj_scanpos = token;
19303: try {
19304: return !jj_3_21();
19305: } catch (LookaheadSuccess ls) {
19306: return true;
19307: } finally {
19308: jj_save(20, xla);
19309: }
19310: }
19311:
19312: final private boolean jj_2_22(int xla) {
19313: jj_la = xla;
19314: jj_lastpos = jj_scanpos = token;
19315: try {
19316: return !jj_3_22();
19317: } catch (LookaheadSuccess ls) {
19318: return true;
19319: } finally {
19320: jj_save(21, xla);
19321: }
19322: }
19323:
19324: final private boolean jj_2_23(int xla) {
19325: jj_la = xla;
19326: jj_lastpos = jj_scanpos = token;
19327: try {
19328: return !jj_3_23();
19329: } catch (LookaheadSuccess ls) {
19330: return true;
19331: } finally {
19332: jj_save(22, xla);
19333: }
19334: }
19335:
19336: final private boolean jj_2_24(int xla) {
19337: jj_la = xla;
19338: jj_lastpos = jj_scanpos = token;
19339: try {
19340: return !jj_3_24();
19341: } catch (LookaheadSuccess ls) {
19342: return true;
19343: } finally {
19344: jj_save(23, xla);
19345: }
19346: }
19347:
19348: final private boolean jj_2_25(int xla) {
19349: jj_la = xla;
19350: jj_lastpos = jj_scanpos = token;
19351: try {
19352: return !jj_3_25();
19353: } catch (LookaheadSuccess ls) {
19354: return true;
19355: } finally {
19356: jj_save(24, xla);
19357: }
19358: }
19359:
19360: final private boolean jj_2_26(int xla) {
19361: jj_la = xla;
19362: jj_lastpos = jj_scanpos = token;
19363: try {
19364: return !jj_3_26();
19365: } catch (LookaheadSuccess ls) {
19366: return true;
19367: } finally {
19368: jj_save(25, xla);
19369: }
19370: }
19371:
19372: final private boolean jj_2_27(int xla) {
19373: jj_la = xla;
19374: jj_lastpos = jj_scanpos = token;
19375: try {
19376: return !jj_3_27();
19377: } catch (LookaheadSuccess ls) {
19378: return true;
19379: } finally {
19380: jj_save(26, xla);
19381: }
19382: }
19383:
19384: final private boolean jj_2_28(int xla) {
19385: jj_la = xla;
19386: jj_lastpos = jj_scanpos = token;
19387: try {
19388: return !jj_3_28();
19389: } catch (LookaheadSuccess ls) {
19390: return true;
19391: } finally {
19392: jj_save(27, xla);
19393: }
19394: }
19395:
19396: final private boolean jj_2_29(int xla) {
19397: jj_la = xla;
19398: jj_lastpos = jj_scanpos = token;
19399: try {
19400: return !jj_3_29();
19401: } catch (LookaheadSuccess ls) {
19402: return true;
19403: } finally {
19404: jj_save(28, xla);
19405: }
19406: }
19407:
19408: final private boolean jj_2_30(int xla) {
19409: jj_la = xla;
19410: jj_lastpos = jj_scanpos = token;
19411: try {
19412: return !jj_3_30();
19413: } catch (LookaheadSuccess ls) {
19414: return true;
19415: } finally {
19416: jj_save(29, xla);
19417: }
19418: }
19419:
19420: final private boolean jj_2_31(int xla) {
19421: jj_la = xla;
19422: jj_lastpos = jj_scanpos = token;
19423: try {
19424: return !jj_3_31();
19425: } catch (LookaheadSuccess ls) {
19426: return true;
19427: } finally {
19428: jj_save(30, xla);
19429: }
19430: }
19431:
19432: final private boolean jj_2_32(int xla) {
19433: jj_la = xla;
19434: jj_lastpos = jj_scanpos = token;
19435: try {
19436: return !jj_3_32();
19437: } catch (LookaheadSuccess ls) {
19438: return true;
19439: } finally {
19440: jj_save(31, xla);
19441: }
19442: }
19443:
19444: final private boolean jj_2_33(int xla) {
19445: jj_la = xla;
19446: jj_lastpos = jj_scanpos = token;
19447: try {
19448: return !jj_3_33();
19449: } catch (LookaheadSuccess ls) {
19450: return true;
19451: } finally {
19452: jj_save(32, xla);
19453: }
19454: }
19455:
19456: final private boolean jj_2_34(int xla) {
19457: jj_la = xla;
19458: jj_lastpos = jj_scanpos = token;
19459: try {
19460: return !jj_3_34();
19461: } catch (LookaheadSuccess ls) {
19462: return true;
19463: } finally {
19464: jj_save(33, xla);
19465: }
19466: }
19467:
19468: final private boolean jj_2_35(int xla) {
19469: jj_la = xla;
19470: jj_lastpos = jj_scanpos = token;
19471: try {
19472: return !jj_3_35();
19473: } catch (LookaheadSuccess ls) {
19474: return true;
19475: } finally {
19476: jj_save(34, xla);
19477: }
19478: }
19479:
19480: final private boolean jj_2_36(int xla) {
19481: jj_la = xla;
19482: jj_lastpos = jj_scanpos = token;
19483: try {
19484: return !jj_3_36();
19485: } catch (LookaheadSuccess ls) {
19486: return true;
19487: } finally {
19488: jj_save(35, xla);
19489: }
19490: }
19491:
19492: final private boolean jj_2_37(int xla) {
19493: jj_la = xla;
19494: jj_lastpos = jj_scanpos = token;
19495: try {
19496: return !jj_3_37();
19497: } catch (LookaheadSuccess ls) {
19498: return true;
19499: } finally {
19500: jj_save(36, xla);
19501: }
19502: }
19503:
19504: final private boolean jj_2_38(int xla) {
19505: jj_la = xla;
19506: jj_lastpos = jj_scanpos = token;
19507: try {
19508: return !jj_3_38();
19509: } catch (LookaheadSuccess ls) {
19510: return true;
19511: } finally {
19512: jj_save(37, xla);
19513: }
19514: }
19515:
19516: final private boolean jj_2_39(int xla) {
19517: jj_la = xla;
19518: jj_lastpos = jj_scanpos = token;
19519: try {
19520: return !jj_3_39();
19521: } catch (LookaheadSuccess ls) {
19522: return true;
19523: } finally {
19524: jj_save(38, xla);
19525: }
19526: }
19527:
19528: final private boolean jj_2_40(int xla) {
19529: jj_la = xla;
19530: jj_lastpos = jj_scanpos = token;
19531: try {
19532: return !jj_3_40();
19533: } catch (LookaheadSuccess ls) {
19534: return true;
19535: } finally {
19536: jj_save(39, xla);
19537: }
19538: }
19539:
19540: final private boolean jj_2_41(int xla) {
19541: jj_la = xla;
19542: jj_lastpos = jj_scanpos = token;
19543: try {
19544: return !jj_3_41();
19545: } catch (LookaheadSuccess ls) {
19546: return true;
19547: } finally {
19548: jj_save(40, xla);
19549: }
19550: }
19551:
19552: final private boolean jj_2_42(int xla) {
19553: jj_la = xla;
19554: jj_lastpos = jj_scanpos = token;
19555: try {
19556: return !jj_3_42();
19557: } catch (LookaheadSuccess ls) {
19558: return true;
19559: } finally {
19560: jj_save(41, xla);
19561: }
19562: }
19563:
19564: final private boolean jj_2_43(int xla) {
19565: jj_la = xla;
19566: jj_lastpos = jj_scanpos = token;
19567: try {
19568: return !jj_3_43();
19569: } catch (LookaheadSuccess ls) {
19570: return true;
19571: } finally {
19572: jj_save(42, xla);
19573: }
19574: }
19575:
19576: final private boolean jj_2_44(int xla) {
19577: jj_la = xla;
19578: jj_lastpos = jj_scanpos = token;
19579: try {
19580: return !jj_3_44();
19581: } catch (LookaheadSuccess ls) {
19582: return true;
19583: } finally {
19584: jj_save(43, xla);
19585: }
19586: }
19587:
19588: final private boolean jj_2_45(int xla) {
19589: jj_la = xla;
19590: jj_lastpos = jj_scanpos = token;
19591: try {
19592: return !jj_3_45();
19593: } catch (LookaheadSuccess ls) {
19594: return true;
19595: } finally {
19596: jj_save(44, xla);
19597: }
19598: }
19599:
19600: final private boolean jj_2_46(int xla) {
19601: jj_la = xla;
19602: jj_lastpos = jj_scanpos = token;
19603: try {
19604: return !jj_3_46();
19605: } catch (LookaheadSuccess ls) {
19606: return true;
19607: } finally {
19608: jj_save(45, xla);
19609: }
19610: }
19611:
19612: final private boolean jj_2_47(int xla) {
19613: jj_la = xla;
19614: jj_lastpos = jj_scanpos = token;
19615: try {
19616: return !jj_3_47();
19617: } catch (LookaheadSuccess ls) {
19618: return true;
19619: } finally {
19620: jj_save(46, xla);
19621: }
19622: }
19623:
19624: final private boolean jj_3R_193() {
19625: Token xsp;
19626: xsp = jj_scanpos;
19627: if (jj_3R_231()) {
19628: jj_scanpos = xsp;
19629: if (jj_3R_232())
19630: return true;
19631: }
19632: return false;
19633: }
19634:
19635: final private boolean jj_3R_231() {
19636: if (jj_scan_token(COUNT))
19637: return true;
19638: return false;
19639: }
19640:
19641: final private boolean jj_3R_238() {
19642: if (jj_scan_token(SQRT))
19643: return true;
19644: return false;
19645: }
19646:
19647: final private boolean jj_3R_237() {
19648: if (jj_scan_token(ABSVAL))
19649: return true;
19650: return false;
19651: }
19652:
19653: final private boolean jj_3R_197() {
19654: Token xsp;
19655: xsp = jj_scanpos;
19656: if (jj_3R_236()) {
19657: jj_scanpos = xsp;
19658: if (jj_3R_237()) {
19659: jj_scanpos = xsp;
19660: if (jj_3R_238()) {
19661: jj_scanpos = xsp;
19662: if (jj_3R_239()) {
19663: jj_scanpos = xsp;
19664: if (jj_3R_240())
19665: return true;
19666: }
19667: }
19668: }
19669: }
19670: return false;
19671: }
19672:
19673: final private boolean jj_3R_236() {
19674: if (jj_scan_token(ABS))
19675: return true;
19676: return false;
19677: }
19678:
19679: final private boolean jj_3R_105() {
19680: if (jj_3R_185())
19681: return true;
19682: return false;
19683: }
19684:
19685: final private boolean jj_3R_141() {
19686: if (jj_scan_token(CURRENT_TIMESTAMP))
19687: return true;
19688: return false;
19689: }
19690:
19691: final private boolean jj_3_7() {
19692: if (jj_3R_55())
19693: return true;
19694: return false;
19695: }
19696:
19697: final private boolean jj_3R_104() {
19698: if (jj_scan_token(VARCHAR))
19699: return true;
19700: return false;
19701: }
19702:
19703: final private boolean jj_3R_360() {
19704: if (jj_3R_332())
19705: return true;
19706: return false;
19707: }
19708:
19709: final private boolean jj_3R_205() {
19710: if (jj_3R_235())
19711: return true;
19712: return false;
19713: }
19714:
19715: final private boolean jj_3R_140() {
19716: if (jj_scan_token(CURRENT))
19717: return true;
19718: return false;
19719: }
19720:
19721: final private boolean jj_3R_303() {
19722: if (jj_scan_token(HEX_STRING))
19723: return true;
19724: return false;
19725: }
19726:
19727: final private boolean jj_3R_59() {
19728: Token xsp;
19729: xsp = jj_scanpos;
19730: if (jj_3R_104()) {
19731: jj_scanpos = xsp;
19732: if (jj_3R_105())
19733: return true;
19734: }
19735: return false;
19736: }
19737:
19738: final private boolean jj_3R_359() {
19739: if (jj_3R_331())
19740: return true;
19741: return false;
19742: }
19743:
19744: final private boolean jj_3R_139() {
19745: if (jj_scan_token(CURRENT_TIME))
19746: return true;
19747: return false;
19748: }
19749:
19750: final private boolean jj_3R_358() {
19751: if (jj_scan_token(IDENTIFIER))
19752: return true;
19753: return false;
19754: }
19755:
19756: final private boolean jj_3R_354() {
19757: Token xsp;
19758: xsp = jj_scanpos;
19759: if (jj_3R_358()) {
19760: jj_scanpos = xsp;
19761: if (jj_3R_359()) {
19762: jj_scanpos = xsp;
19763: if (jj_3R_360())
19764: return true;
19765: }
19766: }
19767: return false;
19768: }
19769:
19770: final private boolean jj_3R_175() {
19771: if (jj_3R_215())
19772: return true;
19773: return false;
19774: }
19775:
19776: final private boolean jj_3R_174() {
19777: if (jj_3R_214())
19778: return true;
19779: return false;
19780: }
19781:
19782: final private boolean jj_3R_138() {
19783: if (jj_scan_token(CURRENT))
19784: return true;
19785: return false;
19786: }
19787:
19788: final private boolean jj_3R_173() {
19789: if (jj_3R_213())
19790: return true;
19791: return false;
19792: }
19793:
19794: final private boolean jj_3R_60() {
19795: return false;
19796: }
19797:
19798: final private boolean jj_3R_137() {
19799: if (jj_scan_token(CURRENT_DATE))
19800: return true;
19801: return false;
19802: }
19803:
19804: final private boolean jj_3R_58() {
19805: return false;
19806: }
19807:
19808: final private boolean jj_3R_302() {
19809: if (jj_scan_token(STRING))
19810: return true;
19811: return false;
19812: }
19813:
19814: final private boolean jj_3R_171() {
19815: if (jj_3R_212())
19816: return true;
19817: return false;
19818: }
19819:
19820: final private boolean jj_3_13() {
19821: if (jj_3R_62())
19822: return true;
19823: return false;
19824: }
19825:
19826: final private boolean jj_3R_172() {
19827: if (jj_scan_token(BOOLEAN))
19828: return true;
19829: return false;
19830: }
19831:
19832: final private boolean jj_3_12() {
19833: Token xsp;
19834: xsp = jj_scanpos;
19835: lookingAhead = true;
19836: jj_semLA = getToken(3).kind != LARGE;
19837: lookingAhead = false;
19838: if (!jj_semLA || jj_3R_60())
19839: return true;
19840: if (jj_3R_61())
19841: return true;
19842: return false;
19843: }
19844:
19845: final private boolean jj_3R_136() {
19846: if (jj_scan_token(CURRENT))
19847: return true;
19848: return false;
19849: }
19850:
19851: final private boolean jj_3R_73() {
19852: Token xsp;
19853: xsp = jj_scanpos;
19854: lookingAhead = true;
19855: jj_semLA = (getToken(1).kind == CURRENT && getToken(2).kind == DATE);
19856: lookingAhead = false;
19857: if (!jj_semLA || jj_3R_136()) {
19858: jj_scanpos = xsp;
19859: if (jj_3R_137()) {
19860: jj_scanpos = xsp;
19861: lookingAhead = true;
19862: jj_semLA = (getToken(1).kind == CURRENT && getToken(2).kind == TIME);
19863: lookingAhead = false;
19864: if (!jj_semLA || jj_3R_138()) {
19865: jj_scanpos = xsp;
19866: if (jj_3R_139()) {
19867: jj_scanpos = xsp;
19868: lookingAhead = true;
19869: jj_semLA = (getToken(1).kind == CURRENT && getToken(2).kind == TIMESTAMP);
19870: lookingAhead = false;
19871: if (!jj_semLA || jj_3R_140()) {
19872: jj_scanpos = xsp;
19873: if (jj_3R_141())
19874: return true;
19875: }
19876: }
19877: }
19878: }
19879: }
19880: return false;
19881: }
19882:
19883: final private boolean jj_3_11() {
19884: Token xsp;
19885: xsp = jj_scanpos;
19886: lookingAhead = true;
19887: jj_semLA = getToken(2).kind != LARGE;
19888: lookingAhead = false;
19889: if (!jj_semLA || jj_3R_58())
19890: return true;
19891: if (jj_3R_59())
19892: return true;
19893: return false;
19894: }
19895:
19896: final private boolean jj_3R_343() {
19897: if (jj_scan_token(EXISTS))
19898: return true;
19899: return false;
19900: }
19901:
19902: final private boolean jj_3R_276() {
19903: if (jj_scan_token(TIMESTAMP))
19904: return true;
19905: return false;
19906: }
19907:
19908: final private boolean jj_3R_195() {
19909: if (jj_3R_235())
19910: return true;
19911: return false;
19912: }
19913:
19914: final private boolean jj_3R_351() {
19915: if (jj_3R_355())
19916: return true;
19917: return false;
19918: }
19919:
19920: final private boolean jj_3R_86() {
19921: Token xsp;
19922: xsp = jj_scanpos;
19923: if (jj_3_11()) {
19924: jj_scanpos = xsp;
19925: if (jj_3_12()) {
19926: jj_scanpos = xsp;
19927: if (jj_3_13()) {
19928: jj_scanpos = xsp;
19929: if (jj_3R_171()) {
19930: jj_scanpos = xsp;
19931: if (jj_3R_172()) {
19932: jj_scanpos = xsp;
19933: if (jj_3R_173()) {
19934: jj_scanpos = xsp;
19935: if (jj_3R_174()) {
19936: jj_scanpos = xsp;
19937: if (jj_3R_175())
19938: return true;
19939: }
19940: }
19941: }
19942: }
19943: }
19944: }
19945: }
19946: return false;
19947: }
19948:
19949: final private boolean jj_3R_350() {
19950: if (jj_3R_354())
19951: return true;
19952: return false;
19953: }
19954:
19955: final private boolean jj_3R_339() {
19956: Token xsp;
19957: xsp = jj_scanpos;
19958: if (jj_3R_350()) {
19959: jj_scanpos = xsp;
19960: if (jj_3R_351())
19961: return true;
19962: }
19963: return false;
19964: }
19965:
19966: final private boolean jj_3R_275() {
19967: if (jj_scan_token(TIME))
19968: return true;
19969: return false;
19970: }
19971:
19972: final private boolean jj_3R_212() {
19973: Token xsp;
19974: xsp = jj_scanpos;
19975: if (jj_3R_274()) {
19976: jj_scanpos = xsp;
19977: if (jj_3R_275()) {
19978: jj_scanpos = xsp;
19979: if (jj_3R_276())
19980: return true;
19981: }
19982: }
19983: return false;
19984: }
19985:
19986: final private boolean jj_3R_274() {
19987: if (jj_scan_token(DATE))
19988: return true;
19989: return false;
19990: }
19991:
19992: final private boolean jj_3R_216() {
19993: if (jj_scan_token(DELETE))
19994: return true;
19995: return false;
19996: }
19997:
19998: final private boolean jj_3_20() {
19999: if (jj_3R_68())
20000: return true;
20001: return false;
20002: }
20003:
20004: final private boolean jj_3R_357() {
20005: if (jj_scan_token(VALUES))
20006: return true;
20007: return false;
20008: }
20009:
20010: final private boolean jj_3R_95() {
20011: if (jj_scan_token(GRANT))
20012: return true;
20013: return false;
20014: }
20015:
20016: final private boolean jj_3R_181() {
20017: if (jj_3R_221())
20018: return true;
20019: return false;
20020: }
20021:
20022: final private boolean jj_3R_180() {
20023: if (jj_3R_220())
20024: return true;
20025: return false;
20026: }
20027:
20028: final private boolean jj_3R_94() {
20029: if (jj_scan_token(TRUNCATE))
20030: return true;
20031: return false;
20032: }
20033:
20034: final private boolean jj_3R_179() {
20035: if (jj_3R_219())
20036: return true;
20037: return false;
20038: }
20039:
20040: final private boolean jj_3R_178() {
20041: if (jj_3R_218())
20042: return true;
20043: return false;
20044: }
20045:
20046: final private boolean jj_3R_177() {
20047: if (jj_3R_217())
20048: return true;
20049: return false;
20050: }
20051:
20052: final private boolean jj_3R_93() {
20053: Token xsp;
20054: xsp = jj_scanpos;
20055: if (jj_3R_176()) {
20056: jj_scanpos = xsp;
20057: if (jj_3R_177()) {
20058: jj_scanpos = xsp;
20059: if (jj_3R_178()) {
20060: jj_scanpos = xsp;
20061: if (jj_3R_179()) {
20062: jj_scanpos = xsp;
20063: if (jj_3R_180()) {
20064: jj_scanpos = xsp;
20065: if (jj_3R_181())
20066: return true;
20067: }
20068: }
20069: }
20070: }
20071: }
20072: return false;
20073: }
20074:
20075: final private boolean jj_3R_176() {
20076: if (jj_3R_216())
20077: return true;
20078: return false;
20079: }
20080:
20081: final private boolean jj_3_6() {
20082: if (jj_3R_53())
20083: return true;
20084: return false;
20085: }
20086:
20087: final private boolean jj_3_5() {
20088: if (jj_3R_54())
20089: return true;
20090: return false;
20091: }
20092:
20093: final private boolean jj_3R_304() {
20094: if (jj_scan_token(LEFT_BRACE))
20095: return true;
20096: return false;
20097: }
20098:
20099: final private boolean jj_3_4() {
20100: if (jj_3R_54())
20101: return true;
20102: return false;
20103: }
20104:
20105: final private boolean jj_3R_88() {
20106: if (jj_scan_token(SET))
20107: return true;
20108: return false;
20109: }
20110:
20111: final private boolean jj_3_3() {
20112: if (jj_3R_53())
20113: return true;
20114: return false;
20115: }
20116:
20117: final private boolean jj_3R_87() {
20118: if (jj_scan_token(SET))
20119: return true;
20120: return false;
20121: }
20122:
20123: final private boolean jj_3R_43() {
20124: Token xsp;
20125: xsp = jj_scanpos;
20126: lookingAhead = true;
20127: jj_semLA = getToken(1).kind == SET
20128: && getToken(2).kind != CURRENT;
20129: lookingAhead = false;
20130: if (!jj_semLA || jj_3R_87()) {
20131: jj_scanpos = xsp;
20132: lookingAhead = true;
20133: jj_semLA = getToken(1).kind == SET
20134: && getToken(2).kind == CURRENT;
20135: lookingAhead = false;
20136: if (!jj_semLA || jj_3R_88())
20137: return true;
20138: }
20139: return false;
20140: }
20141:
20142: final private boolean jj_3R_150() {
20143: if (jj_3R_68())
20144: return true;
20145: return false;
20146: }
20147:
20148: final private boolean jj_3R_335() {
20149: if (jj_3R_343())
20150: return true;
20151: return false;
20152: }
20153:
20154: final private boolean jj_3_19() {
20155: if (jj_3R_68())
20156: return true;
20157: return false;
20158: }
20159:
20160: final private boolean jj_3R_249() {
20161: if (jj_scan_token(XMLQUERY))
20162: return true;
20163: return false;
20164: }
20165:
20166: final private boolean jj_3R_91() {
20167: if (jj_scan_token(ALTER))
20168: return true;
20169: return false;
20170: }
20171:
20172: final private boolean jj_3R_318() {
20173: Token xsp;
20174: xsp = jj_scanpos;
20175: if (jj_3_19()) {
20176: jj_scanpos = xsp;
20177: if (jj_3R_335())
20178: return true;
20179: }
20180: return false;
20181: }
20182:
20183: final private boolean jj_3R_248() {
20184: if (jj_scan_token(XMLEXISTS))
20185: return true;
20186: return false;
20187: }
20188:
20189: final private boolean jj_3R_79() {
20190: if (jj_3R_150())
20191: return true;
20192: return false;
20193: }
20194:
20195: final private boolean jj_3R_289() {
20196: if (jj_3R_308())
20197: return true;
20198: return false;
20199: }
20200:
20201: final private boolean jj_3R_247() {
20202: if (jj_scan_token(XMLSERIALIZE))
20203: return true;
20204: return false;
20205: }
20206:
20207: final private boolean jj_3_45() {
20208: if (jj_3R_68())
20209: return true;
20210: return false;
20211: }
20212:
20213: final private boolean jj_3R_199() {
20214: Token xsp;
20215: xsp = jj_scanpos;
20216: if (jj_3R_246()) {
20217: jj_scanpos = xsp;
20218: if (jj_3R_247()) {
20219: jj_scanpos = xsp;
20220: if (jj_3R_248()) {
20221: jj_scanpos = xsp;
20222: if (jj_3R_249())
20223: return true;
20224: }
20225: }
20226: }
20227: return false;
20228: }
20229:
20230: final private boolean jj_3R_246() {
20231: if (jj_scan_token(XMLPARSE))
20232: return true;
20233: return false;
20234: }
20235:
20236: final private boolean jj_3_36() {
20237: if (jj_3R_79())
20238: return true;
20239: return false;
20240: }
20241:
20242: final private boolean jj_3R_298() {
20243: if (jj_3R_318())
20244: return true;
20245: return false;
20246: }
20247:
20248: final private boolean jj_3R_90() {
20249: if (jj_scan_token(DROP))
20250: return true;
20251: return false;
20252: }
20253:
20254: final private boolean jj_3_24() {
20255: if (jj_3R_71())
20256: return true;
20257: return false;
20258: }
20259:
20260: final private boolean jj_3R_295() {
20261: if (jj_3R_205())
20262: return true;
20263: return false;
20264: }
20265:
20266: final private boolean jj_3R_273() {
20267: if (jj_scan_token(DROP))
20268: return true;
20269: return false;
20270: }
20271:
20272: final private boolean jj_3R_322() {
20273: if (jj_scan_token(APPROXIMATE_NUMERIC))
20274: return true;
20275: return false;
20276: }
20277:
20278: final private boolean jj_3R_143() {
20279: if (jj_3R_202())
20280: return true;
20281: return false;
20282: }
20283:
20284: final private boolean jj_3_33() {
20285: if (jj_3R_78())
20286: return true;
20287: return false;
20288: }
20289:
20290: final private boolean jj_3R_348() {
20291: if (jj_scan_token(MINUTE))
20292: return true;
20293: return false;
20294: }
20295:
20296: final private boolean jj_3R_332() {
20297: Token xsp;
20298: xsp = jj_scanpos;
20299: if (jj_scan_token(260)) {
20300: jj_scanpos = xsp;
20301: if (jj_scan_token(261)) {
20302: jj_scanpos = xsp;
20303: if (jj_scan_token(262)) {
20304: jj_scanpos = xsp;
20305: if (jj_scan_token(354)) {
20306: jj_scanpos = xsp;
20307: if (jj_scan_token(263)) {
20308: jj_scanpos = xsp;
20309: if (jj_scan_token(355)) {
20310: jj_scanpos = xsp;
20311: if (jj_scan_token(74)) {
20312: jj_scanpos = xsp;
20313: if (jj_scan_token(264)) {
20314: jj_scanpos = xsp;
20315: if (jj_scan_token(265)) {
20316: jj_scanpos = xsp;
20317: if (jj_scan_token(266)) {
20318: jj_scanpos = xsp;
20319: if (jj_scan_token(356)) {
20320: jj_scanpos = xsp;
20321: if (jj_scan_token(267)) {
20322: jj_scanpos = xsp;
20323: if (jj_scan_token(87)) {
20324: jj_scanpos = xsp;
20325: if (jj_scan_token(268)) {
20326: jj_scanpos = xsp;
20327: if (jj_scan_token(269)) {
20328: jj_scanpos = xsp;
20329: if (jj_scan_token(357)) {
20330: jj_scanpos = xsp;
20331: if (jj_scan_token(270)) {
20332: jj_scanpos = xsp;
20333: if (jj_scan_token(271)) {
20334: jj_scanpos = xsp;
20335: if (jj_scan_token(358)) {
20336: jj_scanpos = xsp;
20337: if (jj_scan_token(99)) {
20338: jj_scanpos = xsp;
20339: if (jj_scan_token(359)) {
20340: jj_scanpos = xsp;
20341: if (jj_scan_token(339)) {
20342: jj_scanpos = xsp;
20343: if (jj_scan_token(340)) {
20344: jj_scanpos = xsp;
20345: if (jj_scan_token(107)) {
20346: jj_scanpos = xsp;
20347: if (jj_scan_token(272)) {
20348: jj_scanpos = xsp;
20349: if (jj_scan_token(273)) {
20350: jj_scanpos = xsp;
20351: if (jj_scan_token(274)) {
20352: jj_scanpos = xsp;
20353: if (jj_scan_token(362)) {
20354: jj_scanpos = xsp;
20355: if (jj_scan_token(276)) {
20356: jj_scanpos = xsp;
20357: if (jj_scan_token(341)) {
20358: jj_scanpos = xsp;
20359: if (jj_scan_token(361)) {
20360: jj_scanpos = xsp;
20361: if (jj_scan_token(363)) {
20362: jj_scanpos = xsp;
20363: if (jj_scan_token(364)) {
20364: jj_scanpos = xsp;
20365: if (jj_scan_token(365)) {
20366: jj_scanpos = xsp;
20367: if (jj_scan_token(366)) {
20368: jj_scanpos = xsp;
20369: if (jj_scan_token(367)) {
20370: jj_scanpos = xsp;
20371: if (jj_scan_token(277)) {
20372: jj_scanpos = xsp;
20373: if (jj_scan_token(278)) {
20374: jj_scanpos = xsp;
20375: if (jj_scan_token(279)) {
20376: jj_scanpos = xsp;
20377: if (jj_scan_token(280)) {
20378: jj_scanpos = xsp;
20379: if (jj_scan_token(368)) {
20380: jj_scanpos = xsp;
20381: if (jj_scan_token(281)) {
20382: jj_scanpos = xsp;
20383: if (jj_scan_token(283)) {
20384: jj_scanpos = xsp;
20385: if (jj_scan_token(369)) {
20386: jj_scanpos = xsp;
20387: if (jj_scan_token(285)) {
20388: jj_scanpos = xsp;
20389: if (jj_scan_token(286)) {
20390: jj_scanpos = xsp;
20391: if (jj_scan_token(370)) {
20392: jj_scanpos = xsp;
20393: if (jj_scan_token(287)) {
20394: jj_scanpos = xsp;
20395: if (jj_scan_token(288)) {
20396: jj_scanpos = xsp;
20397: if (jj_scan_token(371)) {
20398: jj_scanpos = xsp;
20399: if (jj_scan_token(372)) {
20400: jj_scanpos = xsp;
20401: if (jj_scan_token(289)) {
20402: jj_scanpos = xsp;
20403: if (jj_scan_token(290)) {
20404: jj_scanpos = xsp;
20405: if (jj_scan_token(291)) {
20406: jj_scanpos = xsp;
20407: if (jj_scan_token(345)) {
20408: jj_scanpos = xsp;
20409: if (jj_scan_token(373)) {
20410: jj_scanpos = xsp;
20411: if (jj_scan_token(374)) {
20412: jj_scanpos = xsp;
20413: if (jj_scan_token(292)) {
20414: jj_scanpos = xsp;
20415: if (jj_scan_token(375)) {
20416: jj_scanpos = xsp;
20417: if (jj_scan_token(293)) {
20418: jj_scanpos = xsp;
20419: if (jj_scan_token(294)) {
20420: jj_scanpos = xsp;
20421: if (jj_scan_token(176)) {
20422: jj_scanpos = xsp;
20423: if (jj_scan_token(295)) {
20424: jj_scanpos = xsp;
20425: if (jj_scan_token(296)) {
20426: jj_scanpos = xsp;
20427: if (jj_scan_token(297)) {
20428: jj_scanpos = xsp;
20429: if (jj_scan_token(298)) {
20430: jj_scanpos = xsp;
20431: if (jj_scan_token(299)) {
20432: jj_scanpos = xsp;
20433: if (jj_scan_token(376)) {
20434: jj_scanpos = xsp;
20435: if (jj_scan_token(377)) {
20436: jj_scanpos = xsp;
20437: if (jj_scan_token(300)) {
20438: jj_scanpos = xsp;
20439: if (jj_scan_token(301)) {
20440: jj_scanpos = xsp;
20441: if (jj_scan_token(302)) {
20442: jj_scanpos = xsp;
20443: if (jj_scan_token(380)) {
20444: jj_scanpos = xsp;
20445: if (jj_scan_token(381)) {
20446: jj_scanpos = xsp;
20447: if (jj_scan_token(382)) {
20448: jj_scanpos = xsp;
20449: if (jj_scan_token(379)) {
20450: jj_scanpos = xsp;
20451: if (jj_scan_token(303)) {
20452: jj_scanpos = xsp;
20453: if (jj_scan_token(385)) {
20454: jj_scanpos = xsp;
20455: if (jj_scan_token(304)) {
20456: jj_scanpos = xsp;
20457: if (jj_scan_token(305)) {
20458: jj_scanpos = xsp;
20459: if (jj_scan_token(386)) {
20460: jj_scanpos = xsp;
20461: if (jj_scan_token(387)) {
20462: jj_scanpos = xsp;
20463: if (jj_scan_token(388)) {
20464: jj_scanpos = xsp;
20465: if (jj_scan_token(306)) {
20466: jj_scanpos = xsp;
20467: if (jj_scan_token(390)) {
20468: jj_scanpos = xsp;
20469: if (jj_scan_token(307)) {
20470: jj_scanpos = xsp;
20471: if (jj_scan_token(389)) {
20472: jj_scanpos = xsp;
20473: if (jj_scan_token(391)) {
20474: jj_scanpos = xsp;
20475: if (jj_scan_token(308)) {
20476: jj_scanpos = xsp;
20477: if (jj_scan_token(392)) {
20478: jj_scanpos = xsp;
20479: if (jj_scan_token(393)) {
20480: jj_scanpos = xsp;
20481: if (jj_scan_token(394)) {
20482: jj_scanpos = xsp;
20483: if (jj_scan_token(309)) {
20484: jj_scanpos = xsp;
20485: if (jj_scan_token(310)) {
20486: jj_scanpos = xsp;
20487: if (jj_scan_token(395)) {
20488: jj_scanpos = xsp;
20489: if (jj_scan_token(396)) {
20490: jj_scanpos = xsp;
20491: if (jj_scan_token(312)) {
20492: jj_scanpos = xsp;
20493: if (jj_scan_token(311)) {
20494: jj_scanpos = xsp;
20495: if (jj_scan_token(397)) {
20496: jj_scanpos = xsp;
20497: if (jj_scan_token(398)) {
20498: jj_scanpos = xsp;
20499: if (jj_scan_token(314)) {
20500: jj_scanpos = xsp;
20501: if (jj_scan_token(399)) {
20502: jj_scanpos = xsp;
20503: if (jj_scan_token(400)) {
20504: jj_scanpos = xsp;
20505: if (jj_scan_token(402)) {
20506: jj_scanpos = xsp;
20507: if (jj_scan_token(401)) {
20508: jj_scanpos = xsp;
20509: if (jj_scan_token(315)) {
20510: jj_scanpos = xsp;
20511: if (jj_scan_token(316)) {
20512: jj_scanpos = xsp;
20513: if (jj_scan_token(317)) {
20514: jj_scanpos = xsp;
20515: if (jj_scan_token(318)) {
20516: jj_scanpos = xsp;
20517: if (jj_scan_token(319)) {
20518: jj_scanpos = xsp;
20519: if (jj_scan_token(320)) {
20520: jj_scanpos = xsp;
20521: if (jj_scan_token(321)) {
20522: jj_scanpos = xsp;
20523: if (jj_scan_token(322)) {
20524: jj_scanpos = xsp;
20525: if (jj_scan_token(323)) {
20526: jj_scanpos = xsp;
20527: if (jj_scan_token(403)) {
20528: jj_scanpos = xsp;
20529: if (jj_scan_token(404)) {
20530: jj_scanpos = xsp;
20531: if (jj_scan_token(324)) {
20532: jj_scanpos = xsp;
20533: if (jj_scan_token(325)) {
20534: jj_scanpos = xsp;
20535: if (jj_scan_token(405)) {
20536: jj_scanpos = xsp;
20537: if (jj_scan_token(326)) {
20538: jj_scanpos = xsp;
20539: if (jj_scan_token(406)) {
20540: jj_scanpos = xsp;
20541: if (jj_scan_token(230)) {
20542: jj_scanpos = xsp;
20543: if (jj_scan_token(327)) {
20544: jj_scanpos = xsp;
20545: if (jj_scan_token(328)) {
20546: jj_scanpos = xsp;
20547: if (jj_scan_token(329)) {
20548: jj_scanpos = xsp;
20549: if (jj_scan_token(330)) {
20550: jj_scanpos = xsp;
20551: if (jj_scan_token(331)) {
20552: jj_scanpos = xsp;
20553: if (jj_scan_token(407)) {
20554: jj_scanpos = xsp;
20555: if (jj_scan_token(332)) {
20556: jj_scanpos = xsp;
20557: if (jj_scan_token(240)) {
20558: jj_scanpos = xsp;
20559: if (jj_scan_token(333)) {
20560: jj_scanpos = xsp;
20561: if (jj_scan_token(408)) {
20562: jj_scanpos = xsp;
20563: if (jj_scan_token(334)) {
20564: jj_scanpos = xsp;
20565: if (jj_scan_token(409)) {
20566: jj_scanpos = xsp;
20567: if (jj_scan_token(335)) {
20568: jj_scanpos = xsp;
20569: if (jj_scan_token(248)) {
20570: jj_scanpos = xsp;
20571: if (jj_scan_token(250)) {
20572: jj_scanpos = xsp;
20573: if (jj_scan_token(384)) {
20574: jj_scanpos = xsp;
20575: if (jj_scan_token(336)) {
20576: jj_scanpos = xsp;
20577: if (jj_scan_token(410))
20578: return true;
20579: }
20580: }
20581: }
20582: }
20583: }
20584: }
20585: }
20586: }
20587: }
20588: }
20589: }
20590: }
20591: }
20592: }
20593: }
20594: }
20595: }
20596: }
20597: }
20598: }
20599: }
20600: }
20601: }
20602: }
20603: }
20604: }
20605: }
20606: }
20607: }
20608: }
20609: }
20610: }
20611: }
20612: }
20613: }
20614: }
20615: }
20616: }
20617: }
20618: }
20619: }
20620: }
20621: }
20622: }
20623: }
20624: }
20625: }
20626: }
20627: }
20628: }
20629: }
20630: }
20631: }
20632: }
20633: }
20634: }
20635: }
20636: }
20637: }
20638: }
20639: }
20640: }
20641: }
20642: }
20643: }
20644: }
20645: }
20646: }
20647: }
20648: }
20649: }
20650: }
20651: }
20652: }
20653: }
20654: }
20655: }
20656: }
20657: }
20658: }
20659: }
20660: }
20661: }
20662: }
20663: }
20664: }
20665: }
20666: }
20667: }
20668: }
20669: }
20670: }
20671: }
20672: }
20673: }
20674: }
20675: }
20676: }
20677: }
20678: }
20679: }
20680: }
20681: }
20682: }
20683: }
20684: }
20685: }
20686: }
20687: }
20688: }
20689: }
20690: }
20691: }
20692: }
20693: }
20694: }
20695: }
20696: }
20697: }
20698: }
20699: }
20700: }
20701: }
20702: }
20703: }
20704: }
20705: }
20706: }
20707: }
20708: }
20709: }
20710: }
20711: }
20712: }
20713: }
20714: }
20715: }
20716: }
20717: }
20718: return false;
20719: }
20720:
20721: final private boolean jj_3R_347() {
20722: if (jj_scan_token(HOUR))
20723: return true;
20724: return false;
20725: }
20726:
20727: final private boolean jj_3R_103() {
20728: if (jj_scan_token(ON))
20729: return true;
20730: return false;
20731: }
20732:
20733: final private boolean jj_3R_346() {
20734: if (jj_scan_token(DAY))
20735: return true;
20736: return false;
20737: }
20738:
20739: final private boolean jj_3R_89() {
20740: if (jj_scan_token(CREATE))
20741: return true;
20742: return false;
20743: }
20744:
20745: final private boolean jj_3_28() {
20746: if (jj_3R_75())
20747: return true;
20748: return false;
20749: }
20750:
20751: final private boolean jj_3R_321() {
20752: if (jj_scan_token(EXACT_NUMERIC))
20753: return true;
20754: return false;
20755: }
20756:
20757: final private boolean jj_3R_301() {
20758: Token xsp;
20759: xsp = jj_scanpos;
20760: if (jj_3R_321()) {
20761: jj_scanpos = xsp;
20762: if (jj_3R_322())
20763: return true;
20764: }
20765: return false;
20766: }
20767:
20768: final private boolean jj_3R_102() {
20769: if (jj_scan_token(ON))
20770: return true;
20771: return false;
20772: }
20773:
20774: final private boolean jj_3R_250() {
20775: if (jj_3R_298())
20776: return true;
20777: return false;
20778: }
20779:
20780: final private boolean jj_3R_272() {
20781: if (jj_scan_token(DROP))
20782: return true;
20783: return false;
20784: }
20785:
20786: final private boolean jj_3R_101() {
20787: if (jj_scan_token(NOT))
20788: return true;
20789: return false;
20790: }
20791:
20792: final private boolean jj_3R_345() {
20793: if (jj_scan_token(MONTH))
20794: return true;
20795: return false;
20796: }
20797:
20798: final private boolean jj_3R_74() {
20799: Token xsp;
20800: xsp = jj_scanpos;
20801: if (jj_3R_142()) {
20802: jj_scanpos = xsp;
20803: if (jj_3_28()) {
20804: jj_scanpos = xsp;
20805: if (jj_3R_143())
20806: return true;
20807: }
20808: }
20809: return false;
20810: }
20811:
20812: final private boolean jj_3R_142() {
20813: if (jj_3R_201())
20814: return true;
20815: return false;
20816: }
20817:
20818: final private boolean jj_3R_344() {
20819: if (jj_scan_token(YEAR))
20820: return true;
20821: return false;
20822: }
20823:
20824: final private boolean jj_3R_336() {
20825: Token xsp;
20826: xsp = jj_scanpos;
20827: if (jj_3R_344()) {
20828: jj_scanpos = xsp;
20829: if (jj_3R_345()) {
20830: jj_scanpos = xsp;
20831: if (jj_3R_346()) {
20832: jj_scanpos = xsp;
20833: if (jj_3R_347()) {
20834: jj_scanpos = xsp;
20835: if (jj_3R_348())
20836: return true;
20837: }
20838: }
20839: }
20840: }
20841: return false;
20842: }
20843:
20844: final private boolean jj_3R_52() {
20845: if (jj_3R_97())
20846: return true;
20847: return false;
20848: }
20849:
20850: final private boolean jj_3R_51() {
20851: if (jj_3R_96())
20852: return true;
20853: return false;
20854: }
20855:
20856: final private boolean jj_3R_50() {
20857: if (jj_3R_95())
20858: return true;
20859: return false;
20860: }
20861:
20862: final private boolean jj_3R_57() {
20863: Token xsp;
20864: xsp = jj_scanpos;
20865: if (jj_3R_101()) {
20866: jj_scanpos = xsp;
20867: lookingAhead = true;
20868: jj_semLA = getToken(1).kind == ON
20869: && getToken(2).kind == COMMIT;
20870: lookingAhead = false;
20871: if (!jj_semLA || jj_3R_102()) {
20872: jj_scanpos = xsp;
20873: lookingAhead = true;
20874: jj_semLA = getToken(1).kind == ON
20875: && getToken(2).kind == ROLLBACK;
20876: lookingAhead = false;
20877: if (!jj_semLA || jj_3R_103())
20878: return true;
20879: }
20880: }
20881: return false;
20882: }
20883:
20884: final private boolean jj_3R_49() {
20885: if (jj_3R_94())
20886: return true;
20887: return false;
20888: }
20889:
20890: final private boolean jj_3R_271() {
20891: if (jj_scan_token(DROP))
20892: return true;
20893: return false;
20894: }
20895:
20896: final private boolean jj_3_1() {
20897: if (jj_3R_43())
20898: return true;
20899: return false;
20900: }
20901:
20902: final private boolean jj_3R_48() {
20903: if (jj_3R_93())
20904: return true;
20905: return false;
20906: }
20907:
20908: final private boolean jj_3R_47() {
20909: if (jj_3R_92())
20910: return true;
20911: return false;
20912: }
20913:
20914: final private boolean jj_3R_46() {
20915: if (jj_3R_91())
20916: return true;
20917: return false;
20918: }
20919:
20920: final private boolean jj_3R_45() {
20921: if (jj_3R_90())
20922: return true;
20923: return false;
20924: }
20925:
20926: final private boolean jj_3R_44() {
20927: if (jj_3R_89())
20928: return true;
20929: return false;
20930: }
20931:
20932: final private boolean jj_3R_134() {
20933: if (jj_3R_199())
20934: return true;
20935: return false;
20936: }
20937:
20938: final private boolean jj_3_10() {
20939: if (jj_3R_57())
20940: return true;
20941: return false;
20942: }
20943:
20944: final private boolean jj_3R_206() {
20945: if (jj_scan_token(LEFT_PAREN))
20946: return true;
20947: return false;
20948: }
20949:
20950: final private boolean jj_3R_264() {
20951: if (jj_3R_305())
20952: return true;
20953: return false;
20954: }
20955:
20956: final private boolean jj_3_2() {
20957: Token xsp;
20958: xsp = jj_scanpos;
20959: if (jj_3R_44()) {
20960: jj_scanpos = xsp;
20961: if (jj_3R_45()) {
20962: jj_scanpos = xsp;
20963: if (jj_3R_46()) {
20964: jj_scanpos = xsp;
20965: if (jj_3R_47()) {
20966: jj_scanpos = xsp;
20967: if (jj_3R_48()) {
20968: jj_scanpos = xsp;
20969: if (jj_3_1()) {
20970: jj_scanpos = xsp;
20971: if (jj_3R_49()) {
20972: jj_scanpos = xsp;
20973: if (jj_3R_50()) {
20974: jj_scanpos = xsp;
20975: if (jj_3R_51()) {
20976: jj_scanpos = xsp;
20977: if (jj_3R_52())
20978: return true;
20979: }
20980: }
20981: }
20982: }
20983: }
20984: }
20985: }
20986: }
20987: }
20988: return false;
20989: }
20990:
20991: final private boolean jj_3R_270() {
20992: if (jj_scan_token(DROP))
20993: return true;
20994: return false;
20995: }
20996:
20997: final private boolean jj_3R_263() {
20998: if (jj_3R_304())
20999: return true;
21000: return false;
21001: }
21002:
21003: final private boolean jj_3R_230() {
21004: if (jj_scan_token(CASE))
21005: return true;
21006: return false;
21007: }
21008:
21009: final private boolean jj_3R_200() {
21010: Token xsp;
21011: xsp = jj_scanpos;
21012: if (jj_scan_token(182))
21013: jj_scanpos = xsp;
21014: if (jj_3R_250())
21015: return true;
21016: return false;
21017: }
21018:
21019: final private boolean jj_3R_262() {
21020: if (jj_3R_303())
21021: return true;
21022: return false;
21023: }
21024:
21025: final private boolean jj_3R_92() {
21026: if (jj_scan_token(DECLARE))
21027: return true;
21028: return false;
21029: }
21030:
21031: final private boolean jj_3R_308() {
21032: if (jj_3R_328())
21033: return true;
21034: return false;
21035: }
21036:
21037: final private boolean jj_3R_261() {
21038: if (jj_3R_302())
21039: return true;
21040: return false;
21041: }
21042:
21043: final private boolean jj_3R_133() {
21044: if (jj_scan_token(LENGTH))
21045: return true;
21046: return false;
21047: }
21048:
21049: final private boolean jj_3R_300() {
21050: if (jj_3R_291())
21051: return true;
21052: return false;
21053: }
21054:
21055: final private boolean jj_3R_207() {
21056: Token xsp;
21057: xsp = jj_scanpos;
21058: if (jj_3R_260()) {
21059: jj_scanpos = xsp;
21060: if (jj_3R_261()) {
21061: jj_scanpos = xsp;
21062: if (jj_3R_262()) {
21063: jj_scanpos = xsp;
21064: if (jj_3R_263()) {
21065: jj_scanpos = xsp;
21066: if (jj_3R_264())
21067: return true;
21068: }
21069: }
21070: }
21071: }
21072: return false;
21073: }
21074:
21075: final private boolean jj_3R_260() {
21076: Token xsp;
21077: xsp = jj_scanpos;
21078: if (jj_3R_300())
21079: jj_scanpos = xsp;
21080: if (jj_3R_301())
21081: return true;
21082: return false;
21083: }
21084:
21085: final private boolean jj_3R_210() {
21086: Token xsp;
21087: xsp = jj_scanpos;
21088: lookingAhead = true;
21089: jj_semLA = getToken(2).kind == CONSTRAINT;
21090: lookingAhead = false;
21091: if (!jj_semLA || jj_3R_269()) {
21092: jj_scanpos = xsp;
21093: lookingAhead = true;
21094: jj_semLA = getToken(2).kind == PRIMARY;
21095: lookingAhead = false;
21096: if (!jj_semLA || jj_3R_270()) {
21097: jj_scanpos = xsp;
21098: lookingAhead = true;
21099: jj_semLA = getToken(2).kind == FOREIGN;
21100: lookingAhead = false;
21101: if (!jj_semLA || jj_3R_271()) {
21102: jj_scanpos = xsp;
21103: lookingAhead = true;
21104: jj_semLA = getToken(2).kind == UNIQUE;
21105: lookingAhead = false;
21106: if (!jj_semLA || jj_3R_272()) {
21107: jj_scanpos = xsp;
21108: if (jj_3R_273())
21109: return true;
21110: }
21111: }
21112: }
21113: }
21114: return false;
21115: }
21116:
21117: final private boolean jj_3R_269() {
21118: if (jj_scan_token(DROP))
21119: return true;
21120: return false;
21121: }
21122:
21123: final private boolean jj_3R_132() {
21124: if (jj_scan_token(VALUE))
21125: return true;
21126: return false;
21127: }
21128:
21129: final private boolean jj_3R_192() {
21130: if (jj_scan_token(NEW))
21131: return true;
21132: return false;
21133: }
21134:
21135: final private boolean jj_3R_131() {
21136: if (jj_scan_token(COALESCE))
21137: return true;
21138: return false;
21139: }
21140:
21141: final private boolean jj_3R_328() {
21142: if (jj_3R_339())
21143: return true;
21144: return false;
21145: }
21146:
21147: final private boolean jj_3_27() {
21148: if (jj_3R_74())
21149: return true;
21150: return false;
21151: }
21152:
21153: final private boolean jj_3R_229() {
21154: if (jj_scan_token(NULLIF))
21155: return true;
21156: return false;
21157: }
21158:
21159: final private boolean jj_3R_222() {
21160: if (jj_3R_289())
21161: return true;
21162: return false;
21163: }
21164:
21165: final private boolean jj_3R_130() {
21166: if (jj_3R_198())
21167: return true;
21168: return false;
21169: }
21170:
21171: final private boolean jj_3R_228() {
21172: if (jj_3R_293())
21173: return true;
21174: return false;
21175: }
21176:
21177: final private boolean jj_3R_160() {
21178: if (jj_3R_207())
21179: return true;
21180: return false;
21181: }
21182:
21183: final private boolean jj_3R_135() {
21184: if (jj_3R_200())
21185: return true;
21186: return false;
21187: }
21188:
21189: final private boolean jj_3R_129() {
21190: if (jj_3R_197())
21191: return true;
21192: return false;
21193: }
21194:
21195: final private boolean jj_3R_191() {
21196: Token xsp;
21197: xsp = jj_scanpos;
21198: if (jj_3R_227()) {
21199: jj_scanpos = xsp;
21200: if (jj_3R_228()) {
21201: jj_scanpos = xsp;
21202: if (jj_3R_229()) {
21203: jj_scanpos = xsp;
21204: if (jj_3R_230())
21205: return true;
21206: }
21207: }
21208: }
21209: return false;
21210: }
21211:
21212: final private boolean jj_3R_227() {
21213: if (jj_3R_207())
21214: return true;
21215: return false;
21216: }
21217:
21218: final private boolean jj_3_35() {
21219: if (jj_3R_68())
21220: return true;
21221: return false;
21222: }
21223:
21224: final private boolean jj_3R_342() {
21225: if (jj_scan_token(SESSION_USER))
21226: return true;
21227: return false;
21228: }
21229:
21230: final private boolean jj_3_43() {
21231: if (jj_3R_73())
21232: return true;
21233: return false;
21234: }
21235:
21236: final private boolean jj_3_23() {
21237: if (jj_3R_70())
21238: return true;
21239: return false;
21240: }
21241:
21242: final private boolean jj_3R_341() {
21243: if (jj_scan_token(CURRENT_USER))
21244: return true;
21245: return false;
21246: }
21247:
21248: final private boolean jj_3R_128() {
21249: if (jj_scan_token(GET_CURRENT_CONNECTION))
21250: return true;
21251: return false;
21252: }
21253:
21254: final private boolean jj_3R_71() {
21255: Token xsp;
21256: xsp = jj_scanpos;
21257: if (jj_3R_128()) {
21258: jj_scanpos = xsp;
21259: if (jj_3R_129()) {
21260: jj_scanpos = xsp;
21261: if (jj_3R_130()) {
21262: jj_scanpos = xsp;
21263: if (jj_3_27()) {
21264: jj_scanpos = xsp;
21265: if (jj_3R_131()) {
21266: jj_scanpos = xsp;
21267: if (jj_3R_132()) {
21268: jj_scanpos = xsp;
21269: if (jj_3R_133()) {
21270: jj_scanpos = xsp;
21271: if (jj_3R_134())
21272: return true;
21273: }
21274: }
21275: }
21276: }
21277: }
21278: }
21279: }
21280: return false;
21281: }
21282:
21283: final private boolean jj_3R_100() {
21284: Token xsp;
21285: xsp = jj_scanpos;
21286: lookingAhead = true;
21287: jj_semLA = javaClassFollows();
21288: lookingAhead = false;
21289: if (!jj_semLA || jj_3R_184()) {
21290: jj_scanpos = xsp;
21291: if (jj_3_23())
21292: return true;
21293: }
21294: return false;
21295: }
21296:
21297: final private boolean jj_3R_184() {
21298: if (jj_3R_222())
21299: return true;
21300: return false;
21301: }
21302:
21303: final private boolean jj_3R_340() {
21304: if (jj_scan_token(USER))
21305: return true;
21306: return false;
21307: }
21308:
21309: final private boolean jj_3R_330() {
21310: Token xsp;
21311: xsp = jj_scanpos;
21312: if (jj_3R_340()) {
21313: jj_scanpos = xsp;
21314: if (jj_3R_341()) {
21315: jj_scanpos = xsp;
21316: if (jj_3R_342())
21317: return true;
21318: }
21319: }
21320: return false;
21321: }
21322:
21323: final private boolean jj_3R_72() {
21324: if (jj_3R_135())
21325: return true;
21326: return false;
21327: }
21328:
21329: final private boolean jj_3R_159() {
21330: if (jj_3R_194())
21331: return true;
21332: return false;
21333: }
21334:
21335: final private boolean jj_3R_312() {
21336: if (jj_3R_330())
21337: return true;
21338: return false;
21339: }
21340:
21341: final private boolean jj_3R_211() {
21342: if (jj_scan_token(LOCKSIZE))
21343: return true;
21344: return false;
21345: }
21346:
21347: final private boolean jj_3R_311() {
21348: if (jj_3R_329())
21349: return true;
21350: return false;
21351: }
21352:
21353: final private boolean jj_3R_293() {
21354: Token xsp;
21355: xsp = jj_scanpos;
21356: if (jj_3R_311()) {
21357: jj_scanpos = xsp;
21358: if (jj_3R_312())
21359: return true;
21360: }
21361: return false;
21362: }
21363:
21364: final private boolean jj_3R_234() {
21365: if (jj_3R_295())
21366: return true;
21367: return false;
21368: }
21369:
21370: final private boolean jj_3R_158() {
21371: if (jj_3R_194())
21372: return true;
21373: return false;
21374: }
21375:
21376: final private boolean jj_3R_149() {
21377: if (jj_3R_204())
21378: return true;
21379: return false;
21380: }
21381:
21382: final private boolean jj_3_26() {
21383: if (jj_3R_73())
21384: return true;
21385: return false;
21386: }
21387:
21388: final private boolean jj_3R_78() {
21389: Token xsp;
21390: xsp = jj_scanpos;
21391: if (jj_3_22()) {
21392: jj_scanpos = xsp;
21393: if (jj_3R_149())
21394: return true;
21395: }
21396: return false;
21397: }
21398:
21399: final private boolean jj_3_22() {
21400: if (jj_3R_68())
21401: return true;
21402: return false;
21403: }
21404:
21405: final private boolean jj_3R_288() {
21406: if (jj_scan_token(RELEASE))
21407: return true;
21408: return false;
21409: }
21410:
21411: final private boolean jj_3R_157() {
21412: if (jj_scan_token(USER))
21413: return true;
21414: return false;
21415: }
21416:
21417: final private boolean jj_3R_287() {
21418: if (jj_scan_token(ROLLBACK))
21419: return true;
21420: return false;
21421: }
21422:
21423: final private boolean jj_3R_324() {
21424: if (jj_scan_token(FALSE))
21425: return true;
21426: return false;
21427: }
21428:
21429: final private boolean jj_3R_83() {
21430: Token xsp;
21431: xsp = jj_scanpos;
21432: lookingAhead = true;
21433: jj_semLA = getToken(2).kind == SCHEMA
21434: || getToken(2).kind == SQLID;
21435: lookingAhead = false;
21436: if (!jj_semLA || jj_3R_156()) {
21437: jj_scanpos = xsp;
21438: if (jj_3R_157()) {
21439: jj_scanpos = xsp;
21440: lookingAhead = true;
21441: jj_semLA = getToken(1).kind == DATE
21442: || getToken(1).kind == TIME
21443: || getToken(1).kind == TIMESTAMP;
21444: lookingAhead = false;
21445: if (!jj_semLA || jj_3R_158()) {
21446: jj_scanpos = xsp;
21447: lookingAhead = true;
21448: jj_semLA = getToken(2).kind == LEFT_PAREN
21449: || (getToken(4).kind == LEFT_PAREN && getToken(2).kind != COMMA);
21450: lookingAhead = false;
21451: if (!jj_semLA || jj_3R_159()) {
21452: jj_scanpos = xsp;
21453: if (jj_3_43()) {
21454: jj_scanpos = xsp;
21455: if (jj_3R_160())
21456: return true;
21457: }
21458: }
21459: }
21460: }
21461: }
21462: return false;
21463: }
21464:
21465: final private boolean jj_3R_156() {
21466: if (jj_scan_token(CURRENT))
21467: return true;
21468: return false;
21469: }
21470:
21471: final private boolean jj_3R_323() {
21472: if (jj_scan_token(TRUE))
21473: return true;
21474: return false;
21475: }
21476:
21477: final private boolean jj_3R_305() {
21478: Token xsp;
21479: xsp = jj_scanpos;
21480: if (jj_3R_323()) {
21481: jj_scanpos = xsp;
21482: if (jj_3R_324())
21483: return true;
21484: }
21485: return false;
21486: }
21487:
21488: final private boolean jj_3R_286() {
21489: if (jj_scan_token(SAVEPOINT))
21490: return true;
21491: return false;
21492: }
21493:
21494: final private boolean jj_3R_221() {
21495: Token xsp;
21496: xsp = jj_scanpos;
21497: if (jj_3R_286()) {
21498: jj_scanpos = xsp;
21499: if (jj_3R_287()) {
21500: jj_scanpos = xsp;
21501: if (jj_3R_288())
21502: return true;
21503: }
21504: }
21505: return false;
21506: }
21507:
21508: final private boolean jj_3R_215() {
21509: if (jj_scan_token(XML))
21510: return true;
21511: return false;
21512: }
21513:
21514: final private boolean jj_3R_67() {
21515: if (jj_3R_68())
21516: return true;
21517: return false;
21518: }
21519:
21520: final private boolean jj_3R_155() {
21521: if (jj_scan_token(LEFT_PAREN))
21522: return true;
21523: return false;
21524: }
21525:
21526: final private boolean jj_3_9() {
21527: if (jj_3R_56())
21528: return true;
21529: return false;
21530: }
21531:
21532: final private boolean jj_3R_183() {
21533: if (jj_scan_token(CURRENT))
21534: return true;
21535: return false;
21536: }
21537:
21538: final private boolean jj_3R_99() {
21539: Token xsp;
21540: xsp = jj_scanpos;
21541: if (jj_scan_token(214)) {
21542: jj_scanpos = xsp;
21543: lookingAhead = true;
21544: jj_semLA = getToken(1).kind == CURRENT
21545: && (getToken(2).kind == SCHEMA || getToken(2).kind == SQLID);
21546: lookingAhead = false;
21547: if (!jj_semLA || jj_3R_183())
21548: return true;
21549: }
21550: return false;
21551: }
21552:
21553: final private boolean jj_3_42() {
21554: if (jj_3R_83())
21555: return true;
21556: return false;
21557: }
21558:
21559: final private boolean jj_3_18() {
21560: if (jj_3R_67())
21561: return true;
21562: return false;
21563: }
21564:
21565: final private boolean jj_3R_292() {
21566: if (jj_3R_295())
21567: return true;
21568: return false;
21569: }
21570:
21571: final private boolean jj_3R_226() {
21572: Token xsp;
21573: xsp = jj_scanpos;
21574: lookingAhead = true;
21575: jj_semLA = getToken(2).kind == PERIOD
21576: && getToken(4).kind == LEFT_PAREN;
21577: lookingAhead = false;
21578: if (!jj_semLA || jj_3R_292()) {
21579: jj_scanpos = xsp;
21580: if (jj_3_9())
21581: return true;
21582: }
21583: return false;
21584: }
21585:
21586: final private boolean jj_3R_213() {
21587: if (jj_scan_token(LONG))
21588: return true;
21589: return false;
21590: }
21591:
21592: final private boolean jj_3R_194() {
21593: Token xsp;
21594: xsp = jj_scanpos;
21595: lookingAhead = true;
21596: jj_semLA = ((getToken(1).kind == GET_CURRENT_CONNECTION
21597: || getToken(1).kind == ABS
21598: || getToken(1).kind == ABSVAL
21599: || getToken(1).kind == SQRT || getToken(1).kind == MOD
21600: || getToken(1).kind == COALESCE
21601: || getToken(1).kind == VALUE
21602: || getToken(1).kind == IDENTITY_VAL_LOCAL
21603: || getToken(1).kind == SUBSTRING
21604: || getToken(1).kind == SUBSTR
21605: || getToken(1).kind == UPPER
21606: || getToken(1).kind == LOWER
21607: || getToken(1).kind == UCASE
21608: || getToken(1).kind == LCASE
21609: || getToken(1).kind == LTRIM
21610: || getToken(1).kind == RTRIM
21611: || getToken(1).kind == DATE || getToken(1).kind == TIME
21612: || getToken(1).kind == TIMESTAMP
21613: || getToken(1).kind == DOUBLE
21614: || getToken(1).kind == CHAR
21615: || getToken(1).kind == VARCHAR
21616: || getToken(1).kind == INTEGER
21617: || getToken(1).kind == INT
21618: || getToken(1).kind == SMALLINT
21619: || getToken(1).kind == LONGINT
21620: || getToken(1).kind == YEAR
21621: || getToken(1).kind == MONTH || getToken(1).kind == DAY
21622: || getToken(1).kind == HOUR
21623: || getToken(1).kind == MINUTE
21624: || getToken(1).kind == SECOND
21625: || getToken(1).kind == LENGTH
21626: || getToken(1).kind == LOCATE
21627: || getToken(1).kind == XMLPARSE
21628: || getToken(1).kind == XMLSERIALIZE
21629: || getToken(1).kind == XMLEXISTS || getToken(1).kind == XMLQUERY) && getToken(2).kind == LEFT_PAREN);
21630: lookingAhead = false;
21631: if (!jj_semLA || jj_3R_233()) {
21632: jj_scanpos = xsp;
21633: if (jj_3_26()) {
21634: jj_scanpos = xsp;
21635: if (jj_3R_234())
21636: return true;
21637: }
21638: }
21639: return false;
21640: }
21641:
21642: final private boolean jj_3R_233() {
21643: if (jj_3R_71())
21644: return true;
21645: return false;
21646: }
21647:
21648: final private boolean jj_3R_54() {
21649: if (jj_3R_99())
21650: return true;
21651: return false;
21652: }
21653:
21654: final private boolean jj_3R_254() {
21655: if (jj_3R_299())
21656: return true;
21657: return false;
21658: }
21659:
21660: final private boolean jj_3R_170() {
21661: if (jj_3R_211())
21662: return true;
21663: return false;
21664: }
21665:
21666: final private boolean jj_3R_112() {
21667: if (jj_scan_token(DOUBLE))
21668: return true;
21669: return false;
21670: }
21671:
21672: final private boolean jj_3R_253() {
21673: if (jj_scan_token(TIMESTAMP))
21674: return true;
21675: return false;
21676: }
21677:
21678: final private boolean jj_3R_115() {
21679: Token xsp;
21680: xsp = jj_scanpos;
21681: lookingAhead = true;
21682: jj_semLA = getToken(2).kind == PERIOD
21683: && (getToken(3).kind == ASTERISK || (getToken(4).kind == PERIOD && getToken(5).kind == ASTERISK));
21684: lookingAhead = false;
21685: if (!jj_semLA || jj_3R_187()) {
21686: jj_scanpos = xsp;
21687: if (jj_3_18())
21688: return true;
21689: }
21690: return false;
21691: }
21692:
21693: final private boolean jj_3R_187() {
21694: if (jj_3R_205())
21695: return true;
21696: return false;
21697: }
21698:
21699: final private boolean jj_3R_64() {
21700: Token xsp;
21701: xsp = jj_scanpos;
21702: lookingAhead = true;
21703: jj_semLA = getToken(2).kind == PRECISION;
21704: lookingAhead = false;
21705: if (!jj_semLA || jj_3R_112()) {
21706: jj_scanpos = xsp;
21707: if (jj_scan_token(121))
21708: return true;
21709: }
21710: return false;
21711: }
21712:
21713: final private boolean jj_3_25() {
21714: if (jj_3R_72())
21715: return true;
21716: return false;
21717: }
21718:
21719: final private boolean jj_3R_127() {
21720: if (jj_3R_196())
21721: return true;
21722: return false;
21723: }
21724:
21725: final private boolean jj_3R_252() {
21726: if (jj_scan_token(DATE))
21727: return true;
21728: return false;
21729: }
21730:
21731: final private boolean jj_3_15() {
21732: if (jj_3R_64())
21733: return true;
21734: return false;
21735: }
21736:
21737: final private boolean jj_3R_169() {
21738: if (jj_3R_210())
21739: return true;
21740: return false;
21741: }
21742:
21743: final private boolean jj_3R_154() {
21744: if (jj_3R_206())
21745: return true;
21746: return false;
21747: }
21748:
21749: final private boolean jj_3R_201() {
21750: Token xsp;
21751: xsp = jj_scanpos;
21752: if (jj_3R_251()) {
21753: jj_scanpos = xsp;
21754: if (jj_3R_252()) {
21755: jj_scanpos = xsp;
21756: if (jj_3R_253()) {
21757: jj_scanpos = xsp;
21758: if (jj_3R_254())
21759: return true;
21760: }
21761: }
21762: }
21763: return false;
21764: }
21765:
21766: final private boolean jj_3R_251() {
21767: if (jj_scan_token(TIME))
21768: return true;
21769: return false;
21770: }
21771:
21772: final private boolean jj_3R_168() {
21773: if (jj_scan_token(ALTER))
21774: return true;
21775: return false;
21776: }
21777:
21778: final private boolean jj_3R_66() {
21779: if (jj_3R_115())
21780: return true;
21781: return false;
21782: }
21783:
21784: final private boolean jj_3R_111() {
21785: if (jj_scan_token(REAL))
21786: return true;
21787: return false;
21788: }
21789:
21790: final private boolean jj_3R_190() {
21791: if (jj_scan_token(PERIOD))
21792: return true;
21793: return false;
21794: }
21795:
21796: final private boolean jj_3_17() {
21797: if (jj_3R_66())
21798: return true;
21799: return false;
21800: }
21801:
21802: final private boolean jj_3R_126() {
21803: if (jj_scan_token(LEFT_PAREN))
21804: return true;
21805: return false;
21806: }
21807:
21808: final private boolean jj_3R_327() {
21809: if (jj_3R_329())
21810: return true;
21811: return false;
21812: }
21813:
21814: final private boolean jj_3R_85() {
21815: Token xsp;
21816: xsp = jj_scanpos;
21817: if (jj_3R_167()) {
21818: jj_scanpos = xsp;
21819: if (jj_3R_168()) {
21820: jj_scanpos = xsp;
21821: lookingAhead = true;
21822: jj_semLA = getToken(1).kind == DROP
21823: && (getToken(2).kind == CONSTRAINT
21824: || getToken(2).kind == PRIMARY
21825: || getToken(2).kind == FOREIGN
21826: || getToken(2).kind == UNIQUE || getToken(2).kind == CHECK);
21827: lookingAhead = false;
21828: if (!jj_semLA || jj_3R_169()) {
21829: jj_scanpos = xsp;
21830: if (jj_3R_170())
21831: return true;
21832: }
21833: }
21834: }
21835: return false;
21836: }
21837:
21838: final private boolean jj_3R_167() {
21839: if (jj_scan_token(ADD))
21840: return true;
21841: return false;
21842: }
21843:
21844: final private boolean jj_3R_144() {
21845: if (jj_3R_203())
21846: return true;
21847: return false;
21848: }
21849:
21850: final private boolean jj_3R_125() {
21851: if (jj_3R_195())
21852: return true;
21853: return false;
21854: }
21855:
21856: final private boolean jj_3R_75() {
21857: Token xsp;
21858: xsp = jj_scanpos;
21859: if (jj_3_32()) {
21860: jj_scanpos = xsp;
21861: if (jj_3R_144())
21862: return true;
21863: }
21864: return false;
21865: }
21866:
21867: final private boolean jj_3_32() {
21868: if (jj_3R_64())
21869: return true;
21870: return false;
21871: }
21872:
21873: final private boolean jj_3R_124() {
21874: if (jj_3R_194())
21875: return true;
21876: return false;
21877: }
21878:
21879: final private boolean jj_3R_355() {
21880: Token xsp;
21881: xsp = jj_scanpos;
21882: if (jj_scan_token(59)) {
21883: jj_scanpos = xsp;
21884: if (jj_scan_token(60)) {
21885: jj_scanpos = xsp;
21886: if (jj_scan_token(61)) {
21887: jj_scanpos = xsp;
21888: if (jj_scan_token(62)) {
21889: jj_scanpos = xsp;
21890: if (jj_scan_token(63)) {
21891: jj_scanpos = xsp;
21892: if (jj_scan_token(64)) {
21893: jj_scanpos = xsp;
21894: if (jj_scan_token(65)) {
21895: jj_scanpos = xsp;
21896: if (jj_scan_token(66)) {
21897: jj_scanpos = xsp;
21898: if (jj_scan_token(67)) {
21899: jj_scanpos = xsp;
21900: if (jj_scan_token(68)) {
21901: jj_scanpos = xsp;
21902: if (jj_scan_token(69)) {
21903: jj_scanpos = xsp;
21904: if (jj_scan_token(70)) {
21905: jj_scanpos = xsp;
21906: if (jj_scan_token(71)) {
21907: jj_scanpos = xsp;
21908: if (jj_scan_token(72)) {
21909: jj_scanpos = xsp;
21910: if (jj_scan_token(73)) {
21911: jj_scanpos = xsp;
21912: if (jj_scan_token(75)) {
21913: jj_scanpos = xsp;
21914: if (jj_scan_token(76)) {
21915: jj_scanpos = xsp;
21916: if (jj_scan_token(77)) {
21917: jj_scanpos = xsp;
21918: if (jj_scan_token(78)) {
21919: jj_scanpos = xsp;
21920: if (jj_scan_token(79)) {
21921: jj_scanpos = xsp;
21922: if (jj_scan_token(80)) {
21923: jj_scanpos = xsp;
21924: if (jj_scan_token(81)) {
21925: jj_scanpos = xsp;
21926: if (jj_scan_token(82)) {
21927: jj_scanpos = xsp;
21928: if (jj_scan_token(83)) {
21929: jj_scanpos = xsp;
21930: if (jj_scan_token(85)) {
21931: jj_scanpos = xsp;
21932: if (jj_scan_token(86)) {
21933: jj_scanpos = xsp;
21934: if (jj_scan_token(88)) {
21935: jj_scanpos = xsp;
21936: if (jj_scan_token(89)) {
21937: jj_scanpos = xsp;
21938: if (jj_scan_token(90)) {
21939: jj_scanpos = xsp;
21940: if (jj_scan_token(91)) {
21941: jj_scanpos = xsp;
21942: if (jj_scan_token(92)) {
21943: jj_scanpos = xsp;
21944: if (jj_scan_token(93)) {
21945: jj_scanpos = xsp;
21946: if (jj_scan_token(94)) {
21947: jj_scanpos = xsp;
21948: if (jj_scan_token(95)) {
21949: jj_scanpos = xsp;
21950: if (jj_scan_token(96)) {
21951: jj_scanpos = xsp;
21952: if (jj_scan_token(97)) {
21953: jj_scanpos = xsp;
21954: if (jj_scan_token(98)) {
21955: jj_scanpos = xsp;
21956: if (jj_scan_token(100)) {
21957: jj_scanpos = xsp;
21958: if (jj_scan_token(101)) {
21959: jj_scanpos = xsp;
21960: if (jj_scan_token(102)) {
21961: jj_scanpos = xsp;
21962: if (jj_scan_token(103)) {
21963: jj_scanpos = xsp;
21964: if (jj_scan_token(104)) {
21965: jj_scanpos = xsp;
21966: if (jj_scan_token(105)) {
21967: jj_scanpos = xsp;
21968: if (jj_scan_token(106)) {
21969: jj_scanpos = xsp;
21970: if (jj_scan_token(108)) {
21971: jj_scanpos = xsp;
21972: if (jj_scan_token(109)) {
21973: jj_scanpos = xsp;
21974: if (jj_scan_token(110)) {
21975: jj_scanpos = xsp;
21976: if (jj_scan_token(111)) {
21977: jj_scanpos = xsp;
21978: if (jj_scan_token(112)) {
21979: jj_scanpos = xsp;
21980: if (jj_scan_token(113)) {
21981: jj_scanpos = xsp;
21982: if (jj_scan_token(114)) {
21983: jj_scanpos = xsp;
21984: if (jj_scan_token(115)) {
21985: jj_scanpos = xsp;
21986: if (jj_scan_token(116)) {
21987: jj_scanpos = xsp;
21988: if (jj_scan_token(117)) {
21989: jj_scanpos = xsp;
21990: if (jj_scan_token(118)) {
21991: jj_scanpos = xsp;
21992: if (jj_scan_token(119)) {
21993: jj_scanpos = xsp;
21994: if (jj_scan_token(120)) {
21995: jj_scanpos = xsp;
21996: if (jj_scan_token(121)) {
21997: jj_scanpos = xsp;
21998: if (jj_scan_token(122)) {
21999: jj_scanpos = xsp;
22000: if (jj_scan_token(123)) {
22001: jj_scanpos = xsp;
22002: if (jj_scan_token(124)) {
22003: jj_scanpos = xsp;
22004: if (jj_scan_token(125)) {
22005: jj_scanpos = xsp;
22006: if (jj_scan_token(126)) {
22007: jj_scanpos = xsp;
22008: if (jj_scan_token(127)) {
22009: jj_scanpos = xsp;
22010: if (jj_scan_token(128)) {
22011: jj_scanpos = xsp;
22012: if (jj_scan_token(129)) {
22013: jj_scanpos = xsp;
22014: if (jj_scan_token(130)) {
22015: jj_scanpos = xsp;
22016: if (jj_scan_token(131)) {
22017: jj_scanpos = xsp;
22018: if (jj_scan_token(132)) {
22019: jj_scanpos = xsp;
22020: if (jj_scan_token(133)) {
22021: jj_scanpos = xsp;
22022: if (jj_scan_token(134)) {
22023: jj_scanpos = xsp;
22024: if (jj_scan_token(135)) {
22025: jj_scanpos = xsp;
22026: if (jj_scan_token(136)) {
22027: jj_scanpos = xsp;
22028: if (jj_scan_token(137)) {
22029: jj_scanpos = xsp;
22030: if (jj_scan_token(138)) {
22031: jj_scanpos = xsp;
22032: if (jj_scan_token(139)) {
22033: jj_scanpos = xsp;
22034: if (jj_scan_token(140)) {
22035: jj_scanpos = xsp;
22036: if (jj_scan_token(141)) {
22037: jj_scanpos = xsp;
22038: if (jj_scan_token(142)) {
22039: jj_scanpos = xsp;
22040: if (jj_scan_token(143)) {
22041: jj_scanpos = xsp;
22042: if (jj_scan_token(342)) {
22043: jj_scanpos = xsp;
22044: if (jj_scan_token(144)) {
22045: jj_scanpos = xsp;
22046: if (jj_scan_token(145)) {
22047: jj_scanpos = xsp;
22048: if (jj_scan_token(146)) {
22049: jj_scanpos = xsp;
22050: if (jj_scan_token(147)) {
22051: jj_scanpos = xsp;
22052: if (jj_scan_token(148)) {
22053: jj_scanpos = xsp;
22054: if (jj_scan_token(149)) {
22055: jj_scanpos = xsp;
22056: if (jj_scan_token(150)) {
22057: jj_scanpos = xsp;
22058: if (jj_scan_token(151)) {
22059: jj_scanpos = xsp;
22060: if (jj_scan_token(152)) {
22061: jj_scanpos = xsp;
22062: if (jj_scan_token(153)) {
22063: jj_scanpos = xsp;
22064: if (jj_scan_token(154)) {
22065: jj_scanpos = xsp;
22066: if (jj_scan_token(155)) {
22067: jj_scanpos = xsp;
22068: if (jj_scan_token(156)) {
22069: jj_scanpos = xsp;
22070: if (jj_scan_token(282)) {
22071: jj_scanpos = xsp;
22072: if (jj_scan_token(157)) {
22073: jj_scanpos = xsp;
22074: if (jj_scan_token(158)) {
22075: jj_scanpos = xsp;
22076: if (jj_scan_token(159)) {
22077: jj_scanpos = xsp;
22078: if (jj_scan_token(160)) {
22079: jj_scanpos = xsp;
22080: if (jj_scan_token(161)) {
22081: jj_scanpos = xsp;
22082: if (jj_scan_token(162)) {
22083: jj_scanpos = xsp;
22084: if (jj_scan_token(163)) {
22085: jj_scanpos = xsp;
22086: if (jj_scan_token(164)) {
22087: jj_scanpos = xsp;
22088: if (jj_scan_token(165)) {
22089: jj_scanpos = xsp;
22090: if (jj_scan_token(166)) {
22091: jj_scanpos = xsp;
22092: if (jj_scan_token(167)) {
22093: jj_scanpos = xsp;
22094: if (jj_scan_token(168)) {
22095: jj_scanpos = xsp;
22096: if (jj_scan_token(169)) {
22097: jj_scanpos = xsp;
22098: if (jj_scan_token(170)) {
22099: jj_scanpos = xsp;
22100: if (jj_scan_token(171)) {
22101: jj_scanpos = xsp;
22102: if (jj_scan_token(172)) {
22103: jj_scanpos = xsp;
22104: if (jj_scan_token(173)) {
22105: jj_scanpos = xsp;
22106: if (jj_scan_token(174)) {
22107: jj_scanpos = xsp;
22108: if (jj_scan_token(175)) {
22109: jj_scanpos = xsp;
22110: if (jj_scan_token(177)) {
22111: jj_scanpos = xsp;
22112: if (jj_scan_token(178)) {
22113: jj_scanpos = xsp;
22114: if (jj_scan_token(179)) {
22115: jj_scanpos = xsp;
22116: if (jj_scan_token(378)) {
22117: jj_scanpos = xsp;
22118: if (jj_scan_token(180)) {
22119: jj_scanpos = xsp;
22120: if (jj_scan_token(181)) {
22121: jj_scanpos = xsp;
22122: if (jj_scan_token(182)) {
22123: jj_scanpos = xsp;
22124: if (jj_scan_token(183)) {
22125: jj_scanpos = xsp;
22126: if (jj_scan_token(184)) {
22127: jj_scanpos = xsp;
22128: if (jj_scan_token(185)) {
22129: jj_scanpos = xsp;
22130: if (jj_scan_token(186)) {
22131: jj_scanpos = xsp;
22132: if (jj_scan_token(187)) {
22133: jj_scanpos = xsp;
22134: if (jj_scan_token(188)) {
22135: jj_scanpos = xsp;
22136: if (jj_scan_token(189)) {
22137: jj_scanpos = xsp;
22138: if (jj_scan_token(190)) {
22139: jj_scanpos = xsp;
22140: if (jj_scan_token(191)) {
22141: jj_scanpos = xsp;
22142: if (jj_scan_token(192)) {
22143: jj_scanpos = xsp;
22144: if (jj_scan_token(383)) {
22145: jj_scanpos = xsp;
22146: if (jj_scan_token(193)) {
22147: jj_scanpos = xsp;
22148: if (jj_scan_token(194)) {
22149: jj_scanpos = xsp;
22150: if (jj_scan_token(195)) {
22151: jj_scanpos = xsp;
22152: if (jj_scan_token(196)) {
22153: jj_scanpos = xsp;
22154: if (jj_scan_token(197)) {
22155: jj_scanpos = xsp;
22156: if (jj_scan_token(198)) {
22157: jj_scanpos = xsp;
22158: if (jj_scan_token(199)) {
22159: jj_scanpos = xsp;
22160: if (jj_scan_token(200)) {
22161: jj_scanpos = xsp;
22162: if (jj_scan_token(201)) {
22163: jj_scanpos = xsp;
22164: if (jj_scan_token(202)) {
22165: jj_scanpos = xsp;
22166: if (jj_scan_token(203)) {
22167: jj_scanpos = xsp;
22168: if (jj_scan_token(204)) {
22169: jj_scanpos = xsp;
22170: if (jj_scan_token(205)) {
22171: jj_scanpos = xsp;
22172: if (jj_scan_token(206)) {
22173: jj_scanpos = xsp;
22174: if (jj_scan_token(207)) {
22175: jj_scanpos = xsp;
22176: if (jj_scan_token(208)) {
22177: jj_scanpos = xsp;
22178: if (jj_scan_token(209)) {
22179: jj_scanpos = xsp;
22180: if (jj_scan_token(210)) {
22181: jj_scanpos = xsp;
22182: if (jj_scan_token(211)) {
22183: jj_scanpos = xsp;
22184: if (jj_scan_token(212)) {
22185: jj_scanpos = xsp;
22186: if (jj_scan_token(213)) {
22187: jj_scanpos = xsp;
22188: if (jj_scan_token(214)) {
22189: jj_scanpos = xsp;
22190: if (jj_scan_token(215)) {
22191: jj_scanpos = xsp;
22192: if (jj_scan_token(216)) {
22193: jj_scanpos = xsp;
22194: if (jj_scan_token(217)) {
22195: jj_scanpos = xsp;
22196: if (jj_scan_token(218)) {
22197: jj_scanpos = xsp;
22198: if (jj_scan_token(219)) {
22199: jj_scanpos = xsp;
22200: if (jj_scan_token(220)) {
22201: jj_scanpos = xsp;
22202: if (jj_scan_token(221)) {
22203: jj_scanpos = xsp;
22204: if (jj_scan_token(222)) {
22205: jj_scanpos = xsp;
22206: if (jj_scan_token(223)) {
22207: jj_scanpos = xsp;
22208: if (jj_scan_token(224)) {
22209: jj_scanpos = xsp;
22210: if (jj_scan_token(225)) {
22211: jj_scanpos = xsp;
22212: if (jj_scan_token(226)) {
22213: jj_scanpos = xsp;
22214: if (jj_scan_token(227)) {
22215: jj_scanpos = xsp;
22216: if (jj_scan_token(228)) {
22217: jj_scanpos = xsp;
22218: if (jj_scan_token(229)) {
22219: jj_scanpos = xsp;
22220: if (jj_scan_token(231)) {
22221: jj_scanpos = xsp;
22222: if (jj_scan_token(232)) {
22223: jj_scanpos = xsp;
22224: if (jj_scan_token(233)) {
22225: jj_scanpos = xsp;
22226: if (jj_scan_token(234)) {
22227: jj_scanpos = xsp;
22228: if (jj_scan_token(235)) {
22229: jj_scanpos = xsp;
22230: if (jj_scan_token(236)) {
22231: jj_scanpos = xsp;
22232: if (jj_scan_token(237)) {
22233: jj_scanpos = xsp;
22234: if (jj_scan_token(238)) {
22235: jj_scanpos = xsp;
22236: if (jj_scan_token(239)) {
22237: jj_scanpos = xsp;
22238: if (jj_scan_token(241)) {
22239: jj_scanpos = xsp;
22240: if (jj_scan_token(242)) {
22241: jj_scanpos = xsp;
22242: if (jj_scan_token(243)) {
22243: jj_scanpos = xsp;
22244: if (jj_scan_token(244)) {
22245: jj_scanpos = xsp;
22246: if (jj_scan_token(245)) {
22247: jj_scanpos = xsp;
22248: if (jj_scan_token(246)) {
22249: jj_scanpos = xsp;
22250: if (jj_scan_token(247)) {
22251: jj_scanpos = xsp;
22252: if (jj_scan_token(249)) {
22253: jj_scanpos = xsp;
22254: if (jj_scan_token(251)) {
22255: jj_scanpos = xsp;
22256: if (jj_scan_token(252)) {
22257: jj_scanpos = xsp;
22258: if (jj_scan_token(253)) {
22259: jj_scanpos = xsp;
22260: if (jj_scan_token(254)) {
22261: jj_scanpos = xsp;
22262: if (jj_scan_token(255)) {
22263: jj_scanpos = xsp;
22264: if (jj_scan_token(256)) {
22265: jj_scanpos = xsp;
22266: if (jj_scan_token(257)) {
22267: jj_scanpos = xsp;
22268: if (jj_scan_token(258)) {
22269: jj_scanpos = xsp;
22270: if (jj_scan_token(259)) {
22271: jj_scanpos = xsp;
22272: if (jj_scan_token(337)) {
22273: jj_scanpos = xsp;
22274: if (jj_scan_token(338)) {
22275: jj_scanpos = xsp;
22276: if (jj_scan_token(343)) {
22277: jj_scanpos = xsp;
22278: if (jj_scan_token(344)) {
22279: jj_scanpos = xsp;
22280: if (jj_scan_token(346)) {
22281: jj_scanpos = xsp;
22282: if (jj_scan_token(347)) {
22283: jj_scanpos = xsp;
22284: if (jj_scan_token(348)) {
22285: jj_scanpos = xsp;
22286: if (jj_scan_token(349)) {
22287: jj_scanpos = xsp;
22288: if (jj_scan_token(351)) {
22289: jj_scanpos = xsp;
22290: if (jj_scan_token(353)) {
22291: jj_scanpos = xsp;
22292: if (jj_scan_token(350)) {
22293: jj_scanpos = xsp;
22294: if (jj_scan_token(352))
22295: return true;
22296: }
22297: }
22298: }
22299: }
22300: }
22301: }
22302: }
22303: }
22304: }
22305: }
22306: }
22307: }
22308: }
22309: }
22310: }
22311: }
22312: }
22313: }
22314: }
22315: }
22316: }
22317: }
22318: }
22319: }
22320: }
22321: }
22322: }
22323: }
22324: }
22325: }
22326: }
22327: }
22328: }
22329: }
22330: }
22331: }
22332: }
22333: }
22334: }
22335: }
22336: }
22337: }
22338: }
22339: }
22340: }
22341: }
22342: }
22343: }
22344: }
22345: }
22346: }
22347: }
22348: }
22349: }
22350: }
22351: }
22352: }
22353: }
22354: }
22355: }
22356: }
22357: }
22358: }
22359: }
22360: }
22361: }
22362: }
22363: }
22364: }
22365: }
22366: }
22367: }
22368: }
22369: }
22370: }
22371: }
22372: }
22373: }
22374: }
22375: }
22376: }
22377: }
22378: }
22379: }
22380: }
22381: }
22382: }
22383: }
22384: }
22385: }
22386: }
22387: }
22388: }
22389: }
22390: }
22391: }
22392: }
22393: }
22394: }
22395: }
22396: }
22397: }
22398: }
22399: }
22400: }
22401: }
22402: }
22403: }
22404: }
22405: }
22406: }
22407: }
22408: }
22409: }
22410: }
22411: }
22412: }
22413: }
22414: }
22415: }
22416: }
22417: }
22418: }
22419: }
22420: }
22421: }
22422: }
22423: }
22424: }
22425: }
22426: }
22427: }
22428: }
22429: }
22430: }
22431: }
22432: }
22433: }
22434: }
22435: }
22436: }
22437: }
22438: }
22439: }
22440: }
22441: }
22442: }
22443: }
22444: }
22445: }
22446: }
22447: }
22448: }
22449: }
22450: }
22451: }
22452: }
22453: }
22454: }
22455: }
22456: }
22457: }
22458: }
22459: }
22460: }
22461: }
22462: }
22463: }
22464: }
22465: }
22466: }
22467: }
22468: }
22469: }
22470: }
22471: }
22472: }
22473: }
22474: }
22475: }
22476: }
22477: }
22478: }
22479: }
22480: }
22481: }
22482: }
22483: }
22484: }
22485: }
22486: }
22487: }
22488: }
22489: }
22490: }
22491: }
22492: }
22493: }
22494: }
22495: }
22496: }
22497: }
22498: }
22499: }
22500: }
22501: }
22502: return false;
22503: }
22504:
22505: final private boolean jj_3R_123() {
22506: if (jj_3R_193())
22507: return true;
22508: return false;
22509: }
22510:
22511: final private boolean jj_3R_326() {
22512: if (jj_scan_token(CALL))
22513: return true;
22514: return false;
22515: }
22516:
22517: final private boolean jj_3R_307() {
22518: Token xsp;
22519: xsp = jj_scanpos;
22520: if (jj_3R_326()) {
22521: jj_scanpos = xsp;
22522: if (jj_3R_327())
22523: return true;
22524: }
22525: return false;
22526: }
22527:
22528: final private boolean jj_3R_117() {
22529: Token xsp;
22530: xsp = jj_scanpos;
22531: lookingAhead = true;
22532: jj_semLA = getToken(3).kind == LEFT_PAREN;
22533: lookingAhead = false;
22534: if (!jj_semLA || jj_3R_189()) {
22535: jj_scanpos = xsp;
22536: if (jj_3R_190())
22537: return true;
22538: }
22539: return false;
22540: }
22541:
22542: final private boolean jj_3R_189() {
22543: Token xsp;
22544: xsp = jj_scanpos;
22545: if (jj_scan_token(441)) {
22546: jj_scanpos = xsp;
22547: if (jj_scan_token(423))
22548: return true;
22549: }
22550: return false;
22551: }
22552:
22553: final private boolean jj_3R_110() {
22554: if (jj_scan_token(FLOAT))
22555: return true;
22556: return false;
22557: }
22558:
22559: final private boolean jj_3R_63() {
22560: Token xsp;
22561: xsp = jj_scanpos;
22562: if (jj_3R_110()) {
22563: jj_scanpos = xsp;
22564: if (jj_3R_111()) {
22565: jj_scanpos = xsp;
22566: if (jj_3_15())
22567: return true;
22568: }
22569: }
22570: return false;
22571: }
22572:
22573: final private boolean jj_3R_268() {
22574: if (jj_scan_token(UR))
22575: return true;
22576: return false;
22577: }
22578:
22579: final private boolean jj_3R_122() {
22580: if (jj_3R_192())
22581: return true;
22582: return false;
22583: }
22584:
22585: final private boolean jj_3R_153() {
22586: if (jj_3R_205())
22587: return true;
22588: return false;
22589: }
22590:
22591: final private boolean jj_3R_267() {
22592: if (jj_scan_token(CS))
22593: return true;
22594: return false;
22595: }
22596:
22597: final private boolean jj_3R_266() {
22598: if (jj_scan_token(RS))
22599: return true;
22600: return false;
22601: }
22602:
22603: final private boolean jj_3R_285() {
22604: if (jj_scan_token(LEFT_BRACE))
22605: return true;
22606: return false;
22607: }
22608:
22609: final private boolean jj_3R_284() {
22610: if (jj_3R_307())
22611: return true;
22612: return false;
22613: }
22614:
22615: final private boolean jj_3R_114() {
22616: if (jj_scan_token(ALL))
22617: return true;
22618: return false;
22619: }
22620:
22621: final private boolean jj_3R_121() {
22622: if (jj_3R_191())
22623: return true;
22624: return false;
22625: }
22626:
22627: final private boolean jj_3R_265() {
22628: if (jj_scan_token(RR))
22629: return true;
22630: return false;
22631: }
22632:
22633: final private boolean jj_3R_166() {
22634: if (jj_scan_token(READ))
22635: return true;
22636: return false;
22637: }
22638:
22639: final private boolean jj_3R_69() {
22640: if (jj_3R_117())
22641: return true;
22642: return false;
22643: }
22644:
22645: final private boolean jj_3R_259() {
22646: if (jj_scan_token(LONGINT))
22647: return true;
22648: return false;
22649: }
22650:
22651: final private boolean jj_3R_220() {
22652: Token xsp;
22653: xsp = jj_scanpos;
22654: if (jj_3R_284()) {
22655: jj_scanpos = xsp;
22656: if (jj_3R_285())
22657: return true;
22658: }
22659: return false;
22660: }
22661:
22662: final private boolean jj_3R_120() {
22663: if (jj_scan_token(CURRENT))
22664: return true;
22665: return false;
22666: }
22667:
22668: final private boolean jj_3R_165() {
22669: if (jj_scan_token(READ))
22670: return true;
22671: return false;
22672: }
22673:
22674: final private boolean jj_3R_208() {
22675: Token xsp;
22676: xsp = jj_scanpos;
22677: if (jj_3R_265()) {
22678: jj_scanpos = xsp;
22679: if (jj_3R_266()) {
22680: jj_scanpos = xsp;
22681: if (jj_3R_267()) {
22682: jj_scanpos = xsp;
22683: if (jj_3R_268())
22684: return true;
22685: }
22686: }
22687: }
22688: return false;
22689: }
22690:
22691: final private boolean jj_3R_331() {
22692: if (jj_scan_token(DELIMITED_IDENTIFIER))
22693: return true;
22694: return false;
22695: }
22696:
22697: final private boolean jj_3R_258() {
22698: if (jj_scan_token(SMALLINT))
22699: return true;
22700: return false;
22701: }
22702:
22703: final private boolean jj_3_21() {
22704: if (jj_3R_69())
22705: return true;
22706: return false;
22707: }
22708:
22709: final private boolean jj_3R_203() {
22710: Token xsp;
22711: xsp = jj_scanpos;
22712: if (jj_3R_257()) {
22713: jj_scanpos = xsp;
22714: if (jj_3R_258()) {
22715: jj_scanpos = xsp;
22716: if (jj_3R_259())
22717: return true;
22718: }
22719: }
22720: return false;
22721: }
22722:
22723: final private boolean jj_3R_257() {
22724: Token xsp;
22725: xsp = jj_scanpos;
22726: if (jj_scan_token(161)) {
22727: jj_scanpos = xsp;
22728: if (jj_scan_token(160))
22729: return true;
22730: }
22731: return false;
22732: }
22733:
22734: final private boolean jj_3R_113() {
22735: if (jj_scan_token(DISTINCT))
22736: return true;
22737: return false;
22738: }
22739:
22740: final private boolean jj_3R_65() {
22741: Token xsp;
22742: xsp = jj_scanpos;
22743: lookingAhead = true;
22744: jj_semLA = getToken(1).kind == DISTINCT
22745: && !(getToken(2).kind == PERIOD || getToken(2).kind == DOUBLE_COLON);
22746: lookingAhead = false;
22747: if (!jj_semLA || jj_3R_113()) {
22748: jj_scanpos = xsp;
22749: lookingAhead = true;
22750: jj_semLA = getToken(1).kind == ALL
22751: && !(getToken(2).kind == PERIOD || getToken(2).kind == DOUBLE_COLON);
22752: lookingAhead = false;
22753: if (!jj_semLA || jj_3R_114())
22754: return true;
22755: }
22756: return false;
22757: }
22758:
22759: final private boolean jj_3R_119() {
22760: if (jj_scan_token(CURRENT))
22761: return true;
22762: return false;
22763: }
22764:
22765: final private boolean jj_3R_56() {
22766: if (jj_3R_100())
22767: return true;
22768: return false;
22769: }
22770:
22771: final private boolean jj_3R_164() {
22772: if (jj_scan_token(DIRTY))
22773: return true;
22774: return false;
22775: }
22776:
22777: final private boolean jj_3R_148() {
22778: if (jj_scan_token(RETURNING))
22779: return true;
22780: return false;
22781: }
22782:
22783: final private boolean jj_3R_163() {
22784: if (jj_scan_token(CURSOR))
22785: return true;
22786: return false;
22787: }
22788:
22789: final private boolean jj_3R_209() {
22790: if (jj_scan_token(REPEATABLE))
22791: return true;
22792: return false;
22793: }
22794:
22795: final private boolean jj_3R_224() {
22796: if (jj_3R_203())
22797: return true;
22798: return false;
22799: }
22800:
22801: final private boolean jj_3R_118() {
22802: if (jj_scan_token(LEFT_BRACE))
22803: return true;
22804: return false;
22805: }
22806:
22807: final private boolean jj_3R_70() {
22808: Token xsp;
22809: xsp = jj_scanpos;
22810: lookingAhead = true;
22811: jj_semLA = escapedValueFunctionFollows();
22812: lookingAhead = false;
22813: if (!jj_semLA || jj_3R_118()) {
22814: jj_scanpos = xsp;
22815: lookingAhead = true;
22816: jj_semLA = getToken(2).kind == SCHEMA
22817: || getToken(2).kind == SQLID;
22818: lookingAhead = false;
22819: if (!jj_semLA || jj_3R_119()) {
22820: jj_scanpos = xsp;
22821: lookingAhead = true;
22822: jj_semLA = getToken(2).kind == ISOLATION;
22823: lookingAhead = false;
22824: if (!jj_semLA || jj_3R_120()) {
22825: jj_scanpos = xsp;
22826: if (jj_3R_121()) {
22827: jj_scanpos = xsp;
22828: lookingAhead = true;
22829: jj_semLA = newInvocationFollows(1);
22830: lookingAhead = false;
22831: if (!jj_semLA || jj_3R_122()) {
22832: jj_scanpos = xsp;
22833: lookingAhead = true;
22834: jj_semLA = aggregateFollows();
22835: lookingAhead = false;
22836: if (!jj_semLA || jj_3R_123()) {
22837: jj_scanpos = xsp;
22838: lookingAhead = true;
22839: jj_semLA = miscBuiltinFollows();
22840: lookingAhead = false;
22841: if (!jj_semLA || jj_3R_124()) {
22842: jj_scanpos = xsp;
22843: if (jj_3R_125()) {
22844: jj_scanpos = xsp;
22845: if (jj_3R_126()) {
22846: jj_scanpos = xsp;
22847: if (jj_3R_127())
22848: return true;
22849: }
22850: }
22851: }
22852: }
22853: }
22854: }
22855: }
22856: }
22857: }
22858: return false;
22859: }
22860:
22861: final private boolean jj_3_16() {
22862: if (jj_3R_65())
22863: return true;
22864: return false;
22865: }
22866:
22867: final private boolean jj_3R_204() {
22868: if (jj_scan_token(NULL))
22869: return true;
22870: return false;
22871: }
22872:
22873: final private boolean jj_3R_162() {
22874: Token xsp;
22875: xsp = jj_scanpos;
22876: if (jj_3R_209()) {
22877: jj_scanpos = xsp;
22878: if (jj_scan_token(314))
22879: return true;
22880: }
22881: return false;
22882: }
22883:
22884: final private boolean jj_3R_161() {
22885: if (jj_3R_208())
22886: return true;
22887: return false;
22888: }
22889:
22890: final private boolean jj_3R_77() {
22891: Token xsp;
22892: xsp = jj_scanpos;
22893: lookingAhead = true;
22894: jj_semLA = getToken(2).kind == SEQUENCE;
22895: lookingAhead = false;
22896: if (!jj_semLA || jj_3R_147()) {
22897: jj_scanpos = xsp;
22898: if (jj_3R_148())
22899: return true;
22900: }
22901: return false;
22902: }
22903:
22904: final private boolean jj_3R_147() {
22905: if (jj_scan_token(RETURNING))
22906: return true;
22907: return false;
22908: }
22909:
22910: final private boolean jj_3R_235() {
22911: if (jj_3R_296())
22912: return true;
22913: return false;
22914: }
22915:
22916: final private boolean jj_3R_81() {
22917: Token xsp;
22918: xsp = jj_scanpos;
22919: lookingAhead = true;
22920: jj_semLA = newInvocationFollows(1);
22921: lookingAhead = false;
22922: if (!jj_semLA || jj_3R_152()) {
22923: jj_scanpos = xsp;
22924: if (jj_3R_153()) {
22925: jj_scanpos = xsp;
22926: lookingAhead = true;
22927: jj_semLA = getToken(1).kind == LEFT_PAREN
22928: && (getToken(2).kind == SELECT || getToken(2).kind == VALUES);
22929: lookingAhead = false;
22930: if (!jj_semLA || jj_3R_154()) {
22931: jj_scanpos = xsp;
22932: if (jj_3R_155())
22933: return true;
22934: }
22935: }
22936: }
22937: return false;
22938: }
22939:
22940: final private boolean jj_3R_152() {
22941: if (jj_3R_192())
22942: return true;
22943: return false;
22944: }
22945:
22946: final private boolean jj_3R_356() {
22947: if (jj_scan_token(SELECT))
22948: return true;
22949: return false;
22950: }
22951:
22952: final private boolean jj_3R_310() {
22953: if (jj_scan_token(MINUS_SIGN))
22954: return true;
22955: return false;
22956: }
22957:
22958: final private boolean jj_3_8() {
22959: if (jj_3R_55())
22960: return true;
22961: return false;
22962: }
22963:
22964: final private boolean jj_3R_84() {
22965: Token xsp;
22966: xsp = jj_scanpos;
22967: if (jj_3R_161()) {
22968: jj_scanpos = xsp;
22969: if (jj_3R_162()) {
22970: jj_scanpos = xsp;
22971: if (jj_3R_163()) {
22972: jj_scanpos = xsp;
22973: if (jj_3R_164()) {
22974: jj_scanpos = xsp;
22975: lookingAhead = true;
22976: jj_semLA = getToken(1).kind == READ
22977: && getToken(2).kind == COMMITTED;
22978: lookingAhead = false;
22979: if (!jj_semLA || jj_3R_165()) {
22980: jj_scanpos = xsp;
22981: lookingAhead = true;
22982: jj_semLA = getToken(1).kind == READ
22983: && getToken(2).kind == UNCOMMITTED;
22984: lookingAhead = false;
22985: if (!jj_semLA || jj_3R_166())
22986: return true;
22987: }
22988: }
22989: }
22990: }
22991: }
22992: return false;
22993: }
22994:
22995: final private boolean jj_3_44() {
22996: if (jj_3R_84())
22997: return true;
22998: return false;
22999: }
23000:
23001: final private boolean jj_3R_316() {
23002: if (jj_3R_332())
23003: return true;
23004: return false;
23005: }
23006:
23007: final private boolean jj_3_46() {
23008: if (jj_3R_85())
23009: return true;
23010: return false;
23011: }
23012:
23013: final private boolean jj_3R_309() {
23014: if (jj_scan_token(PLUS_SIGN))
23015: return true;
23016: return false;
23017: }
23018:
23019: final private boolean jj_3R_291() {
23020: Token xsp;
23021: xsp = jj_scanpos;
23022: if (jj_3R_309()) {
23023: jj_scanpos = xsp;
23024: if (jj_3R_310())
23025: return true;
23026: }
23027: return false;
23028: }
23029:
23030: final private boolean jj_3R_334() {
23031: if (jj_scan_token(LTRIM))
23032: return true;
23033: return false;
23034: }
23035:
23036: final private boolean jj_3R_315() {
23037: if (jj_3R_331())
23038: return true;
23039: return false;
23040: }
23041:
23042: final private boolean jj_3_34() {
23043: if (jj_3R_68())
23044: return true;
23045: return false;
23046: }
23047:
23048: final private boolean jj_3R_353() {
23049: if (jj_3R_357())
23050: return true;
23051: return false;
23052: }
23053:
23054: final private boolean jj_3R_333() {
23055: if (jj_scan_token(RTRIM))
23056: return true;
23057: return false;
23058: }
23059:
23060: final private boolean jj_3R_317() {
23061: Token xsp;
23062: xsp = jj_scanpos;
23063: if (jj_3R_333()) {
23064: jj_scanpos = xsp;
23065: if (jj_3R_334())
23066: return true;
23067: }
23068: return false;
23069: }
23070:
23071: final private boolean jj_3R_352() {
23072: if (jj_3R_356())
23073: return true;
23074: return false;
23075: }
23076:
23077: final private boolean jj_3R_349() {
23078: Token xsp;
23079: xsp = jj_scanpos;
23080: if (jj_3R_352()) {
23081: jj_scanpos = xsp;
23082: if (jj_3R_353())
23083: return true;
23084: }
23085: return false;
23086: }
23087:
23088: final private boolean jj_3R_314() {
23089: if (jj_scan_token(IDENTIFIER))
23090: return true;
23091: return false;
23092: }
23093:
23094: final private boolean jj_3R_296() {
23095: Token xsp;
23096: xsp = jj_scanpos;
23097: if (jj_3R_314()) {
23098: jj_scanpos = xsp;
23099: if (jj_3R_315()) {
23100: jj_scanpos = xsp;
23101: if (jj_3R_316())
23102: return true;
23103: }
23104: }
23105: return false;
23106: }
23107:
23108: final private boolean jj_3R_290() {
23109: if (jj_scan_token(NUMERIC))
23110: return true;
23111: return false;
23112: }
23113:
23114: final private boolean jj_3R_146() {
23115: if (jj_scan_token(BY))
23116: return true;
23117: return false;
23118: }
23119:
23120: final private boolean jj_3R_186() {
23121: Token xsp;
23122: xsp = jj_scanpos;
23123: if (jj_3R_223()) {
23124: jj_scanpos = xsp;
23125: if (jj_3R_224())
23126: return true;
23127: }
23128: return false;
23129: }
23130:
23131: final private boolean jj_3R_223() {
23132: Token xsp;
23133: xsp = jj_scanpos;
23134: if (jj_3R_290()) {
23135: jj_scanpos = xsp;
23136: if (jj_scan_token(110)) {
23137: jj_scanpos = xsp;
23138: if (jj_scan_token(109))
23139: return true;
23140: }
23141: }
23142: return false;
23143: }
23144:
23145: final private boolean jj_3R_297() {
23146: if (jj_3R_317())
23147: return true;
23148: return false;
23149: }
23150:
23151: final private boolean jj_3R_55() {
23152: if (jj_3R_72())
23153: return true;
23154: return false;
23155: }
23156:
23157: final private boolean jj_3R_338() {
23158: if (jj_scan_token(LEFT_PAREN))
23159: return true;
23160: return false;
23161: }
23162:
23163: final private boolean jj_3R_76() {
23164: Token xsp;
23165: xsp = jj_scanpos;
23166: lookingAhead = true;
23167: jj_semLA = getToken(2).kind == REF;
23168: lookingAhead = false;
23169: if (!jj_semLA || jj_3R_145()) {
23170: jj_scanpos = xsp;
23171: if (jj_3R_146())
23172: return true;
23173: }
23174: return false;
23175: }
23176:
23177: final private boolean jj_3R_145() {
23178: if (jj_scan_token(BY))
23179: return true;
23180: return false;
23181: }
23182:
23183: final private boolean jj_3R_182() {
23184: if (jj_scan_token(CURRENT))
23185: return true;
23186: return false;
23187: }
23188:
23189: final private boolean jj_3R_98() {
23190: Token xsp;
23191: xsp = jj_scanpos;
23192: if (jj_scan_token(165)) {
23193: jj_scanpos = xsp;
23194: lookingAhead = true;
23195: jj_semLA = getToken(1).kind == CURRENT
23196: && getToken(2).kind == ISOLATION;
23197: lookingAhead = false;
23198: if (!jj_semLA || jj_3R_182())
23199: return true;
23200: }
23201: return false;
23202: }
23203:
23204: final private boolean jj_3R_337() {
23205: if (jj_3R_349())
23206: return true;
23207: return false;
23208: }
23209:
23210: final private boolean jj_3R_325() {
23211: Token xsp;
23212: xsp = jj_scanpos;
23213: if (jj_3R_337()) {
23214: jj_scanpos = xsp;
23215: if (jj_3R_338())
23216: return true;
23217: }
23218: return false;
23219: }
23220:
23221: final private boolean jj_3R_225() {
23222: if (jj_3R_291())
23223: return true;
23224: return false;
23225: }
23226:
23227: final private boolean jj_3R_329() {
23228: if (jj_scan_token(QUESTION_MARK))
23229: return true;
23230: return false;
23231: }
23232:
23233: final private boolean jj_3R_53() {
23234: if (jj_3R_98())
23235: return true;
23236: return false;
23237: }
23238:
23239: final private boolean jj_3_14() {
23240: if (jj_3R_63())
23241: return true;
23242: return false;
23243: }
23244:
23245: final private boolean jj_3R_109() {
23246: if (jj_3R_186())
23247: return true;
23248: return false;
23249: }
23250:
23251: final private boolean jj_3R_62() {
23252: Token xsp;
23253: xsp = jj_scanpos;
23254: if (jj_3R_109()) {
23255: jj_scanpos = xsp;
23256: if (jj_3_14())
23257: return true;
23258: }
23259: return false;
23260: }
23261:
23262: final private boolean jj_3R_188() {
23263: Token xsp;
23264: xsp = jj_scanpos;
23265: if (jj_3R_225())
23266: jj_scanpos = xsp;
23267: if (jj_3R_226())
23268: return true;
23269: return false;
23270: }
23271:
23272: final private boolean jj_3R_97() {
23273: if (jj_scan_token(EXECUTE))
23274: return true;
23275: return false;
23276: }
23277:
23278: final private boolean jj_3R_245() {
23279: if (jj_scan_token(LOCATE))
23280: return true;
23281: return false;
23282: }
23283:
23284: final private boolean jj_3R_151() {
23285: if (jj_scan_token(LEFT_BRACE))
23286: return true;
23287: return false;
23288: }
23289:
23290: final private boolean jj_3R_244() {
23291: if (jj_3R_297())
23292: return true;
23293: return false;
23294: }
23295:
23296: final private boolean jj_3_41() {
23297: if (jj_3R_68())
23298: return true;
23299: return false;
23300: }
23301:
23302: final private boolean jj_3R_282() {
23303: if (jj_scan_token(NATIONAL))
23304: return true;
23305: return false;
23306: }
23307:
23308: final private boolean jj_3R_80() {
23309: Token xsp;
23310: xsp = jj_scanpos;
23311: if (jj_3_38()) {
23312: jj_scanpos = xsp;
23313: if (jj_3R_151())
23314: return true;
23315: }
23316: return false;
23317: }
23318:
23319: final private boolean jj_3_38() {
23320: if (jj_3R_81())
23321: return true;
23322: return false;
23323: }
23324:
23325: final private boolean jj_3R_281() {
23326: if (jj_3R_185())
23327: return true;
23328: return false;
23329: }
23330:
23331: final private boolean jj_3R_243() {
23332: Token xsp;
23333: xsp = jj_scanpos;
23334: if (jj_scan_token(408)) {
23335: jj_scanpos = xsp;
23336: if (jj_scan_token(370))
23337: return true;
23338: }
23339: return false;
23340: }
23341:
23342: final private boolean jj_3R_280() {
23343: if (jj_scan_token(BINARY))
23344: return true;
23345: return false;
23346: }
23347:
23348: final private boolean jj_3R_256() {
23349: if (jj_scan_token(VARCHAR))
23350: return true;
23351: return false;
23352: }
23353:
23354: final private boolean jj_3_37() {
23355: if (jj_3R_80())
23356: return true;
23357: return false;
23358: }
23359:
23360: final private boolean jj_3R_219() {
23361: if (jj_scan_token(UPDATE))
23362: return true;
23363: return false;
23364: }
23365:
23366: final private boolean jj_3R_242() {
23367: Token xsp;
23368: xsp = jj_scanpos;
23369: if (jj_scan_token(245)) {
23370: jj_scanpos = xsp;
23371: if (jj_scan_token(171))
23372: return true;
23373: }
23374: return false;
23375: }
23376:
23377: final private boolean jj_3R_202() {
23378: Token xsp;
23379: xsp = jj_scanpos;
23380: if (jj_3R_255()) {
23381: jj_scanpos = xsp;
23382: if (jj_3R_256())
23383: return true;
23384: }
23385: return false;
23386: }
23387:
23388: final private boolean jj_3R_255() {
23389: if (jj_scan_token(CHAR))
23390: return true;
23391: return false;
23392: }
23393:
23394: final private boolean jj_3R_279() {
23395: if (jj_scan_token(NCLOB))
23396: return true;
23397: return false;
23398: }
23399:
23400: final private boolean jj_3_31() {
23401: if (jj_3R_76())
23402: return true;
23403: return false;
23404: }
23405:
23406: final private boolean jj_3R_198() {
23407: Token xsp;
23408: xsp = jj_scanpos;
23409: if (jj_3R_241()) {
23410: jj_scanpos = xsp;
23411: if (jj_3R_242()) {
23412: jj_scanpos = xsp;
23413: if (jj_3R_243()) {
23414: jj_scanpos = xsp;
23415: if (jj_3R_244()) {
23416: jj_scanpos = xsp;
23417: if (jj_3R_245())
23418: return true;
23419: }
23420: }
23421: }
23422: }
23423: return false;
23424: }
23425:
23426: final private boolean jj_3R_241() {
23427: if (jj_scan_token(SUBSTR))
23428: return true;
23429: return false;
23430: }
23431:
23432: final private boolean jj_3R_278() {
23433: if (jj_scan_token(CLOB))
23434: return true;
23435: return false;
23436: }
23437:
23438: final private boolean jj_3R_96() {
23439: if (jj_scan_token(REVOKE))
23440: return true;
23441: return false;
23442: }
23443:
23444: final private boolean jj_3R_277() {
23445: if (jj_scan_token(BLOB))
23446: return true;
23447: return false;
23448: }
23449:
23450: final private boolean jj_3R_214() {
23451: Token xsp;
23452: xsp = jj_scanpos;
23453: if (jj_3R_277()) {
23454: jj_scanpos = xsp;
23455: if (jj_3R_278()) {
23456: jj_scanpos = xsp;
23457: if (jj_3R_279()) {
23458: jj_scanpos = xsp;
23459: if (jj_3R_280()) {
23460: jj_scanpos = xsp;
23461: if (jj_3R_281()) {
23462: jj_scanpos = xsp;
23463: if (jj_3R_282())
23464: return true;
23465: }
23466: }
23467: }
23468: }
23469: }
23470: return false;
23471: }
23472:
23473: final private boolean jj_3R_320() {
23474: if (jj_scan_token(SECOND))
23475: return true;
23476: return false;
23477: }
23478:
23479: final private boolean jj_3R_319() {
23480: if (jj_3R_336())
23481: return true;
23482: return false;
23483: }
23484:
23485: final private boolean jj_3R_299() {
23486: Token xsp;
23487: xsp = jj_scanpos;
23488: if (jj_3R_319()) {
23489: jj_scanpos = xsp;
23490: if (jj_3R_320())
23491: return true;
23492: }
23493: return false;
23494: }
23495:
23496: final private boolean jj_3R_196() {
23497: if (jj_scan_token(CAST))
23498: return true;
23499: return false;
23500: }
23501:
23502: final private boolean jj_3R_116() {
23503: if (jj_3R_188())
23504: return true;
23505: return false;
23506: }
23507:
23508: final private boolean jj_3R_108() {
23509: if (jj_scan_token(NVARCHAR))
23510: return true;
23511: return false;
23512: }
23513:
23514: final private boolean jj_3R_218() {
23515: if (jj_scan_token(INSERT))
23516: return true;
23517: return false;
23518: }
23519:
23520: final private boolean jj_3R_313() {
23521: Token xsp;
23522: xsp = jj_scanpos;
23523: if (jj_scan_token(173)) {
23524: jj_scanpos = xsp;
23525: if (jj_scan_token(71)) {
23526: jj_scanpos = xsp;
23527: if (jj_scan_token(174)) {
23528: jj_scanpos = xsp;
23529: if (jj_scan_token(228))
23530: return true;
23531: }
23532: }
23533: }
23534: return false;
23535: }
23536:
23537: final private boolean jj_3R_306() {
23538: if (jj_3R_325())
23539: return true;
23540: return false;
23541: }
23542:
23543: final private boolean jj_3R_107() {
23544: if (jj_scan_token(NCHAR))
23545: return true;
23546: return false;
23547: }
23548:
23549: final private boolean jj_3R_106() {
23550: if (jj_scan_token(NATIONAL))
23551: return true;
23552: return false;
23553: }
23554:
23555: final private boolean jj_3R_294() {
23556: if (jj_3R_313())
23557: return true;
23558: return false;
23559: }
23560:
23561: final private boolean jj_3R_61() {
23562: Token xsp;
23563: xsp = jj_scanpos;
23564: if (jj_3R_106()) {
23565: jj_scanpos = xsp;
23566: if (jj_3R_107()) {
23567: jj_scanpos = xsp;
23568: if (jj_3R_108())
23569: return true;
23570: }
23571: }
23572: return false;
23573: }
23574:
23575: final private boolean jj_3_29() {
23576: if (jj_3R_76())
23577: return true;
23578: return false;
23579: }
23580:
23581: final private boolean jj_3R_217() {
23582: if (jj_3R_283())
23583: return true;
23584: return false;
23585: }
23586:
23587: final private boolean jj_3_40() {
23588: if (jj_3R_65())
23589: return true;
23590: return false;
23591: }
23592:
23593: final private boolean jj_3R_82() {
23594: Token xsp;
23595: xsp = jj_scanpos;
23596: if (jj_3_40())
23597: jj_scanpos = xsp;
23598: if (jj_3R_68())
23599: return true;
23600: return false;
23601: }
23602:
23603: final private boolean jj_3R_283() {
23604: if (jj_3R_306())
23605: return true;
23606: return false;
23607: }
23608:
23609: final private boolean jj_3_30() {
23610: if (jj_3R_77())
23611: return true;
23612: return false;
23613: }
23614:
23615: final private boolean jj_3_39() {
23616: if (jj_3R_82())
23617: return true;
23618: return false;
23619: }
23620:
23621: final private boolean jj_3R_232() {
23622: if (jj_3R_294())
23623: return true;
23624: return false;
23625: }
23626:
23627: final private boolean jj_3_47() {
23628: if (jj_3R_86())
23629: return true;
23630: return false;
23631: }
23632:
23633: final private boolean jj_3R_240() {
23634: if (jj_scan_token(IDENTITY_VAL_LOCAL))
23635: return true;
23636: return false;
23637: }
23638:
23639: final private boolean jj_3R_68() {
23640: if (jj_3R_116())
23641: return true;
23642: return false;
23643: }
23644:
23645: final private boolean jj_3R_185() {
23646: Token xsp;
23647: xsp = jj_scanpos;
23648: if (jj_scan_token(82)) {
23649: jj_scanpos = xsp;
23650: if (jj_scan_token(83))
23651: return true;
23652: }
23653: return false;
23654: }
23655:
23656: final private boolean jj_3R_239() {
23657: if (jj_scan_token(MOD))
23658: return true;
23659: return false;
23660: }
23661:
23662: public SQLParserTokenManager token_source;
23663: public Token token, jj_nt;
23664: private Token jj_scanpos, jj_lastpos;
23665: private int jj_la;
23666: public boolean lookingAhead = false;
23667: private boolean jj_semLA;
23668: private int jj_gen;
23669: final private int[] jj_la1 = new int[306];
23670: static private int[] jj_la1_0;
23671: static private int[] jj_la1_1;
23672: static private int[] jj_la1_2;
23673: static private int[] jj_la1_3;
23674: static private int[] jj_la1_4;
23675: static private int[] jj_la1_5;
23676: static private int[] jj_la1_6;
23677: static private int[] jj_la1_7;
23678: static private int[] jj_la1_8;
23679: static private int[] jj_la1_9;
23680: static private int[] jj_la1_10;
23681: static private int[] jj_la1_11;
23682: static private int[] jj_la1_12;
23683: static private int[] jj_la1_13;
23684: static private int[] jj_la1_14;
23685: static {
23686: jj_la1_0();
23687: jj_la1_1();
23688: jj_la1_2();
23689: jj_la1_3();
23690: jj_la1_4();
23691: jj_la1_5();
23692: jj_la1_6();
23693: jj_la1_7();
23694: jj_la1_8();
23695: jj_la1_9();
23696: jj_la1_10();
23697: jj_la1_11();
23698: jj_la1_12();
23699: jj_la1_13();
23700: jj_la1_14();
23701: }
23702:
23703: private static void jj_la1_0() {
23704: jj_la1_0 = new int[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23705: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23706: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23707: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23708: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23709: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23710: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23711: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23712: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23713: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23714: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23715: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23716: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23717: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23718: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23719: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23720: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23721: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23722: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23723: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23724: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23725: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23726: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23727: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23728: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23729: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23730: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23731: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23732: 0x0, };
23733: }
23734:
23735: private static void jj_la1_1() {
23736: jj_la1_1 = new int[] { 0x0, 0x0, 0x40000000, 0x0, 0x0, 0x0,
23737: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200000, 0x0, 0x0, 0x0,
23738: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200000, 0x0, 0x0, 0x0,
23739: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23740: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23741: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23742: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23743: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23744: 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x0,
23745: 0x0, 0x10000000, 0x10000000, 0x0, 0x0, 0x0, 0x0, 0x0,
23746: 0x0, 0x0, 0x80000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23747: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23748: 0xf8000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23749: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23750: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23751: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23752: 0x0, 0x0, 0x0, 0x0, 0x200000, 0x0, 0x0, 0x0, 0x0,
23753: 0x10000000, 0x0, 0x0, 0x0, 0x0, 0x200000, 0x0, 0x0,
23754: 0x0, 0x0, 0x0, 0x200000, 0x0, 0x200000, 0x0, 0x0,
23755: 0x200000, 0x0, 0x0, 0x200000, 0x0, 0x0, 0x0, 0x0, 0x0,
23756: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23757: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200000, 0x0, 0x0,
23758: 0x200000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23759: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23760: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23761: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23762: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200000,
23763: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23764: 0x200000, 0x200000, 0x0, 0x0, 0x0, 0x0, 0x0,
23765: 0x48000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000000, 0x0,
23766: 0x0, 0x10000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23767: 0x0, 0x0, 0x10000000, 0x0, 0xf8000000, 0x0, 0xf8000000,
23768: 0xf8000000, 0x0, };
23769: }
23770:
23771: private static void jj_la1_2() {
23772: jj_la1_2 = new int[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23773: 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23774: 0x800400, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x800400, 0x0,
23775: 0x0, 0x0, 0x0, 0x800400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23776: 0x0, 0x40a00400, 0x40200000, 0x40200000, 0x40200000,
23777: 0x0, 0x40200000, 0x40200000, 0xc0400, 0x0, 0x0,
23778: 0xc0000, 0x0, 0xc0000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23779: 0x0, 0x0, 0x0, 0xc0400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23780: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23781: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23782: 0x0, 0x0, 0x0, 0x800404, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0,
23783: 0x0, 0x200, 0x0, 0x0, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0,
23784: 0x0, 0x0, 0x0, 0x0, 0xffefffff, 0x0, 0x0, 0x0, 0x0,
23785: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23786: 0x10000, 0x820400, 0x800400, 0x0, 0x800000, 0x0, 0x0,
23787: 0x40000, 0x0, 0x0, 0x4, 0x0, 0x2000, 0x0, 0x0, 0x0,
23788: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0x8, 0x0, 0x0,
23789: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1, 0x0,
23790: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x800404,
23791: 0x0, 0x4, 0x0, 0x0, 0x4, 0x0, 0x0, 0x800400, 0x0, 0x0,
23792: 0x0, 0x8, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23793: 0x0, 0x80, 0x80, 0x40000, 0x0, 0x0, 0x40, 0x800440,
23794: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x800400,
23795: 0x0, 0x0, 0x0, 0x0, 0x800400, 0x0, 0x0, 0x0, 0x0, 0x0,
23796: 0x0, 0x0, 0x0, 0x0, 0x0, 0x2000, 0x0, 0x0, 0x0, 0x0,
23797: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23798: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x800400,
23799: 0x10000, 0x0, 0x0, 0x40000000, 0x0, 0x200000, 0x0, 0x0,
23800: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4000, 0x40000000, 0x0,
23801: 0x0, 0x200000, 0x0, 0x0, 0x44a00400, 0x4000000, 0x0,
23802: 0x0, 0x4000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23803: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x800400, 0x0,
23804: 0x800400, 0xff6ffbff, 0x800400, 0xffefffff, 0xffefffff,
23805: 0x800400, };
23806: }
23807:
23808: private static void jj_la1_3() {
23809: jj_la1_3 = new int[] { 0x80000, 0x0, 0x4088010, 0x0, 0x0, 0x0,
23810: 0x0, 0x0, 0x0, 0x80000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23811: 0x0, 0x0, 0x808, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x808,
23812: 0x0, 0x0, 0x0, 0x0, 0x808, 0x0, 0x0, 0x0, 0x0, 0x0,
23813: 0x80000, 0x0, 0x808, 0x10000, 0x0, 0x0, 0x10000, 0x0,
23814: 0x10000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23815: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6000, 0x6000, 0x0,
23816: 0x0, 0x6000, 0x0, 0x0, 0x0, 0x0, 0x2000000, 0x0, 0x0,
23817: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80000000, 0x1000000,
23818: 0x1000000, 0x1000000, 0x1000000, 0x80000000, 0x0,
23819: 0x1000000, 0x1000000, 0x0, 0x0, 0x0, 0x0, 0x808, 0x0,
23820: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40000000,
23821: 0x40000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23822: 0x0, 0x0, 0xffffffff, 0x0, 0x0, 0x200, 0x0, 0x0, 0x0,
23823: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200,
23824: 0x808, 0x808, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23825: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200, 0x200,
23826: 0x0, 0x0, 0x100000, 0x100000, 0x0, 0x0, 0x0, 0x0,
23827: 0x10000, 0x0, 0x0, 0x10000, 0x0, 0x0, 0x0, 0x0, 0x0,
23828: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x808,
23829: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x808, 0x0, 0x0,
23830: 0x0, 0x100000, 0x100000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40,
23831: 0x80, 0x100, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x808,
23832: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x808,
23833: 0x0, 0x0, 0x0, 0x0, 0x808, 0x0, 0x0, 0x0, 0x0, 0x80000,
23834: 0x0, 0x0, 0x0, 0x0, 0x10000, 0x0, 0x0, 0x0, 0x0, 0x0,
23835: 0x0, 0x0, 0x0, 0x0, 0x0, 0x800, 0x0, 0x0, 0x0, 0x0,
23836: 0x0, 0x0, 0x0, 0x400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23837: 0x808, 0x200, 0x18000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23838: 0x0, 0x0, 0x0, 0x80000, 0x0, 0x10000, 0x0, 0x0, 0x0,
23839: 0x0, 0x0, 0x0, 0x0, 0x808, 0x0, 0x0, 0x0, 0x0, 0x0,
23840: 0x4000000, 0x0, 0x80000, 0x0, 0x0, 0x80000, 0x0, 0x0,
23841: 0x0, 0x0, 0x0, 0x0, 0x80000, 0x0, 0x808, 0x80000,
23842: 0x808, 0xfffff7f7, 0x808, 0xffffffff, 0xffffffff,
23843: 0x808, };
23844: }
23845:
23846: private static void jj_la1_4() {
23847: jj_la1_4 = new int[] { 0x80000000, 0x0, 0x80000000, 0x80004,
23848: 0x0, 0x0, 0x4000, 0x4000, 0x0, 0x80000000, 0x0, 0x0,
23849: 0x0, 0x0, 0x1000, 0x0, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0,
23850: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23851: 0x0, 0x0, 0x0, 0x0, 0x0, 0x400, 0x0, 0x0, 0x0, 0x0,
23852: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200, 0x0, 0x0, 0x0,
23853: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23854: 0x0, 0x0, 0x0, 0x0, 0x0, 0x100, 0x0, 0x200, 0x0, 0x0,
23855: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23856: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23857: 0x0, 0x0, 0x8, 0x0, 0x2000000, 0x0, 0x0, 0x2000000,
23858: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23859: 0xffffffff, 0x400000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23860: 0x400000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0,
23861: 0x0, 0x0, 0x0, 0x0, 0x400000, 0x0, 0x0, 0x0, 0x0, 0x0,
23862: 0x0, 0x0, 0x0, 0x0, 0x400000, 0x0, 0x20, 0x0, 0x0, 0x0,
23863: 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23864: 0x0, 0x0, 0x0, 0x0, 0x0, 0x100000, 0x200000, 0x0, 0x0,
23865: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23866: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000000,
23867: 0x0, 0x10000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23868: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10,
23869: 0x0, 0x10, 0x0, 0x0, 0x2000000, 0x2000000, 0x2000000,
23870: 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80000000, 0x0,
23871: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20,
23872: 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23873: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0,
23874: 0x0, 0x0, 0x400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23875: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x400, 0x0,
23876: 0x0, 0x0, 0x0, 0x0, 0x0, 0x4000, 0x80000004, 0x0, 0x0,
23877: 0x80000000, 0x4000, 0x0, 0x0, 0x0, 0x0, 0x0,
23878: 0x80000000, 0x0, 0x0, 0x80000004, 0x0, 0xffffffff, 0x0,
23879: 0xffffffff, 0xffffffff, 0x0, };
23880: }
23881:
23882: private static void jj_la1_5() {
23883: jj_la1_5 = new int[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23884: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23885: 0x10000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000, 0x0,
23886: 0x0, 0x8000000, 0x0, 0x10000, 0x0, 0x0, 0x8000000, 0x0,
23887: 0x400000, 0x0, 0x0, 0x10000, 0x400000, 0x400000,
23888: 0x400000, 0x0, 0x400000, 0x400000, 0x20000, 0x0, 0x0,
23889: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa0000, 0x0, 0x0,
23890: 0x0, 0x0, 0x20000, 0x2000003, 0x2000000, 0x0, 0x0,
23891: 0x2000003, 0x3, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23892: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4,
23893: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000, 0x0, 0x80000000,
23894: 0x0, 0x400000, 0x10, 0x0, 0x400000, 0x400400, 0x0, 0x0,
23895: 0x400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23896: 0x800000, 0xffffffff, 0x8000, 0x0, 0x0, 0x0, 0x0, 0x0,
23897: 0x0, 0x8000, 0x0, 0x800, 0x0, 0x0, 0x800, 0x0, 0x0,
23898: 0x1000000, 0x10000, 0x10000, 0x800, 0x0, 0x0, 0x8000,
23899: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x800000, 0x3,
23900: 0x8000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23901: 0x4000000, 0x0, 0x0, 0x0, 0x800000, 0x0, 0x0, 0x800000,
23902: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23903: 0x0, 0x0, 0x0, 0x10000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23904: 0x0, 0x10000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200, 0x0,
23905: 0x200, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6000, 0x6000,
23906: 0x0, 0x800000, 0x0, 0x0, 0x10000, 0x0, 0x0, 0x0, 0x0,
23907: 0x200000, 0x0, 0x200000, 0x0, 0x0, 0x10000, 0x0, 0x0,
23908: 0x200000, 0x0, 0x10000, 0x0, 0x0, 0x200000, 0x4000000,
23909: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23910: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20,
23911: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000,
23912: 0x1000000, 0x0, 0x80000000, 0x0, 0x0, 0x0, 0x0,
23913: 0x8000000, 0x0, 0x8000000, 0x8000000, 0x0, 0x200000,
23914: 0x800000, 0x200000, 0x0, 0x0, 0x0, 0x400000, 0x0, 0x0,
23915: 0x10000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23916: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23917: 0x10000, 0x0, 0x10000, 0xfffeffff, 0x10000, 0xffffffff,
23918: 0xffffffff, 0x10000, };
23919: }
23920:
23921: private static void jj_la1_6() {
23922: jj_la1_6 = new int[] { 0x2000000, 0x0, 0x2100000, 0x40000, 0x0,
23923: 0x400000, 0x400800, 0x400800, 0x0, 0x2100000, 0x0, 0x0,
23924: 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23925: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x100000,
23926: 0x0, 0x0, 0x0, 0x80, 0x0, 0x100, 0x8100, 0x8100,
23927: 0x8100, 0x0, 0x8100, 0x8100, 0x0, 0x0, 0x0, 0x0, 0x0,
23928: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23929: 0x10000000, 0x0, 0x0, 0x0, 0x10000000, 0x0, 0x10000000,
23930: 0x0, 0x4000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23931: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23932: 0x2000000, 0x2000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23933: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23934: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xffffffff, 0x0, 0x0,
23935: 0x4000000, 0x0, 0x0, 0x0, 0x0, 0x1000000, 0x0, 0x0,
23936: 0x0, 0x0, 0x0, 0x0, 0x400000, 0x4000000, 0x0, 0x0, 0x0,
23937: 0x0, 0x0, 0x1000000, 0x0, 0x0, 0x80, 0x0, 0x0, 0x0,
23938: 0x0, 0x0, 0x10000000, 0x1000000, 0x0, 0x0, 0x4000000,
23939: 0x4000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2000, 0x0, 0x0,
23940: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20000000, 0x20000000,
23941: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23942: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23943: 0x0, 0x0, 0x80000, 0x2, 0x80000, 0x80000, 0x0, 0x0,
23944: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23945: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23946: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23947: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x400000, 0x0, 0x0, 0x0,
23948: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23949: 0x0, 0x2000, 0x0, 0x0, 0x400000, 0x400000, 0x0,
23950: 0x4000000, 0x0, 0x0, 0x0, 0x0, 0x100, 0x100, 0x0, 0x0,
23951: 0x0, 0x0, 0x0, 0x20000, 0x0, 0x8020000, 0x0, 0x0, 0x0,
23952: 0x8100, 0x0, 0x0, 0x100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23953: 0x800, 0x2008000, 0x0, 0x0, 0x2008000, 0x800, 0x0, 0x0,
23954: 0x0, 0x0, 0x0, 0x2008000, 0x0, 0x1000, 0x2008000, 0x0,
23955: 0xffffffff, 0x0, 0xffffffff, 0xffffffff, 0x0, };
23956: }
23957:
23958: private static void jj_la1_7() {
23959: jj_la1_7 = new int[] { 0x2100000, 0x0, 0x2100000, 0x0, 0x0,
23960: 0x20000000, 0x20040080, 0x20000080, 0x0, 0x2100000,
23961: 0x80000000, 0x0, 0x0, 0x80000000, 0x0, 0x0, 0x0, 0x0,
23962: 0x5010040, 0x80, 0x80000000, 0x0, 0x0, 0x0, 0x80000000,
23963: 0x5010040, 0x0, 0x0, 0x40000, 0x0, 0x5010040, 0x800,
23964: 0x0, 0x40000, 0x0, 0x0, 0x0, 0x0, 0x5050040, 0x40000,
23965: 0x40000, 0x40000, 0x0, 0x40000, 0x40000, 0x0, 0x0,
23966: 0x10000000, 0x8000000, 0x0, 0x0, 0x0, 0x10000000, 0x0,
23967: 0x10000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23968: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8000000,
23969: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20000, 0x0, 0x0, 0x0,
23970: 0x0, 0x20000, 0x0, 0x0, 0x0, 0x2000000, 0x2000000, 0x0,
23971: 0x0, 0x5010040, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23972: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23973: 0x0, 0xffffffff, 0x0, 0x0, 0x400008, 0x0, 0x0, 0x0,
23974: 0x0, 0x0, 0x0, 0x200000, 0x0, 0x0, 0x200000, 0x0, 0x0,
23975: 0x408000, 0x5010040, 0x5010040, 0x200000, 0x1000000,
23976: 0x0, 0x0, 0x8000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23977: 0x0, 0x0, 0x0, 0x8000, 0x400000, 0x400000, 0x0, 0x0,
23978: 0x0, 0x0, 0x0, 0x100000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23979: 0x0, 0x0, 0x0, 0x0, 0x80000000, 0x0, 0x0, 0x0, 0x0,
23980: 0x80, 0x0, 0x0, 0x0, 0x0, 0x5010040, 0x0, 0x0, 0x0,
23981: 0x0, 0x0, 0x0, 0x0, 0x5010040, 0x0, 0x0, 0x0, 0x0, 0x0,
23982: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10,
23983: 0x10, 0x8000000, 0x0, 0x0, 0x0, 0x5010040, 0x0, 0x80,
23984: 0x40000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5010040, 0x0,
23985: 0x0, 0x0, 0x0, 0x5010040, 0x0, 0x0, 0x0, 0x0, 0x100000,
23986: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23987: 0x400000, 0x8000, 0x0, 0x8000, 0x0, 0x10040, 0x80, 0x0,
23988: 0x800, 0x800, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
23989: 0x0, 0x0, 0x5410040, 0x408000, 0x0, 0x0, 0x0, 0x0,
23990: 0x40000, 0x40000, 0x0, 0x0, 0x0, 0x0, 0x100000, 0x0,
23991: 0x0, 0x0, 0x0, 0x0, 0x0, 0x40000, 0x0, 0x0, 0x5050040,
23992: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x100000, 0x80, 0x0,
23993: 0x100000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x100000, 0x0,
23994: 0x5010040, 0x100000, 0x5010040, 0xfafeffbf, 0x5010040,
23995: 0xffffffff, 0xffffffff, 0x5010040, };
23996: }
23997:
23998: private static void jj_la1_8() {
23999: jj_la1_8 = new int[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24000: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1,
24001: 0xebf7fff0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xebf7fff0,
24002: 0x0, 0x0, 0x0, 0x2, 0xebf7fff0, 0x0, 0x0, 0x0, 0x0,
24003: 0x0, 0x0, 0x0, 0xebf7fff0, 0x400001, 0x0, 0x0,
24004: 0x400001, 0x0, 0x400001, 0x20900, 0x0, 0x0, 0x0, 0x0,
24005: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24006: 0x900, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24007: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20000, 0x0, 0x0,
24008: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24009: 0x0, 0xebf7fff0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24010: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24011: 0x0, 0x0, 0xeff7ffff, 0x40008, 0x0, 0x4000, 0x0, 0x0,
24012: 0x800030, 0x0, 0x40008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24013: 0x0, 0x0, 0xebf7fff0, 0xebf7fff0, 0x800030, 0x80000000,
24014: 0x0, 0x60008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24015: 0x0, 0x60008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24016: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24017: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24018: 0xebf7fff0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24019: 0xebf7fff0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24020: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24021: 0x0, 0xebf7fff0, 0x0, 0x0, 0x0, 0x0, 0x20108400,
24022: 0x100000, 0x20108400, 0x400, 0x0, 0xeff7fff0,
24023: 0x4000000, 0x4000000, 0x20108400, 0x0, 0xebf7fff0, 0x0,
24024: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x400001, 0x80,
24025: 0x0, 0x0, 0x1000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24026: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24027: 0x2000, 0x0, 0x0, 0x0, 0xebf7fff0, 0x0, 0x0, 0x0, 0x0,
24028: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24029: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xebf7fff0, 0x0, 0x0,
24030: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24031: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xebf7fff0, 0x0,
24032: 0xebf7fff0, 0x400000f, 0xebf7fff0, 0xeff7ffff,
24033: 0xeff7ffff, 0xebf7fff0, };
24034: }
24035:
24036: private static void jj_la1_9() {
24037: jj_la1_9 = new int[] { 0x0, 0x0, 0x840000, 0x0, 0x0, 0x0, 0x0,
24038: 0x0, 0x0, 0x840000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24039: 0x0, 0xfdffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24040: 0xfdffffff, 0x0, 0x0, 0x0, 0x0, 0xfdffffff, 0x0,
24041: 0x840000, 0x0, 0x2, 0x0, 0x0, 0x0, 0xfdffffff, 0x0,
24042: 0x0, 0x0, 0x0, 0x0, 0x0, 0x800, 0x0, 0x0, 0x0, 0x0,
24043: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24044: 0x800, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24045: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24046: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24047: 0xfdffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24048: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24049: 0x0, 0xfdffffff, 0x80, 0x0, 0x0, 0x0, 0xf8000000, 0x10,
24050: 0x0, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24051: 0xfdffffff, 0xfdffffff, 0x10, 0x0, 0x0, 0x80, 0x0, 0x0,
24052: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0, 0x0,
24053: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24054: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24055: 0x0, 0x0, 0x0, 0x0, 0x0, 0xfdffffff, 0x0, 0x0, 0x0,
24056: 0x0, 0x0, 0x0, 0x0, 0xfdffffff, 0x0, 0x0, 0x0, 0x0,
24057: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24058: 0x0, 0x0, 0x0, 0x0, 0x0, 0xfdffffff, 0x0, 0x400000,
24059: 0x0, 0x0, 0x200020, 0x0, 0x200020, 0x200000, 0x0,
24060: 0xfdffffff, 0x0, 0x0, 0x200020, 0x0, 0xfdffffff, 0x0,
24061: 0x0, 0x0, 0x0, 0x0, 0x400000, 0x0, 0x0, 0x0, 0x0, 0x0,
24062: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24063: 0x0, 0x0, 0x0, 0x0, 0x0, 0x4080000, 0x4080000, 0x0,
24064: 0x4080000, 0x0, 0x0, 0x0, 0x0, 0xfdffffff, 0x0, 0x0,
24065: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24066: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfdffffff,
24067: 0x0, 0x0, 0x4, 0x0, 0x100000, 0x0, 0x0, 0x0, 0x0, 0x0,
24068: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24069: 0xfdffffff, 0x0, 0xfdffffff, 0x0, 0xfdffffff,
24070: 0xfdffffff, 0xfdffffff, 0xfdffffff, };
24071: }
24072:
24073: private static void jj_la1_10() {
24074: jj_la1_10 = new int[] { 0x40000, 0x0, 0x40000, 0x1000, 0x0,
24075: 0x40, 0x40, 0x40, 0x0, 0x40000, 0x0, 0x0, 0x0, 0x0,
24076: 0x0, 0x0, 0x0, 0x0, 0x239ffff, 0x0, 0x0, 0x0, 0x0, 0x0,
24077: 0x0, 0x239ffff, 0x40000, 0x40000, 0x0, 0x0, 0x239ffff,
24078: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x239ffff, 0x0, 0x0,
24079: 0x0, 0x0, 0x0, 0x0, 0x22020300, 0x0, 0x0, 0x0, 0x0,
24080: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24081: 0x1000000, 0x0, 0x0, 0x0, 0x1000000, 0x0, 0x1000000,
24082: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x300,
24083: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24084: 0x0, 0x0, 0x0, 0x239ffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24085: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24086: 0x0, 0x0, 0x0, 0xffffffff, 0x0, 0x0, 0x180c00, 0xc00,
24087: 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1c000000,
24088: 0xc000000, 0x0, 0x0, 0x239ffff, 0x239ffff, 0x1c400000,
24089: 0xc0000000, 0x0, 0x300, 0x0, 0xc0000000, 0x0, 0x0, 0x0,
24090: 0x0, 0x0, 0x0, 0x1000000, 0x300, 0x0, 0x0, 0x0, 0x0,
24091: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24092: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24093: 0x0, 0x0, 0x0, 0x0, 0x239ffff, 0x0, 0x0, 0x0, 0x0, 0x0,
24094: 0x0, 0x0, 0x239ffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24095: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24096: 0x0, 0x0, 0x239ffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24097: 0x0, 0x0, 0x239ffff, 0x0, 0x0, 0x0, 0x0, 0x239ffff,
24098: 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0,
24099: 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24100: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4000,
24101: 0x0, 0x0, 0x0, 0x239ffff, 0x0, 0x10000, 0x0, 0x0, 0x0,
24102: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24103: 0x0, 0x0, 0x0, 0x0, 0x0, 0x239ffff, 0x0, 0x0, 0x0, 0x0,
24104: 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24105: 0x0, 0x0, 0x0, 0x0, 0x239ffff, 0x0, 0x239ffff,
24106: 0xfdc60000, 0x239ffff, 0xffffffff, 0xffffffff,
24107: 0x239ffff, };
24108: }
24109:
24110: private static void jj_la1_11() {
24111: jj_la1_11 = new int[] { 0x0, 0x100000, 0x0, 0x0, 0x100000, 0x0,
24112: 0x10000, 0x10000, 0x200000, 0x0, 0x0, 0x0, 0x0, 0x0,
24113: 0x0, 0x0, 0x0, 0x0, 0x7bfffefc, 0x10000, 0x0, 0x0, 0x0,
24114: 0x0, 0x0, 0x7bfffefc, 0x0, 0x0, 0x0, 0x0, 0x7bfffefc,
24115: 0x0, 0x0, 0x0, 0x100, 0x0, 0x0, 0x0, 0x7bfffefc, 0x0,
24116: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24117: 0x0, 0x0, 0x0, 0x0, 0x4000000, 0x0, 0x0, 0x0, 0x0, 0x0,
24118: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24119: 0x4000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24120: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24121: 0x7bfffefc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24122: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24123: 0x0, 0xfffffeff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24124: 0x0, 0x0, 0x0, 0x40000, 0x0, 0xc0000, 0x0, 0x0, 0x0,
24125: 0x7bfffefc, 0x7bfffefc, 0xc0000, 0x3, 0x0, 0x0, 0x0,
24126: 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24127: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24128: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24129: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7bfffefc, 0x0, 0x0,
24130: 0x0, 0x0, 0x0, 0x0, 0x0, 0x7bfffefc, 0x0, 0x0, 0x0,
24131: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24132: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7bfffefc, 0x0, 0x0,
24133: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfbfffefc,
24134: 0x80000000, 0x80000000, 0x0, 0x0, 0x7bfffefc, 0x0, 0x0,
24135: 0x4, 0x0, 0x0, 0x0, 0x63000000, 0x63000000, 0x0, 0x0,
24136: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24137: 0x10000, 0x4000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x480, 0x80,
24138: 0x0, 0x0, 0x0, 0x0, 0x0, 0x7bfffefc, 0x0, 0x0, 0x0,
24139: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24140: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x7bfffefc, 0x0,
24141: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24142: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7bfffefc, 0x0,
24143: 0x7bfffefc, 0x84000003, 0x7bfffefc, 0xfffffeff,
24144: 0xfffffeff, 0x7bfffefc, };
24145: }
24146:
24147: private static void jj_la1_12() {
24148: jj_la1_12 = new int[] { 0x80000000, 0x40, 0x80000000, 0x0,
24149: 0x40, 0x800000, 0x800000, 0x800000, 0x0, 0x80000000,
24150: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7ffffff, 0x0,
24151: 0x0, 0x0, 0x0, 0x0, 0x0, 0x7ffffff, 0x80000000, 0x0,
24152: 0x0, 0x0, 0x7ffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24153: 0x7ffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24154: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24155: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24156: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24157: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24158: 0x7ffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24159: 0x80000000, 0x80000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24160: 0x0, 0x0, 0x0, 0x0, 0x7ffffff, 0x0, 0x0, 0x0, 0x0, 0x0,
24161: 0x80000, 0x0, 0x0, 0x0, 0x0, 0x1000000, 0x0, 0x1000000,
24162: 0x0, 0x20000, 0x80000000, 0x7ffffff, 0x7ffffff,
24163: 0x1080000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200000, 0x0, 0x0,
24164: 0x0, 0x400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24165: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24166: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24167: 0x80000000, 0x0, 0x0, 0x0, 0x7ffffff, 0x0, 0x0, 0x0,
24168: 0x0, 0x0, 0x0, 0x0, 0x7ffffff, 0x0, 0x0, 0x0, 0x0, 0x0,
24169: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24170: 0x0, 0x0, 0x0, 0x0, 0x7ffffff, 0x0, 0x0, 0x0, 0x0,
24171: 0x40109, 0x0, 0x40109, 0x0, 0x0, 0x7ffffff, 0x0, 0x0,
24172: 0x40109, 0x0, 0x7ffffff, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0,
24173: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20000, 0x0,
24174: 0x80000000, 0x0, 0x80000000, 0x0, 0x0, 0x0, 0x10000,
24175: 0x0, 0x0, 0x0, 0x80, 0x0, 0x2001800, 0x2001800, 0x0,
24176: 0x0, 0x0, 0x20000, 0x0, 0x7ffffff, 0x80000000, 0x0,
24177: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24178: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4000, 0x0, 0x7ffffff,
24179: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x800000, 0x0, 0x0,
24180: 0x800000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x800000, 0x0,
24181: 0x7ffffff, 0x800000, 0x7ffffff, 0x0, 0x7ffffff,
24182: 0x7ffffff, 0x7ffffff, 0x7ffffff, };
24183: }
24184:
24185: private static void jj_la1_13() {
24186: jj_la1_13 = new int[] { 0x80002, 0x0, 0x80002, 0x0, 0x0, 0x0,
24187: 0x0, 0x0, 0x0, 0x80002, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24188: 0x0, 0x0, 0x4000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24189: 0x4000000, 0x80000, 0x80000, 0x0, 0x0, 0x4000000, 0x0,
24190: 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x4000000, 0x0, 0x0,
24191: 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x2,
24192: 0x0, 0x2, 0x0, 0x0, 0x2, 0x2, 0x2, 0x2, 0x0, 0x0, 0x0,
24193: 0x20, 0x2, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0,
24194: 0x80, 0x4000000, 0x0, 0x50, 0x0, 0x20, 0x0, 0x0, 0x0,
24195: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x8, 0x20,
24196: 0x4000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f000,
24197: 0x0, 0x0, 0x0, 0x7f000, 0x50, 0x50, 0x1000108,
24198: 0x1000108, 0x50, 0x2000080, 0x80, 0x0, 0x4000000, 0x0,
24199: 0x20, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x20, 0x0, 0x0,
24200: 0x20, 0x0, 0x0, 0x0, 0x80050, 0x4000002, 0x4000000,
24201: 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0,
24202: 0x0, 0x0, 0x0, 0x0, 0x24, 0x0, 0x80000, 0x0, 0x20,
24203: 0x20, 0x0, 0x0, 0x0, 0x0, 0x20, 0x20, 0x0, 0x0, 0x20,
24204: 0x0, 0x20, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20,
24205: 0x0, 0x0, 0x0, 0x2, 0x0, 0x4000000, 0x0, 0x0, 0x2, 0x0,
24206: 0x0, 0x2, 0x0, 0x4000000, 0x2, 0x20, 0x20, 0x0, 0x0,
24207: 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0,
24208: 0x0, 0x0, 0x20, 0x0, 0x4000000, 0x0, 0x0, 0x0, 0x0,
24209: 0x0, 0x0, 0x0, 0x0, 0x20, 0x4000000, 0x0, 0x0, 0x0,
24210: 0x20, 0x4000000, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24211: 0x0, 0x0, 0x0, 0x0, 0x2, 0x20, 0x0, 0x0, 0x0, 0x50,
24212: 0x50, 0x50, 0x0, 0x0, 0x0, 0x0, 0x4000, 0x4000, 0x0,
24213: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4000, 0x0, 0x0,
24214: 0x4080000, 0x80050, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24215: 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24216: 0x0, 0x0, 0x4000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24217: 0x0, 0x0, 0x20, 0x0, 0x0, 0x2, 0x20, 0x2, 0x2, 0x2,
24218: 0x0, 0x20, 0x4000000, 0x0, 0x4000000, 0x0, 0x0,
24219: 0x4000000, 0x4000000, 0x4000000, };
24220: }
24221:
24222: private static void jj_la1_14() {
24223: jj_la1_14 = new int[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24224: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1,
24225: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0,
24226: 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0,
24227: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24228: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24229: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24230: 0x0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24231: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
24232: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24233: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0,
24234: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24235: 0x72, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24236: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24237: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24238: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24239: 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24240: 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24241: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1,
24242: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0,
24243: 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24244: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x72, 0x0,
24245: 0x72, 0x42, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24246: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11, 0x72, 0x0,
24247: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24248: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0,
24249: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
24250: 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x1, 0x0, 0x0,
24251: 0x1, 0x1, 0x1, };
24252: }
24253:
24254: final private JJCalls[] jj_2_rtns = new JJCalls[47];
24255: private boolean jj_rescan = false;
24256: private int jj_gc = 0;
24257:
24258: public SQLParser(CharStream stream) {
24259: token_source = new SQLParserTokenManager(stream);
24260: token = new Token();
24261: token.next = jj_nt = token_source.getNextToken();
24262: jj_gen = 0;
24263: for (int i = 0; i < 306; i++)
24264: jj_la1[i] = -1;
24265: for (int i = 0; i < jj_2_rtns.length; i++)
24266: jj_2_rtns[i] = new JJCalls();
24267: }
24268:
24269: public void ReInit(CharStream stream) {
24270: token_source.ReInit(stream);
24271: token = new Token();
24272: token.next = jj_nt = token_source.getNextToken();
24273: jj_gen = 0;
24274: for (int i = 0; i < 306; i++)
24275: jj_la1[i] = -1;
24276: for (int i = 0; i < jj_2_rtns.length; i++)
24277: jj_2_rtns[i] = new JJCalls();
24278: }
24279:
24280: public SQLParser(SQLParserTokenManager tm) {
24281: token_source = tm;
24282: token = new Token();
24283: token.next = jj_nt = token_source.getNextToken();
24284: jj_gen = 0;
24285: for (int i = 0; i < 306; i++)
24286: jj_la1[i] = -1;
24287: for (int i = 0; i < jj_2_rtns.length; i++)
24288: jj_2_rtns[i] = new JJCalls();
24289: }
24290:
24291: public void ReInit(SQLParserTokenManager tm) {
24292: token_source = tm;
24293: token = new Token();
24294: token.next = jj_nt = token_source.getNextToken();
24295: jj_gen = 0;
24296: for (int i = 0; i < 306; i++)
24297: jj_la1[i] = -1;
24298: for (int i = 0; i < jj_2_rtns.length; i++)
24299: jj_2_rtns[i] = new JJCalls();
24300: }
24301:
24302: final private Token jj_consume_token(int kind)
24303: throws ParseException {
24304: Token oldToken = token;
24305: if ((token = jj_nt).next != null)
24306: jj_nt = jj_nt.next;
24307: else
24308: jj_nt = jj_nt.next = token_source.getNextToken();
24309: if (token.kind == kind) {
24310: jj_gen++;
24311: if (++jj_gc > 100) {
24312: jj_gc = 0;
24313: for (int i = 0; i < jj_2_rtns.length; i++) {
24314: JJCalls c = jj_2_rtns[i];
24315: while (c != null) {
24316: if (c.gen < jj_gen)
24317: c.first = null;
24318: c = c.next;
24319: }
24320: }
24321: }
24322: return token;
24323: }
24324: jj_nt = token;
24325: token = oldToken;
24326: jj_kind = kind;
24327: throw generateParseException();
24328: }
24329:
24330: static private final class LookaheadSuccess extends java.lang.Error {
24331: }
24332:
24333: final private LookaheadSuccess jj_ls = new LookaheadSuccess();
24334:
24335: final private boolean jj_scan_token(int kind) {
24336: if (jj_scanpos == jj_lastpos) {
24337: jj_la--;
24338: if (jj_scanpos.next == null) {
24339: jj_lastpos = jj_scanpos = jj_scanpos.next = token_source
24340: .getNextToken();
24341: } else {
24342: jj_lastpos = jj_scanpos = jj_scanpos.next;
24343: }
24344: } else {
24345: jj_scanpos = jj_scanpos.next;
24346: }
24347: if (jj_rescan) {
24348: int i = 0;
24349: Token tok = token;
24350: while (tok != null && tok != jj_scanpos) {
24351: i++;
24352: tok = tok.next;
24353: }
24354: if (tok != null)
24355: jj_add_error_token(kind, i);
24356: }
24357: if (jj_scanpos.kind != kind)
24358: return true;
24359: if (jj_la == 0 && jj_scanpos == jj_lastpos)
24360: throw jj_ls;
24361: return false;
24362: }
24363:
24364: final public Token getNextToken() {
24365: if ((token = jj_nt).next != null)
24366: jj_nt = jj_nt.next;
24367: else
24368: jj_nt = jj_nt.next = token_source.getNextToken();
24369: jj_gen++;
24370: return token;
24371: }
24372:
24373: final public Token getToken(int index) {
24374: Token t = lookingAhead ? jj_scanpos : token;
24375: for (int i = 0; i < index; i++) {
24376: if (t.next != null)
24377: t = t.next;
24378: else
24379: t = t.next = token_source.getNextToken();
24380: }
24381: return t;
24382: }
24383:
24384: private java.util.Vector jj_expentries = new java.util.Vector();
24385: private int[] jj_expentry;
24386: private int jj_kind = -1;
24387: private int[] jj_lasttokens = new int[100];
24388: private int jj_endpos;
24389:
24390: private void jj_add_error_token(int kind, int pos) {
24391: if (pos >= 100)
24392: return;
24393: if (pos == jj_endpos + 1) {
24394: jj_lasttokens[jj_endpos++] = kind;
24395: } else if (jj_endpos != 0) {
24396: jj_expentry = new int[jj_endpos];
24397: for (int i = 0; i < jj_endpos; i++) {
24398: jj_expentry[i] = jj_lasttokens[i];
24399: }
24400: boolean exists = false;
24401: for (java.util.Enumeration e = jj_expentries.elements(); e
24402: .hasMoreElements();) {
24403: int[] oldentry = (int[]) (e.nextElement());
24404: if (oldentry.length == jj_expentry.length) {
24405: exists = true;
24406: for (int i = 0; i < jj_expentry.length; i++) {
24407: if (oldentry[i] != jj_expentry[i]) {
24408: exists = false;
24409: break;
24410: }
24411: }
24412: if (exists)
24413: break;
24414: }
24415: }
24416: if (!exists)
24417: jj_expentries.addElement(jj_expentry);
24418: if (pos != 0)
24419: jj_lasttokens[(jj_endpos = pos) - 1] = kind;
24420: }
24421: }
24422:
24423: public ParseException generateParseException() {
24424: jj_expentries.removeAllElements();
24425: boolean[] la1tokens = new boolean[467];
24426: for (int i = 0; i < 467; i++) {
24427: la1tokens[i] = false;
24428: }
24429: if (jj_kind >= 0) {
24430: la1tokens[jj_kind] = true;
24431: jj_kind = -1;
24432: }
24433: for (int i = 0; i < 306; i++) {
24434: if (jj_la1[i] == jj_gen) {
24435: for (int j = 0; j < 32; j++) {
24436: if ((jj_la1_0[i] & (1 << j)) != 0) {
24437: la1tokens[j] = true;
24438: }
24439: if ((jj_la1_1[i] & (1 << j)) != 0) {
24440: la1tokens[32 + j] = true;
24441: }
24442: if ((jj_la1_2[i] & (1 << j)) != 0) {
24443: la1tokens[64 + j] = true;
24444: }
24445: if ((jj_la1_3[i] & (1 << j)) != 0) {
24446: la1tokens[96 + j] = true;
24447: }
24448: if ((jj_la1_4[i] & (1 << j)) != 0) {
24449: la1tokens[128 + j] = true;
24450: }
24451: if ((jj_la1_5[i] & (1 << j)) != 0) {
24452: la1tokens[160 + j] = true;
24453: }
24454: if ((jj_la1_6[i] & (1 << j)) != 0) {
24455: la1tokens[192 + j] = true;
24456: }
24457: if ((jj_la1_7[i] & (1 << j)) != 0) {
24458: la1tokens[224 + j] = true;
24459: }
24460: if ((jj_la1_8[i] & (1 << j)) != 0) {
24461: la1tokens[256 + j] = true;
24462: }
24463: if ((jj_la1_9[i] & (1 << j)) != 0) {
24464: la1tokens[288 + j] = true;
24465: }
24466: if ((jj_la1_10[i] & (1 << j)) != 0) {
24467: la1tokens[320 + j] = true;
24468: }
24469: if ((jj_la1_11[i] & (1 << j)) != 0) {
24470: la1tokens[352 + j] = true;
24471: }
24472: if ((jj_la1_12[i] & (1 << j)) != 0) {
24473: la1tokens[384 + j] = true;
24474: }
24475: if ((jj_la1_13[i] & (1 << j)) != 0) {
24476: la1tokens[416 + j] = true;
24477: }
24478: if ((jj_la1_14[i] & (1 << j)) != 0) {
24479: la1tokens[448 + j] = true;
24480: }
24481: }
24482: }
24483: }
24484: for (int i = 0; i < 467; i++) {
24485: if (la1tokens[i]) {
24486: jj_expentry = new int[1];
24487: jj_expentry[0] = i;
24488: jj_expentries.addElement(jj_expentry);
24489: }
24490: }
24491: jj_endpos = 0;
24492: jj_rescan_token();
24493: jj_add_error_token(0, 0);
24494: int[][] exptokseq = new int[jj_expentries.size()][];
24495: for (int i = 0; i < jj_expentries.size(); i++) {
24496: exptokseq[i] = (int[]) jj_expentries.elementAt(i);
24497: }
24498: return new ParseException(token, exptokseq,
24499: SQLParserConstants.tokenImage);
24500: }
24501:
24502: final public void enable_tracing() {
24503: }
24504:
24505: final public void disable_tracing() {
24506: }
24507:
24508: final private void jj_rescan_token() {
24509: jj_rescan = true;
24510: for (int i = 0; i < 47; i++) {
24511: try {
24512: JJCalls p = jj_2_rtns[i];
24513: do {
24514: if (p.gen > jj_gen) {
24515: jj_la = p.arg;
24516: jj_lastpos = jj_scanpos = p.first;
24517: switch (i) {
24518: case 0:
24519: jj_3_1();
24520: break;
24521: case 1:
24522: jj_3_2();
24523: break;
24524: case 2:
24525: jj_3_3();
24526: break;
24527: case 3:
24528: jj_3_4();
24529: break;
24530: case 4:
24531: jj_3_5();
24532: break;
24533: case 5:
24534: jj_3_6();
24535: break;
24536: case 6:
24537: jj_3_7();
24538: break;
24539: case 7:
24540: jj_3_8();
24541: break;
24542: case 8:
24543: jj_3_9();
24544: break;
24545: case 9:
24546: jj_3_10();
24547: break;
24548: case 10:
24549: jj_3_11();
24550: break;
24551: case 11:
24552: jj_3_12();
24553: break;
24554: case 12:
24555: jj_3_13();
24556: break;
24557: case 13:
24558: jj_3_14();
24559: break;
24560: case 14:
24561: jj_3_15();
24562: break;
24563: case 15:
24564: jj_3_16();
24565: break;
24566: case 16:
24567: jj_3_17();
24568: break;
24569: case 17:
24570: jj_3_18();
24571: break;
24572: case 18:
24573: jj_3_19();
24574: break;
24575: case 19:
24576: jj_3_20();
24577: break;
24578: case 20:
24579: jj_3_21();
24580: break;
24581: case 21:
24582: jj_3_22();
24583: break;
24584: case 22:
24585: jj_3_23();
24586: break;
24587: case 23:
24588: jj_3_24();
24589: break;
24590: case 24:
24591: jj_3_25();
24592: break;
24593: case 25:
24594: jj_3_26();
24595: break;
24596: case 26:
24597: jj_3_27();
24598: break;
24599: case 27:
24600: jj_3_28();
24601: break;
24602: case 28:
24603: jj_3_29();
24604: break;
24605: case 29:
24606: jj_3_30();
24607: break;
24608: case 30:
24609: jj_3_31();
24610: break;
24611: case 31:
24612: jj_3_32();
24613: break;
24614: case 32:
24615: jj_3_33();
24616: break;
24617: case 33:
24618: jj_3_34();
24619: break;
24620: case 34:
24621: jj_3_35();
24622: break;
24623: case 35:
24624: jj_3_36();
24625: break;
24626: case 36:
24627: jj_3_37();
24628: break;
24629: case 37:
24630: jj_3_38();
24631: break;
24632: case 38:
24633: jj_3_39();
24634: break;
24635: case 39:
24636: jj_3_40();
24637: break;
24638: case 40:
24639: jj_3_41();
24640: break;
24641: case 41:
24642: jj_3_42();
24643: break;
24644: case 42:
24645: jj_3_43();
24646: break;
24647: case 43:
24648: jj_3_44();
24649: break;
24650: case 44:
24651: jj_3_45();
24652: break;
24653: case 45:
24654: jj_3_46();
24655: break;
24656: case 46:
24657: jj_3_47();
24658: break;
24659: }
24660: }
24661: p = p.next;
24662: } while (p != null);
24663: } catch (LookaheadSuccess ls) {
24664: }
24665: }
24666: jj_rescan = false;
24667: }
24668:
24669: final private void jj_save(int index, int xla) {
24670: JJCalls p = jj_2_rtns[index];
24671: while (p.gen > jj_gen) {
24672: if (p.next == null) {
24673: p = p.next = new JJCalls();
24674: break;
24675: }
24676: p = p.next;
24677: }
24678: p.gen = jj_gen + xla - jj_la;
24679: p.first = token;
24680: p.arg = xla;
24681: }
24682:
24683: static final class JJCalls {
24684: int gen;
24685: Token first;
24686: int arg;
24687: JJCalls next;
24688: }
24689:
24690: }
|