Home | Trees | Index | Help |
|
---|
Package docutils :: Package parsers :: Package rst :: Module states :: Class SpecializedBody |
|
State
--+ |StateWS
--+ |RSTState
--+ |Body
--+ | SpecializedBody
BulletList
,
DefinitionList
,
EnumeratedList
,
Explicit
,
FieldList
,
MetaBody
,
OptionList
,
RFC2822List
Superclass for second and subsequent compound element members. Compound elements are lists and list-like constructs.
All transition methods are disabled (redefined as invalid_input
).
Override individual methods in subclasses to re-enable.
For example, once an initial bullet list item, say, is recognized, the
BulletList
subclass takes over, with a "bullet_list" node as its
container. Upon encountering the initial bullet list item, Body.bullet
calls its self.nested_list_parse (RSTState.nested_list_parse
), which
starts up a nested parsing session with BulletList
as the initial state.
Only the bullet transition method is enabled in BulletList
; as long
as only bullet list items are encountered, they are parsed and inserted
into the container. The first construct which is not a bullet list item
triggers the invalid_input
method, which ends the nested parse and
closes the container. BulletList
needs to recognize input that is
invalid in the context of a bullet list, which means everything other
than bullet list items, so it inherits the transition list created in
Body
.
Method Summary | |
---|---|
Not a compound element member. | |
Not a compound element member. | |
Not a compound element member. | |
Not a compound element member. | |
Not a compound element member. | |
Not a compound element member. | |
Not a compound element member. | |
Not a compound element member. | |
Not a compound element member. | |
Not a compound element member. | |
Not a compound element member. | |
Not a compound element member. | |
Not a compound element member. | |
Inherited from Body | |
| |
| |
| |
| |
| |
Check for an attribution in the last contiguous block of indented . | |
| |
| |
| |
Determine which explicit construct this is, parse & return it. | |
Create a nested state machine for a series of explicit markup constructs (including anonymous hyperlink targets). | |
| |
| |
| |
Check validity based on the ordinal value and the second line. | |
| |
| |
| |
| |
Construct and return an enumerated list item marker. | |
| |
| |
| |
Parse a directive then run its directive function. | |
| |
| |
Analyze an enumerator and return the results. | |
Parse datalines for a field list containing extension options
matching option_spec . | |
| |
Extract & return field name from a field marker match. | |
Return a list of node.option and node.option_argument objects,
parsed from an option marker match. | |
| |
Parse a table. | |
Top border of a generic table. | |
| |
Inherited from RSTState | |
Initialize a StateSM object; extends State.__init__() . | |
Called at beginning of file. | |
Check for illegal structure: empty section, misplaced transitions. | |
Check for a valid subsection header. | |
Jump to input line abs_line_offset , ignoring jumps past the end. | |
Return 2 lists: nodes (text and inline elements), and system_messages. | |
Create a new StateMachine rooted at node and run it over the input
block . | |
Create a new StateMachine rooted at node and run it over the input
block . | |
Append new subsection to document tree. | |
Override StateWS.no_match to generate a system message. | |
Return a list (paragraph & messages) & a boolean: literal_block next? | |
Initialize this State before running the state machine; called from
self.state_machine.run() . | |
Check for a valid subsection and create one if it checks out. | |
| |
| |
Inherited from StateWS | |
Add whitespace-specific transitions before those defined in subclass. | |
Handle blank lines. | |
Handle an indented text block (first line's indent known). | |
Handle a known-indent text block. | |
Inherited from State | |
Add a transition to the start of the transition list. | |
Add a list of transitions to the start of the transition list. | |
Handle end-of-file. | |
Make & return a transition tuple based on name . | |
Return a list of transition names and a transition mapping. | |
A "do nothing" transition method. | |
Remove a transition by name . | |
Remove circular references to objects no longer required. |
Class Variable Summary | |
---|---|
Inherited from Body | |
SRE_Pattern |
attribution_pattern = --(?![-\n]) *(?=[^ \n])
|
Struct |
enum = <docutils.parsers.rst.states.Struct instance at 0...
|
Struct |
explicit = <docutils.parsers.rst.states.Struct instance ...
|
str |
format = 'period'
|
SRE_Pattern |
grid_table_top_pat = \+-[-\+]+-\+ *$
|
tuple |
initial_transitions = ('bullet', 'enumerator', 'field_ma...
|
dict |
pats = {'alphanumplus': '[a-zA-Z0-9_-]', 'parens': '(?P<...
|
dict |
patterns = {'enumerator': '((?P<parens>\\(([0-9]+|[a-z]|...
|
str |
sequence = 'upperroman'
|
SRE_Pattern |
simple_table_border_pat = =+[ =]*$
|
SRE_Pattern |
simple_table_top_pat = =+( +=+)+ *$
|
Inherited from StateWS | |
NoneType |
indent_sm = None |
NoneType |
indent_sm_kwargs = None |
NoneType |
known_indent_sm = None |
NoneType |
known_indent_sm_kwargs = None |
tuple |
ws_initial_transitions = ('blank', 'indent')
|
dict |
ws_patterns = {'indent': ' +', 'blank': ' *$'}
|
Inherited from State | |
NoneType |
nested_sm = None |
NoneType |
nested_sm_kwargs = None |
Method Details |
---|
anonymous(self, match=None, context=None, next_state=None)Not a compound element member. Abort this state machine. |
bullet(self, match=None, context=None, next_state=None)Not a compound element member. Abort this state machine. |
doctest(self, match=None, context=None, next_state=None)Not a compound element member. Abort this state machine. |
enumerator(self, match=None, context=None, next_state=None)Not a compound element member. Abort this state machine. |
explicit_markup(self, match=None, context=None, next_state=None)Not a compound element member. Abort this state machine. |
field_marker(self, match=None, context=None, next_state=None)Not a compound element member. Abort this state machine. |
grid_table_top(self, match=None, context=None, next_state=None)Not a compound element member. Abort this state machine. |
indent(self, match=None, context=None, next_state=None)Not a compound element member. Abort this state machine. |
invalid_input(self, match=None, context=None, next_state=None)Not a compound element member. Abort this state machine. |
line(self, match=None, context=None, next_state=None)Not a compound element member. Abort this state machine. |
option_marker(self, match=None, context=None, next_state=None)Not a compound element member. Abort this state machine. |
simple_table_top(self, match=None, context=None, next_state=None)Not a compound element member. Abort this state machine. |
text(self, match=None, context=None, next_state=None)Not a compound element member. Abort this state machine. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Tue Jul 22 05:31:51 2003 | http://epydoc.sf.net |