'Parse `input_lines` and modify the `document` node in place.
Extend `StateMachineWS.run()`: set up parse-global data and
run the StateMachine.'

def run(self, input_lines, document, input_offset=0, match_titles=1, inliner=None):

    self.language = languages.get_language(document.settings.language_code)
    self.match_titles = match_titles
    if (inliner is None):
        inliner = Inliner()
    inliner.init_customizations(document.settings)
    self.memo = Struct(document=document, reporter=document.reporter, language=self.language, title_styles=[], section_level=0, section_bubble_up_kludge=0, inliner=inliner)
    self.document = document
    self.attach_observer(document.note_source)
    self.reporter = self.memo.reporter
    self.node = document
    results = StateMachineWS.run(self, input_lines, input_offset, input_source=document['source'])
    assert (results == []), 'RSTStateMachine.run()    results    should    be    empty!'
    self.node = self.memo = None
