/** * This method parse an instance of expression with its associated class or * interface reference. * * <code> * ---------------- * ($object instanceof Clazz); * ---------------- * * ------------------------ * ($object instanceof Clazz::$clazz); * ------------------------ * * ----------------- * ($object instanceof $clazz); * ----------------- * * ----------------------- * ($object instanceof $clazz->type); * ----------------------- * * ----------------------------- * ($object instanceof static|self|parent); * ----------------------------- * </code> * * @return PHP_Depend_Code_ASTInstanceOfExpression * @since 0.9.6 */ private function parseInstanceOfExpression() { // Consume the "instanceof" keyword and strip comments $token = $this->consumeToken(self::T_INSTANCEOF); return $this->parseExpressionTypeReference($this->builder->buildAstInstanceOfExpression($token->image), false); }