/* * postfixUnaryExpression * : atomicExpression postfixUnaryOperation* * : callableReference postfixUnaryOperation* * ; * * postfixUnaryOperation * : "++" : "--" : "!!" * : typeArguments? valueArguments (getEntryPoint? functionLiteral) * : typeArguments (getEntryPoint? functionLiteral) * : arrayAccess * : memberAccessOperation postfixUnaryExpression // TODO: Review * ; */ private void parsePostfixExpression() { PsiBuilder.Marker expression = mark(); boolean doubleColonExpression = parseDoubleColonExpression(); if (!doubleColonExpression) { parseAtomicExpression(); } while (true) { if (interruptedWithNewLine()) { break; } else if (at(LBRACKET)) { parseArrayAccess(); expression.done(ARRAY_ACCESS_EXPRESSION); } else if (!doubleColonExpression && parseCallSuffix()) { expression.done(CALL_EXPRESSION); } else if (at(DOT)) { advance(); // DOT parseCallExpression(); expression.done(DOT_QUALIFIED_EXPRESSION); } else if (at(SAFE_ACCESS)) { advance(); // SAFE_ACCESS parseCallExpression(); expression.done(SAFE_ACCESS_EXPRESSION); } else if (atSet(Precedence.POSTFIX.getOperations())) { parseOperationReference(); expression.done(POSTFIX_EXPRESSION); } else { break; } expression = expression.precede(); } expression.drop(); }