public function peekNextValidToken($startPos = null, $stopOnNewLine = false) {
		// define the start position
		$pos = $this->getCurrentPosition() + 1; // default position for the search
		if ($startPos !== null) {
			$pos = $startPos; // if defined, set the start position
		}

		// search for the next valid token
		$token = null;
		$nbTokens = count($this->tokens);

		while ($pos < $nbTokens) {
			$token = $this->tokens[$pos];
			$pos ++;

			if (isset($this->ignoreTokens[$token->id])) {
				continue;
			} else if ($token->id === T_NEW_LINE) {
				if ($stopOnNewLine) {
					break;
				} else {
					continue;
				}
			} else {
				break;
			}
		}

		return $token;
	}