protected function doParsing($string) { $stream = new StringStream($string); $annotations = array(); while ($char = $stream->getFirstCharacter()) { if ($char == '@') { $parser = new AnnotationParser(); $annotation = $parser->parseStream($stream); $annotations[get_class($annotation)] = $annotation; } else { $stream->forward(); } } return $annotations; }