| Home | Trees | Index | Help |
|---|
| Module yeanpypa :: Class InputReader |
|
| Method Summary | |
|---|---|
Create this reader with the given string. | |
Set a checkpoint in the reader. | |
Delete the newest checkpoint without rolling back. | |
Return whether the string was fully consumed | |
Get a single character from the string. | |
Return whether the reader is set to ignore whitespaces. | |
Return the current position of this reader | |
Get a substring of the string from this reader and advance the reader's position. | |
Rollback the parser to the last checkpoint set. | |
Set the ignore state of the reader. | |
Function to skip the whitespace characters from the current position on. | |
| Method Details |
|---|
__init__(self,
string,
ignore_white)
Create this reader with the given string.
|
checkPoint(self)Set a checkpoint in the reader. A checkpoint is kind of like a safety net where the parser can return to later if parsin failed at any later point in the string. The checkpoints are managed in a stack-like fashion: the parser can always return to the last checkpoint set. |
deleteCheckpoint(self)Delete the newest checkpoint without rolling back. If a rules sucessfully matches, it deletes the previously saved checkpoint to clean up the parser stack |
fullyConsumed(self)Return whether the string was fully consumed
|
getChar(self)Get a single character from the string. This methdo returns the next character of the string. If ignore_whitespace is True, this will be the next non-whitespace character.
|
getIgnoreState(self)Return whether the reader is set to ignore whitespaces.
|
getPos(self)Return the current position of this reader
|
getString(self, length)Get a substring of the string from this reader and advance the reader's position. This method returns the current substring of the reader with the given length. Note that even if ignore_whitespace is True, the string will return any containing whitespaces.
|
rollback(self)Rollback the parser to the last checkpoint set. This is called by the rules internally whenever parsing fails and a rollback is necessary. |
setIgnoreState(self, state)Set the ignore state of the reader. This call tells the reader whether it should ignore whitespaces or not.
|
skipWhite(self)Function to skip the whitespace characters from the current position on. |
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Sat Feb 10 16:11:43 2007 | http://epydoc.sf.net |