public function parse(string $text)
    {
        try {
            $result = $this->syntax->parse($text);
            $this->success = true;
        } catch (ParseException $e) {
            $result = $this->default;
            $this->success = false;
        }

        return $result;
    }
public function parse(string $text)
    {
        try {
            $result = $this->syntax->parse($text);
            $this->success = true;
        } catch (ParseException $e) {
            $result = $this->default;
            $this->success = false;
        }

        return $result;
    }
public function parse ( string $ text ) { try { $ result = $ this -> syntax -> parse ( $ text ) ; $ this -> success = true ; } catch ( ParseException $ e ) { $ result = $ this -> default ; $ this -> success = false ; } return $ result ; }
Tries to parse the string using the syntax and return
the result. If the parse failed, `success` flag is
set to false and the default value is returned.

@param  string $text the string to parse
@return mixed
Tries to parse the string using the syntax and return the result . If the parse failed success flag is set to false and the default value is returned .