Пример #1
0
 /**
  * @return Symbol[]
  */
 public function getNonTerminals()
 {
     $productions = $this->getProductions();
     $collected = array();
     foreach ($productions as $production) {
         $collected[] = $production->getNonTerminal();
     }
     $nonTerminals = HashCodeComparator::singletonInstance()->unique($collected);
     return $nonTerminals;
 }
 /**
  * @return array|Symbol[]
  */
 public function getCollected()
 {
     if (count($this->collectedSymbols) == 0) {
         return array();
     }
     $unique = HashCodeComparator::singletonInstance()->unique($this->collectedSymbols);
     return $unique;
 }