/*
* <A NAME="tableReference">tableReference</A>
*/
final public FromTable tableReference(boolean nestedInParens) throws ParseException, StandardException {
JavaToSQLValueNode javaToSQLNode = null;
TableName tableName;
String correlationName = null;
ResultColumnList derivedRCL = null;
FromTable fromTable;
TableOperatorNode joinTable = null;
FromTable tableReference;
Object[] optionalTableClauses = new Object[OPTIONAL_TABLE_CLAUSES_SIZE];
Properties tableProperties = null;
ResultSetNode derivedTable;
if (jj_2_41(1)) {
if (newInvocationFollows(1)) {
javaToSQLNode = newInvocation();
} else {
switch (jj_nt.kind) {
case TABLE:
javaToSQLNode = vtiTableConstruct();
break;
default:
jj_la1[180] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
switch (jj_nt.kind) {
case AS:
jj_consume_token(AS);
break;
default:
jj_la1[181] = jj_gen;
;
}
correlationName = identifier(Limits.MAX_IDENTIFIER_LENGTH, true);
switch (jj_nt.kind) {
case LEFT_PAREN:
jj_consume_token(LEFT_PAREN);
derivedRCL = derivedColumnList();
jj_consume_token(RIGHT_PAREN);
break;
default:
jj_la1[182] = jj_gen;
;
}
switch (jj_nt.kind) {
case DERBYDASHPROPERTIES:
optionalTableClauses = optionalTableProperties();
break;
default:
jj_la1[183] = jj_gen;
;
}
label_26:
while (true) {
if (joinedTableExpressionFollows()) {
;
} else {
break label_26;
}
joinTable = joinedTableExpression((joinTable != null) ?
joinTable :
(FromTable) nodeFactory.getNode(
C_NodeTypes.FROM_VTI,
javaToSQLNode.getJavaValueNode(),
correlationName,
derivedRCL,
((optionalTableClauses != null) ?
(Properties) optionalTableClauses[OPTIONAL_TABLE_CLAUSES_TABLE_PROPERTIES] :
(Properties) null),
getContextManager()),
nestedInParens);
}
/* Build a derived table if not a join expression */
if (joinTable == null)
{
fromTable = (FromTable) nodeFactory.getNode(
C_NodeTypes.FROM_VTI,
javaToSQLNode.getJavaValueNode(),
correlationName,
derivedRCL,
((optionalTableClauses != null) ?
(Properties) optionalTableClauses[OPTIONAL_TABLE_CLAUSES_TABLE_PROPERTIES] :
(Properties) null),