if (hasTerminalNode(context, JavaParser.DOT)) {
return processScopedExpression(context);
}
if (hasTerminalNode(context, JavaParser.LBRACK)) {
ArrayAccess arrayAccess = createNode(context, ArrayAccess.class);
if (context.getChildCount() > 0 && context.getChild(0) instanceof ExpressionContext) {
ExpressionContext expressionContext = (ExpressionContext) context.getChild(0);
arrayAccess.setArray(getAdapter(ExpressionAdapter.class).adapt(expressionContext));
}
if (context.getChildCount() > 2 && context.getChild(2) instanceof ExpressionContext) {
ExpressionContext expressionContext = (ExpressionContext) context.getChild(2);
arrayAccess.setIndex(getAdapter(ExpressionAdapter.class).adapt(expressionContext));
}
return arrayAccess;
}