Beispiel #1
0
 /**
  * Visit all sub expression
  *
  * The return type of this method varies deping on the concrete visitor 
  * implementation
  * 
  * @param slRegularExpressionSequence $regularExpression 
  * @return mixed
  */
 protected function visitAll(slRegularExpressionAll $regularExpression)
 {
     $children = array_map(array($this, 'visit'), $regularExpression->getChildren());
     $ordered = $this->getAllCombinations($children);
     return '( ( ' . implode(' ) | ( ', array_map(function ($children) {
         return implode(', ', $children);
     }, $ordered)) . ' ) )';
 }
Beispiel #2
0
 /**
  * Visit all sub expression
  *
  * The return type of this method varies deping on the concrete visitor 
  * implementation
  * 
  * @param slRegularExpressionSequence $regularExpression 
  * @return mixed
  */
 protected function visitAll(slRegularExpressionAll $regularExpression)
 {
     $all = $this->document->createElementNS('http://www.w3.org/2001/XMLSchema', 'all');
     foreach ($regularExpression->getChildren() as $child) {
         $all->appendChild($this->visit($child));
     }
     if ($regularExpression->minOccurences === 0) {
         $all->setAttribute('minOccurs', '0');
     }
     return $all;
 }
Beispiel #3
0
 /**
  * Visit all sub expression
  *
  * The return type of this method varies deping on the concrete visitor 
  * implementation
  * 
  * @param slRegularExpressionSequence $regularExpression 
  * @return mixed
  */
 protected function visitAll(slRegularExpressionAll $regularExpression)
 {
     return '( ' . implode(' & ', array_map(array($this, 'visit'), $regularExpression->getChildren())) . ' )';
 }