class documentation

class RSTStateMachine(StateMachineWS): (source)

View In Hierarchy

reStructuredText's master StateMachine.

The entry point to reStructuredText parsing is the run() method.

Method run Parse input_lines and modify the document node in place.
Instance Variable document Undocumented
Instance Variable language Undocumented
Instance Variable match​_titles Undocumented
Instance Variable memo Undocumented
Instance Variable node Undocumented
Instance Variable reporter Undocumented

Inherited from StateMachineWS:

Method get​_first​_known​_indented Return an indented block and info.
Method get​_indented Return a block of indented lines of text, and info.
Method get​_known​_indented Return an indented block and info.

Inherited from StateMachine (via StateMachineWS):

Method __init__ Initialize a StateMachine object; add state objects.
Method abs​_line​_number Return line number of current line (counting from 1).
Method abs​_line​_offset Return line offset of current line, from beginning of file.
Method add​_state Initialize & add a state_class (State subclass) object.
Method add​_states Add state_classes (a list of State subclasses).
Method at​_bof Return 1 if the input is at or before beginning-of-file.
Method at​_eof Return 1 if the input is at or past end-of-file.
Method attach​_observer The observer parameter is a function or bound method which takes two arguments, the source and offset of the current line.
Method check​_line Examine one line of input for a transition match & execute its method.
Method detach​_observer Undocumented
Method error Report error details.
Method get​_source Return source of line at absolute line offset line_offset.
Method get​_source​_and​_line Return (source, line) tuple for current or given line number.
Method get​_state Return current state object; set it first if next_state given.
Method get​_text​_block Return a contiguous block of text.
Method goto​_line Jump to absolute line offset line_offset, load and return it.
Method insert​_input Undocumented
Method is​_next​_line​_blank Return 1 if the next line is blank or non-existant.
Method next​_line Load self.line with the n'th next line and return it.
Method notify​_observers Undocumented
Method previous​_line Load self.line with the n'th previous line and return it.
Method runtime​_init Initialize self.states.
Method unlink Remove circular references to objects no longer required.
Instance Variable current​_state The name of the current state (key to self.states).
Instance Variable debug Debugging mode on/off.
Instance Variable initial​_state The name of the initial state (key to self.states).
Instance Variable input​_lines StringList of input lines (without newlines). Filled by self.run().
Instance Variable input​_offset Offset of self.input_lines from the beginning of the file.
Instance Variable line Current input line.
Instance Variable line​_offset Current input line offset from beginning of self.input_lines.
Instance Variable observers List of bound methods or functions to call whenever the current line changes. Observers are called with one argument, self. Cleared at the end of run().
Instance Variable states Mapping of {state_name: State_object}.
Instance Variable _stderr Wrapper around sys.stderr catching en-/decoding errors
def run(self, input_lines, document, input_offset=0, match_titles=True, inliner=None): (source)

Parse input_lines and modify the document node in place.

Extend StateMachineWS.run(): set up parse-global data and run the StateMachine.

document = (source)

Undocumented

language = (source)

Undocumented

match_titles = (source)

Undocumented

memo = (source)

Undocumented

node = (source)

Undocumented

reporter = (source)

Undocumented