/*
* <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 (newInvocationFollows(1)) {
javaToSQLNode = newInvocation();
switch (jj_nt.kind) {
case AS:
jj_consume_token(AS);
break;
default:
jj_la1[171] = 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[172] = jj_gen;
;
}
switch (jj_nt.kind) {
case PROPERTIES:
optionalTableClauses = optionalTableProperties();
break;
default:
jj_la1[173] = jj_gen;
;
}
label_25:
while (true) {
if (joinedTableExpressionFollows()) {
;
} else {
break label_25;
}
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),