示例#1
0
 function parse_production()
 {
     $head = $this->parse_terminal('token');
     $this->parse_terminal('colon');
     $body = $this->parse_body();
     $p = new production($head);
     $p->add($body);
     while ($this->can_parse_terminal('union')) {
         $this->parse_terminal('union');
         $p->add($this->parse_body());
     }
     return $p;
 }