Construct a parser for string based expressions.
We need a clear policy on backslashes. To be as backwards compatible as
possible I am going with:
This is not the same as the Python convention, but I believe it makes
automatic escaping of given text easier.
|
|
__init__(self,
alphabet)
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
|
dup(self,
x)
Create an interval from a single character. |
source code
|
|
|
|
tup(self,
x)
Create an interval from a tuple. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
option(self,
x)
Make a sub-expression optional. |
source code
|
|
|
|
choice(self,
x)
Construct a choice from a list of sub-expressions. |
source code
|
|
|
|
char(self,
x)
Construct a character from an interval (pair). |
source code
|
|
|
|
extend(self,
x)
Delegate a character extension to the alphabet. |
source code
|
|
|
|
|
|
Inherited from object:
__delattr__,
__format__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__sizeof__,
__str__,
__subclasshook__
|