'Create a new ``ShiftReduceParser``, that uses ``grammar`` to
parse texts.
:type grammar: Grammar
:param grammar: The grammar used to parse texts.
:type trace: int
:param trace: The level of tracing that should be used when
parsing a text.  ``0`` will generate no tracing output;
and higher numbers will produce more verbose tracing
output.'

def __init__(self, grammar, trace=0):

    self._grammar = grammar
    self._trace = trace
    self._check_grammar()
