47 $this->rootAccum = [];
55 return count( $this->stack );
66 if ( $this->top ===
false ) {
69 return $this->top->getCurrentPart();
73 public function push( $data ) {
74 if ( $data instanceof $this->elementClass ) {
75 $this->stack[] = $data;
78 $this->stack[] =
new $class( $data );
80 $this->top = $this->stack[
count( $this->stack ) - 1];
81 $this->accum =& $this->top->getAccum();
84 public function pop() {
85 if ( $this->stack === [] ) {
86 throw new RuntimeException( __METHOD__ .
': no elements remaining' );
88 $temp = array_pop( $this->stack );
90 if (
count( $this->stack ) ) {
91 $this->top = $this->stack[
count( $this->stack ) - 1];
92 $this->accum =& $this->top->getAccum();
101 $this->top->addPart( $s );
102 $this->accum =& $this->top->getAccum();
109 if ( $this->stack === [] ) {
111 'findEquals' =>
false,
113 'inHeading' =>
false,
116 return $this->top->getFlags();
Stack class to help Preprocessor::preprocessToObj()
PPDStackElement_Hash[] $stack
PPDStackElement_Hash false $top