コード例 #1
0
    def __init__(self, parent:CharacterStream):
        CharacterStream.__init__(self, parent.name)

        # The stream from which we obtain the (absolute) characters.
        self._parent = parent
        # Keeps the first StreamPosition_ of the various indentation levels
        self._stack = [parent.copy_position()]

        # Keeps the StreamPosition_ of the current character, relative to the position in the top of the stack
        self.current_relative_position = StreamPosition(self.name, 0, 1, 1, 1)

        # Remembers whether the substream has finished reading
        self.relative_eof = False