// $ANTLR start selectColumn
// QSpecBuilder.g:291:1: selectColumn returns [SelectColumn sc] : ( ^( SELECTCOLUMN id= ID ge= GROOVYEXPRESSION ( ^( TYPENAME t= typeName ) )? ) | ^( SELECTCOLUMN id= ID ) );
public final SelectColumn selectColumn() throws RecognitionException {
SelectColumn sc = null;
CommonTree id=null;
CommonTree ge=null;
typeName_return t = null;
sc = new SelectColumn();
try {
// QSpecBuilder.g:295:1: ( ^( SELECTCOLUMN id= ID ge= GROOVYEXPRESSION ( ^( TYPENAME t= typeName ) )? ) | ^( SELECTCOLUMN id= ID ) )
int alt24=2;
int LA24_0 = input.LA(1);
if ( (LA24_0==SELECTCOLUMN) ) {
int LA24_1 = input.LA(2);
if ( (LA24_1==DOWN) ) {
int LA24_2 = input.LA(3);
if ( (LA24_2==ID) ) {
int LA24_3 = input.LA(4);
if ( (LA24_3==UP) ) {
alt24=2;
}
else if ( (LA24_3==GROOVYEXPRESSION) ) {
alt24=1;
}
else {
NoViableAltException nvae =
new NoViableAltException("291:1: selectColumn returns [SelectColumn sc] : ( ^( SELECTCOLUMN id= ID ge= GROOVYEXPRESSION ( ^( TYPENAME t= typeName ) )? ) | ^( SELECTCOLUMN id= ID ) );", 24, 3, input);
throw nvae;
}
}
else {
NoViableAltException nvae =
new NoViableAltException("291:1: selectColumn returns [SelectColumn sc] : ( ^( SELECTCOLUMN id= ID ge= GROOVYEXPRESSION ( ^( TYPENAME t= typeName ) )? ) | ^( SELECTCOLUMN id= ID ) );", 24, 2, input);
throw nvae;
}
}
else {
NoViableAltException nvae =
new NoViableAltException("291:1: selectColumn returns [SelectColumn sc] : ( ^( SELECTCOLUMN id= ID ge= GROOVYEXPRESSION ( ^( TYPENAME t= typeName ) )? ) | ^( SELECTCOLUMN id= ID ) );", 24, 1, input);
throw nvae;
}
}
else {
NoViableAltException nvae =
new NoViableAltException("291:1: selectColumn returns [SelectColumn sc] : ( ^( SELECTCOLUMN id= ID ge= GROOVYEXPRESSION ( ^( TYPENAME t= typeName ) )? ) | ^( SELECTCOLUMN id= ID ) );", 24, 0, input);
throw nvae;
}
switch (alt24) {
case 1 :
// QSpecBuilder.g:296:3: ^( SELECTCOLUMN id= ID ge= GROOVYEXPRESSION ( ^( TYPENAME t= typeName ) )? )
{
match(input,SELECTCOLUMN,FOLLOW_SELECTCOLUMN_in_selectColumn892);
match(input, Token.DOWN, null);
id=(CommonTree)input.LT(1);
match(input,ID,FOLLOW_ID_in_selectColumn896);
sc.setAlias(id.getText());
ge=(CommonTree)input.LT(1);
match(input,GROOVYEXPRESSION,FOLLOW_GROOVYEXPRESSION_in_selectColumn902);
sc.setExpr(ge.getText());
// QSpecBuilder.g:296:95: ( ^( TYPENAME t= typeName ) )?
int alt23=2;
int LA23_0 = input.LA(1);
if ( (LA23_0==TYPENAME) ) {
alt23=1;
}
switch (alt23) {
case 1 :
// QSpecBuilder.g:296:96: ^( TYPENAME t= typeName )
{
match(input,TYPENAME,FOLLOW_TYPENAME_in_selectColumn908);
match(input, Token.DOWN, null);
pushFollow(FOLLOW_typeName_in_selectColumn912);
t=typeName();
_fsp--;
sc.setTypeName(input.getTokenStream().toString(
input.getTreeAdaptor().getTokenStartIndex(t.start),
input.getTreeAdaptor().getTokenStopIndex(t.start)));
match(input, Token.UP, null);
}
break;
}
match(input, Token.UP, null);
}
break;
case 2 :
// QSpecBuilder.g:297:3: ^( SELECTCOLUMN id= ID )
{
match(input,SELECTCOLUMN,FOLLOW_SELECTCOLUMN_in_selectColumn925);
match(input, Token.DOWN, null);
id=(CommonTree)input.LT(1);
match(input,ID,FOLLOW_ID_in_selectColumn930);
sc.setAlias(id.getText());
match(input, Token.UP, null);
}
break;