Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
docutils.statemachine.StateWS Class Reference
Inheritance diagram for docutils.statemachine.StateWS:
Inheritance graph
[legend]
Collaboration diagram for docutils.statemachine.StateWS:
Collaboration graph
[legend]

Public Member Functions

 __init__ (self, state_machine, debug=False)
 
 add_initial_transitions (self)
 
 blank (self, match, context, next_state)
 
 indent (self, match, context, next_state)
 
 known_indent (self, match, context, next_state)
 
 first_known_indent (self, match, context, next_state)
 
- Public Member Functions inherited from docutils.statemachine.State
 runtime_init (self)
 
 unlink (self)
 
 add_transitions (self, names, transitions)
 
 add_transition (self, name, transition)
 
 remove_transition (self, name)
 
 make_transition (self, name, next_state=None)
 
 make_transitions (self, name_list)
 
 no_match (self, context, transitions)
 
 bof (self, context)
 
 eof (self, context)
 
 nop (self, match, context, next_state)
 

Public Attributes

 patterns
 
 ws_patterns
 
 ws_initial_transitions
 
- Public Attributes inherited from docutils.statemachine.State
 transition_order
 
 transitions
 
 state_machine
 
 debug
 

Static Public Attributes

 indent_sm = None
 
 indent_sm_kwargs = None
 
 known_indent_sm = None
 
 known_indent_sm_kwargs = None
 
dict ws_patterns
 
tuple ws_initial_transitions = ('blank', 'indent')
 
- Static Public Attributes inherited from docutils.statemachine.State
 patterns = None
 
 initial_transitions = None
 
 nested_sm = None
 
 nested_sm_kwargs = None
 

Detailed Description

State superclass specialized for whitespace (blank lines & indents).

Use this class with `StateMachineWS`.  The transitions 'blank' (for blank
lines) and 'indent' (for indented text blocks) are added automatically,
before any other transitions.  The transition method `blank()` handles
blank lines and `indent()` handles nested indented blocks.  Indented
blocks trigger a new state machine to be created by `indent()` and run.
The class of the state machine to be created is in `indent_sm`, and the
constructor keyword arguments are in the dictionary `indent_sm_kwargs`.

The methods `known_indent()` and `firstknown_indent()` are provided for
indented blocks where the indent (all lines' and first line's only,
respectively) is known to the transition method, along with the attributes
`known_indent_sm` and `known_indent_sm_kwargs`.  Neither transition method
is triggered automatically.

Constructor & Destructor Documentation

◆ __init__()

docutils.statemachine.StateWS.__init__ (   self,
  state_machine,
  debug = False 
)
Initialize a `StateSM` object; extends `State.__init__()`.

Check for indent state machine attributes, set defaults if not set.

Reimplemented from docutils.statemachine.State.

Reimplemented in docutils.parsers.rst.states.RSTState, and docutils.parsers.rst.states.QuotedLiteralBlock.

Member Function Documentation

◆ add_initial_transitions()

docutils.statemachine.StateWS.add_initial_transitions (   self)
Add whitespace-specific transitions before those defined in subclass.

Extends `State.add_initial_transitions()`.

Reimplemented from docutils.statemachine.State.

◆ blank()

docutils.statemachine.StateWS.blank (   self,
  match,
  context,
  next_state 
)
Handle blank lines. Does nothing. Override in subclasses.

Reimplemented in docutils.parsers.rst.states.Text, docutils.parsers.rst.states.Line, and docutils.parsers.rst.states.QuotedLiteralBlock.

◆ first_known_indent()

docutils.statemachine.StateWS.first_known_indent (   self,
  match,
  context,
  next_state 
)
Handle an indented text block (first line's indent known).

Extend or override in subclasses.

Recursively run the registered state machine for known-indent indented
blocks (`self.known_indent_sm`). The indent is the length of the
match, ``match.end()``.

◆ indent()

docutils.statemachine.StateWS.indent (   self,
  match,
  context,
  next_state 
)
Handle an indented text block. Extend or override in subclasses.

Recursively run the registered state machine for indented blocks
(`self.indent_sm`).

Reimplemented in docutils.parsers.rst.states.Body, docutils.parsers.rst.states.Text, docutils.parsers.rst.states.Definition, and docutils.parsers.rst.states.QuotedLiteralBlock.

◆ known_indent()

docutils.statemachine.StateWS.known_indent (   self,
  match,
  context,
  next_state 
)
Handle a known-indent text block. Extend or override in subclasses.

Recursively run the registered state machine for known-indent indented
blocks (`self.known_indent_sm`). The indent is the length of the
match, ``match.end()``.

Member Data Documentation

◆ ws_patterns

dict docutils.statemachine.StateWS.ws_patterns
static
Initial value:
= {'blank': re.compile(' *$'),
'indent': re.compile(' +')}

The documentation for this class was generated from the following file: