public static function parse(StreamReader $streamReader)
    {
        $pos = $startPos = $streamReader->getOffset();
        $openBrackets = 1;
        do {
            $buffer = $streamReader->getBuffer(false);
            for ($length = \strlen($buffer); $openBrackets !== 0 && $pos < $length; $pos++) {
                switch ($buffer[$pos]) {
                    case '(':
                        $openBrackets++;
                        break;
                    case ')':
                        $openBrackets--;
                        break;
                    case '\\':
                        $pos++;
                }
            }
        } while ($openBrackets !== 0 && $streamReader->increaseLength());

        $result = \substr($buffer, $startPos, $openBrackets + $pos - $startPos - 1);
        $streamReader->setOffset($pos);

        $v = new self;
        $v->value = $result;

        return $v;
    }
public static function parse(StreamReader $streamReader)
    {
        $pos = $startPos = $streamReader->getOffset();
        $openBrackets = 1;
        do {
            $buffer = $streamReader->getBuffer(false);
            for ($length = \strlen($buffer); $openBrackets !== 0 && $pos < $length; $pos++) {
                switch ($buffer[$pos]) {
                    case '(':
                        $openBrackets++;
                        break;
                    case ')':
                        $openBrackets--;
                        break;
                    case '\\':
                        $pos++;
                }
            }
        } while ($openBrackets !== 0 && $streamReader->increaseLength());

        $result = \substr($buffer, $startPos, $openBrackets + $pos - $startPos - 1);
        $streamReader->setOffset($pos);

        $v = new self;
        $v->value = $result;

        return $v;
    }
public static function parse ( StreamReader $ streamReader ) { $ pos = $ startPos = $ streamReader -> getOffset ( ) ; $ openBrackets = 1 ; do { $ buffer = $ streamReader -> getBuffer ( false ) ; for ( $ length = \ strlen ( $ buffer ) ; $ openBrackets !== 0 && $ pos < $ length ; $ pos ++ ) { switch ( $ buffer [ $ pos ] ) { case '(' : $ openBrackets ++ ; break ; case ')' : $ openBrackets -- ; break ; case '\\' : $ pos ++ ; } } } while ( $ openBrackets !== 0 && $ streamReader -> increaseLength ( ) ) ; $ result = \ substr ( $ buffer , $ startPos , $ openBrackets + $ pos - $ startPos - 1 ) ; $ streamReader -> setOffset ( $ pos ) ; $ v = new self ; $ v -> value = $ result ; return $ v ; }
Parses a string object from the stream reader.

@param StreamReader $streamReader
@return self
Parses a string object from the stream reader .