Beispiel #1
0
 def __init__(self, content: str = '', stream_name: str = None):
     self._ignores = [BasicParser.ignore_blanks]
     self._streams = [Stream(content, stream_name)]
     self.rule_nodes = None
     self.push_rule_nodes()
     self._lastIgnoreIndex = 0
     self._lastIgnore = False
     self._lastRule = ""
     self.diagnostic = error.Diagnostic()
Beispiel #2
0
 def parsed_stream(self, content: str, name: str = None):
     """Push a new Stream into the parser.
     All subsequent called functions will parse this new stream,
     until the 'popStream' function is called.
     """
     self._streams.append(Stream(content, name))