Exemplo n.º 1
0
 /**
  * @param RuleNode $astNode
  * @return bool
  */
 public function postVisitRuleNode(RuleNode $astNode)
 {
     $expressions = $this->visitContext->popExpressions($this);
     $symbol = $this->visitContext->popLeftHandSymbol($this);
     //remove the lhs we just popped from the visit context
     array_shift($expressions);
     $production = new StandardProduction($symbol, array_shift($expressions));
     $this->visitContext->collectProduction($production);
     return true;
 }
Exemplo n.º 2
0
 /**
  * @param ChoiceNode $astNode
  *
  * @return bool
  */
 public function postVisitChoiceNode(ChoiceNode $astNode)
 {
     $children = $this->visitContext->popExpressions($this);
     $expression = new Choice(array_shift($children), $children);
     $this->visitContext->pushExpression($expression);
 }