Example #1
0
 /**
  * @override
  */
 function push(ParseNode $Node, $recursion = true)
 {
     //echo "<br />\n(",$Node->length,") ",j_token_name($Node->t)," pushed onto (",$this->length,") ", j_token_name($this->t);
     if ($Node->is_transparent($this)) {
         //while( $Child = $Node->remove_at(0) ){
         //	//echo " COLLAPSE to ", j_token_name( $Child->t );
         //	parent::push( $Child, $recursion );
         //	unset( $Child );
         //}
         parent::push_thru($Node);
         $Node->destroy();
         return $this->length;
     }
     // else append this single node
     return parent::push($Node, $recursion);
 }
Example #2
0
 protected function _set_parent(EE_TreeNode $p)
 {
     parent::_set_parent($p);
     do {
         if ($p instanceof QueryNode) {
             $p->addClosurePath($this);
             break;
         }
         $p = $p->parent();
     } while ($p);
 }
Example #3
0
 /**
  * Push the child nodes of a node onto this node
  * @param ParseNode
  * @return int new length of this node
  */
 function push_thru(ParseNode $Node)
 {
     foreach ($Node->children as $Child) {
         $Node->remove($Child);
         $this->push($Child);
     }
     return $this->length;
 }