function export(){
		if( $this->is_terminal() ){
			if( $this->t === $this->value ){
				// scalar token
				return $this->value;
			}
			// PHP Tokenizer style array
			return array( $this->t, $this->value );
		}
		// else is a branch
		$a = array();
		foreach( $this->children as $Child ){
			$a[] = array( $this->t, $Child->export() );
		}
		return $a;
	}
function export(){
		if( $this->is_terminal() ){
			if( $this->t === $this->value ){
				// scalar token
				return $this->value;
			}
			// PHP Tokenizer style array
			return array( $this->t, $this->value );
		}
		// else is a branch
		$a = array();
		foreach( $this->children as $Child ){
			$a[] = array( $this->t, $Child->export() );
		}
		return $a;
	}
function export ( ) { if ( $ this -> is_terminal ( ) ) { if ( $ this -> t === $ this -> value ) { // scalar token return $ this -> value ; } // PHP Tokenizer style array return array ( $ this -> t , $ this -> value ) ; } // else is a branch $ a = array ( ) ; foreach ( $ this -> children as $ Child ) { $ a [ ] = array ( $ this -> t , $ Child -> export ( ) ) ; } return $ a ; }
Export tree as array.
Terminal nodes become tokens, non terminals branches.
@return array
Export tree as array . Terminal nodes become tokens non terminals branches .