// $ANTLR start "abstract_declarator"
// C:\\Users\\line47\\workspace\\ObjCFYPA\\src\\com\\icona\\antlr\\main\\ObjectiveC.g:201:1: abstract_declarator returns [ArrayType arrayType] : ( ( '[' (c= constant_expression )? ']' )+ |);
public final ArrayType abstract_declarator() throws RecognitionException {
ArrayType arrayType = null;
Expression c =null;
arrayType =null;
Expression dimension=null;
try {
// C:\\Users\\line47\\workspace\\ObjCFYPA\\src\\com\\icona\\antlr\\main\\ObjectiveC.g:208:3: ( ( '[' (c= constant_expression )? ']' )+ |)
int alt27=2;
int LA27_0 = input.LA(1);
if ( (LA27_0==65) ) {
alt27=1;
}
else if ( (LA27_0==EOF||LA27_0==28||LA27_0==34||LA27_0==42||LA27_0==93) ) {
alt27=2;
}
else {
if (state.backtracking>0) {state.failed=true; return arrayType;}
NoViableAltException nvae =
new NoViableAltException("", 27, 0, input);
throw nvae;
}
switch (alt27) {
case 1 :
// C:\\Users\\line47\\workspace\\ObjCFYPA\\src\\com\\icona\\antlr\\main\\ObjectiveC.g:216:3: ( '[' (c= constant_expression )? ']' )+
{
if ( state.backtracking==0 ) { arrayType =new ArrayType(); }
// C:\\Users\\line47\\workspace\\ObjCFYPA\\src\\com\\icona\\antlr\\main\\ObjectiveC.g:217:4: ( '[' (c= constant_expression )? ']' )+
int cnt26=0;
loop26:
do {
int alt26=2;
int LA26_0 = input.LA(1);
if ( (LA26_0==65) ) {
alt26=1;
}
switch (alt26) {
case 1 :
// C:\\Users\\line47\\workspace\\ObjCFYPA\\src\\com\\icona\\antlr\\main\\ObjectiveC.g:217:5: '[' (c= constant_expression )? ']'
{
match(input,65,FOLLOW_65_in_abstract_declarator639); if (state.failed) return arrayType;
if ( state.backtracking==0 ) {dimension=null;}
// C:\\Users\\line47\\workspace\\ObjCFYPA\\src\\com\\icona\\antlr\\main\\ObjectiveC.g:219:4: (c= constant_expression )?
int alt25=2;
int LA25_0 = input.LA(1);
if ( ((LA25_0 >= CHARACTER_LITERAL && LA25_0 <= DECIMAL_LITERAL)||LA25_0==FLOATING_POINT_LITERAL||LA25_0==HEX_LITERAL||LA25_0==IDENTIFIER||LA25_0==OCTAL_LITERAL||LA25_0==STRING_LITERAL||LA25_0==20||LA25_0==25||LA25_0==27||LA25_0==29||LA25_0==32||(LA25_0 >= 35 && LA25_0 <= 36)||LA25_0==98) ) {
alt25=1;
}
switch (alt25) {
case 1 :
// C:\\Users\\line47\\workspace\\ObjCFYPA\\src\\com\\icona\\antlr\\main\\ObjectiveC.g:219:5: c= constant_expression
{
pushFollow(FOLLOW_constant_expression_in_abstract_declarator653);
c=constant_expression();
state._fsp--;
if (state.failed) return arrayType;
if ( state.backtracking==0 ) {
dimension=c;
}
}
break;
}
if ( state.backtracking==0 ) {arrayType.addDimensionExpression(dimension);}
match(input,66,FOLLOW_66_in_abstract_declarator667); if (state.failed) return arrayType;
}
break;