function _advance()
	{
		$i = $this->_current_char;
		$formula_length = strlen($this->_formula);
		// eat up white spaces
		if ($i < $formula_length) {
			while ($this->_formula{$i} == " ") {
				++$i;
			}

			if ($i < ($formula_length - 1)) {
				$this->_lookahead = $this->_formula{$i+1};
			}
			$token = '';
		}

		while ($i < $formula_length) {
			$token .= $this->_formula{$i};

			if ($i < ($formula_length - 1)) {
				$this->_lookahead = $this->_formula{$i+1};
			} else {
				$this->_lookahead = '';
			}

			if ($this->_match($token) != '') {
				//if ($i < strlen($this->_formula) - 1) {
				//    $this->_lookahead = $this->_formula{$i+1};
				//}
				$this->_current_char = $i + 1;
				$this->_current_token = $token;
				return 1;
			}

			if ($i < ($formula_length - 2)) {
				$this->_lookahead = $this->_formula{$i+2};
			} else { // if we run out of characters _lookahead becomes empty
				$this->_lookahead = '';
			}
			++$i;
		}
		//die("Lexical error ".$this->_current_char);
	}