示例#1
0
 /**
  * {@inheritdoc}
  */
 public function parse($input)
 {
     $stream = $this->lexer->lex($input);
     $annotations = array();
     while ($stream->valid()) {
         if (!$stream->skipUntil(Tokens::T_AT)) {
             break;
         }
         if (!$stream->peek()->test(Tokens::T_IDENTIFIER)) {
             $stream->next();
             // move along
             continue;
         }
         if (!$stream->peek(2)->test(Tokens::T_OPEN_PAREN)) {
             $stream->next();
             // move along
             continue;
         }
         $annotations[] = $this->parseAnnotation($stream);
     }
     return $annotations;
 }