// $ANTLR start ordercolumn
// QSpecBuilder.g:157:1: ordercolumn returns [OrderColumn oc] : ( ^( ORDERCOLUMN i= ID ASC ) | ^( ORDERCOLUMN i= ID DESC ) | ^( ORDERCOLUMN i= ID ) );
public final OrderColumn ordercolumn() throws RecognitionException {
OrderColumn oc = null;
CommonTree i=null;
oc = new OrderColumn();
oc.setOrder(Order.ASC);
try {
// QSpecBuilder.g:163:1: ( ^( ORDERCOLUMN i= ID ASC ) | ^( ORDERCOLUMN i= ID DESC ) | ^( ORDERCOLUMN i= ID ) )
int alt12=3;
int LA12_0 = input.LA(1);
if ( (LA12_0==ORDERCOLUMN) ) {
int LA12_1 = input.LA(2);
if ( (LA12_1==DOWN) ) {
int LA12_2 = input.LA(3);
if ( (LA12_2==ID) ) {
switch ( input.LA(4) ) {
case ASC:
{
alt12=1;
}
break;
case DESC:
{
alt12=2;
}
break;
case UP:
{
alt12=3;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("157:1: ordercolumn returns [OrderColumn oc] : ( ^( ORDERCOLUMN i= ID ASC ) | ^( ORDERCOLUMN i= ID DESC ) | ^( ORDERCOLUMN i= ID ) );", 12, 3, input);
throw nvae;
}
}
else {
NoViableAltException nvae =
new NoViableAltException("157:1: ordercolumn returns [OrderColumn oc] : ( ^( ORDERCOLUMN i= ID ASC ) | ^( ORDERCOLUMN i= ID DESC ) | ^( ORDERCOLUMN i= ID ) );", 12, 2, input);
throw nvae;
}
}
else {
NoViableAltException nvae =
new NoViableAltException("157:1: ordercolumn returns [OrderColumn oc] : ( ^( ORDERCOLUMN i= ID ASC ) | ^( ORDERCOLUMN i= ID DESC ) | ^( ORDERCOLUMN i= ID ) );", 12, 1, input);
throw nvae;
}
}
else {
NoViableAltException nvae =
new NoViableAltException("157:1: ordercolumn returns [OrderColumn oc] : ( ^( ORDERCOLUMN i= ID ASC ) | ^( ORDERCOLUMN i= ID DESC ) | ^( ORDERCOLUMN i= ID ) );", 12, 0, input);
throw nvae;
}
switch (alt12) {
case 1 :
// QSpecBuilder.g:164:2: ^( ORDERCOLUMN i= ID ASC )
{
match(input,ORDERCOLUMN,FOLLOW_ORDERCOLUMN_in_ordercolumn365);
match(input, Token.DOWN, null);
i=(CommonTree)input.LT(1);
match(input,ID,FOLLOW_ID_in_ordercolumn369);
match(input,ASC,FOLLOW_ASC_in_ordercolumn371);
match(input, Token.UP, null);
oc.setName(i.getText());
}
break;
case 2 :
// QSpecBuilder.g:165:2: ^( ORDERCOLUMN i= ID DESC )
{
match(input,ORDERCOLUMN,FOLLOW_ORDERCOLUMN_in_ordercolumn380);
match(input, Token.DOWN, null);
i=(CommonTree)input.LT(1);
match(input,ID,FOLLOW_ID_in_ordercolumn384);
match(input,DESC,FOLLOW_DESC_in_ordercolumn386);
match(input, Token.UP, null);
oc.setName(i.getText()); oc.setOrder(Order.DESC);
}
break;
case 3 :
// QSpecBuilder.g:166:2: ^( ORDERCOLUMN i= ID )
{
match(input,ORDERCOLUMN,FOLLOW_ORDERCOLUMN_in_ordercolumn395);
match(input, Token.DOWN, null);
i=(CommonTree)input.LT(1);
match(input,ID,FOLLOW_ID_in_ordercolumn399);
match(input, Token.UP, null);
oc.setName(i.getText());
}
break;
}