45 $this->rootAccum =
'';
53 return count( $this->stack );
64 if ( $this->top ===
false ) {
67 return $this->top->getCurrentPart();
71 public function push( $data ) {
72 if ( $data instanceof $this->elementClass ) {
73 $this->stack[] = $data;
76 $this->stack[] =
new $class( $data );
78 $this->top = $this->stack[
count( $this->stack ) - 1];
79 $this->accum =& $this->top->getAccum();
82 public function pop() {
83 if ( $this->stack === [] ) {
84 throw new MWException( __METHOD__ .
': no elements remaining' );
86 $temp = array_pop( $this->stack );
88 if (
count( $this->stack ) ) {
89 $this->top = $this->stack[
count( $this->stack ) - 1];
90 $this->accum =& $this->top->getAccum();
99 $this->top->addPart(
$s );
100 $this->accum =& $this->top->getAccum();
107 if ( $this->stack === [] ) {
109 'findEquals' =>
false,
111 'inHeading' =>
false,
114 return $this->top->getFlags();