def __init__(self, text, default_rule=None):
<EOL>if default_rule:<EOL><INDENT>self.grammar = self.grammar.default(default_rule)<EOL><DEDENT>try:<EOL><INDENT>self.data = self.parse(text)<EOL><DEDENT>except ParseError as ex:<EOL><INDENT>raise ParserError(ex)<EOL><DEDENT>
Init the parser with some text to parse, and parse it.

        The resource resulting in the parsing will be stored in the ``data`` attribute.

        Arguments
        ---------
        text : str
            The text to parse.
        default_rule : str, optional
            A default rule to use to override the default one.

        Example
        -------

        >>> parser = BaseParser('foo', default_rule='IDENT')
        >>> parser.data
        'foo'

        Raises
        ------
        ParserError
            When the parser originally raised a ``parsimonious.exceptions.ParseError`` exception.