Beispiel #1
0
 def __init__(self, grammar, trace=0):
     self._grammar = grammar
     self._trace = trace
     self._stack = None
     self._remaining_text = None
     self._history = []
     AbstractParse.__init__(self)
Beispiel #2
0
 def __init__(self, grammar, trace=0):
     self._grammar = grammar
     self._trace = trace
     self._stack = None
     self._remaining_text = None
     self._history = []
     AbstractParse.__init__(self)
Beispiel #3
0
 def __init__(self, grammar, trace=0):
     self._grammar = grammar
     self._trace = trace
     self._rtext = None
     self._tree = None
     self._frontier = [()]
     self._tried_e = {}
     self._tried_m = {}
     self._history = []
     self._parses = []
     AbstractParse.__init__(self)
Beispiel #4
0
    def __init__(self, grammar, trace=0):
        """
        Create a new C{RecursiveDescent}, that uses C{grammar}
        to parse texts.

        @type grammar: C{Grammar}
        @param grammar: The grammar used to parse texts.
        @type trace: C{int}
        @param trace: The level of tracing that should be used when
            parsing a text.  C{0} will generate no tracing output;
            and higher numbers will produce more verbose tracing
            output.
        """
        self._grammar = grammar
        self._trace = trace
        AbstractParse.__init__(self)