public function parse($str, $context = null)
    {
        $this->lexer->setInput($str);
        $this->context = $context;

        $rs = $this->parseInternal();

        if (null !== $this->lexer->next) {
            $this->syntaxError('end of input');
        }

        return $rs;
    }
public function parse($str, $context = null)
    {
        $this->lexer->setInput($str);
        $this->context = $context;

        $rs = $this->parseInternal();

        if (null !== $this->lexer->next) {
            $this->syntaxError('end of input');
        }

        return $rs;
    }
public function parse ( $ str , $ context = null ) { $ this -> lexer -> setInput ( $ str ) ; $ this -> context = $ context ; $ rs = $ this -> parseInternal ( ) ; if ( null !== $ this -> lexer -> next ) { $ this -> syntaxError ( 'end of input' ) ; } return $ rs ; }
Parses the given input.

@param string $str
@param string $context parsing context (allows to produce better error messages)

@return mixed
Parses the given input .