Public Member Functions | |
def | __init__ (self, names) |
BackreferenceStack constructor. More... | |
def | save_phrase (self, name, offset, length) |
Pushes a phrase on the named stack. More... | |
def | get_phrase (self, name) |
Retrieves the last phrase on the named stack. More... | |
def | save_state (self) |
Save the stack state. More... | |
def | restore_state (self, state) |
Restores all named stack lengths to a previously saved state. More... | |
Public Attributes | |
stack | |
names | |
Definition at line 7 of file backreferences.py.
def apg_py.lib.backreferences.BackrefenceStack.__init__ | ( | self, | |
names | |||
) |
BackreferenceStack constructor.
Creates an (empty) LIFO stack of captured phrases, one for each named rule or UDT.
names | A tuple of lower case names of all rules and UDTs capturing phrases for back referencing. |
Definition at line 9 of file backreferences.py.
def apg_py.lib.backreferences.BackrefenceStack.get_phrase | ( | self, | |
name | |||
) |
Retrieves the last phrase on the named stack.
name | The (lower case) rule or UDT name that captured the phrase. |
Definition at line 31 of file backreferences.py.
def apg_py.lib.backreferences.BackrefenceStack.restore_state | ( | self, | |
state | |||
) |
Restores all named stack lengths to a previously saved state.
state | The return value from a previous call to save_state(). |
Definition at line 51 of file backreferences.py.
def apg_py.lib.backreferences.BackrefenceStack.save_phrase | ( | self, | |
name, | |||
offset, | |||
length | |||
) |
Pushes a phrase on the named stack.
name | The (lower case) rule or UDT name that captured the phrase. |
offset | The offset into the input string for the first character of the phrase. |
length | The number of characters in the phrase. |
Definition at line 21 of file backreferences.py.
def apg_py.lib.backreferences.BackrefenceStack.save_state | ( | self | ) |
Save the stack state.
Definition at line 42 of file backreferences.py.
apg_py.lib.backreferences.BackrefenceStack.names |
Definition at line 17 of file backreferences.py.
apg_py.lib.backreferences.BackrefenceStack.stack |
Definition at line 16 of file backreferences.py.