Trees | Index | Help |
---|
Package Martel :: Module Expression |
|
Classes for nodes in the Expression tree. Expression |--- Any - match (or don't match) a set of characters |--- AnyEol - match any newline representation (" ", " " or " ") |--- Assert - used for positive and negative lookahead assertions |--- AtBeginning - match the beginning of a line |--- AtEnd - match the end of a line |--- Debug - print a debug message |--- Dot - match any character except newline |--- Group - give a group name to an expression |--- GroupRef - match a previously identified expression |--- Literal - match (or don't match) a single character |--- MaxRepeat - greedy repeat of an expression, within min/max bounds |--- NullOp - does nothing (useful as an initial seed) |--- PassThrough - used when overriding 'make_parser'; match its subexp | |--- FastFeature - keeps information about possibly optional tags | |--- HeaderFooter - files with a header, records and a footer | `--- ParseRecords - parse a record at a time |--- Str - match a given string `--- ExpressionList - expressions containing several subexpressions |--- Alt - subexp1 or subexp2 or subexp3 or ... `--- Seq - subexp1 followed by subexp2 followed by subexp3 ...
Classes | |
---|---|
Alt |
An Expression tree with a list of alternate matches. |
Any |
|
AnyEol |
Match a newline (" ", " " or " ") |
Assert |
|
AtBeginning |
Match the beginning of a line |
AtEnd |
Match the end of a line |
Debug |
|
Dot |
Match any character except newline |
Expression |
Base class for nodes in the Expression tree |
ExpressionList |
shares implementation used by 'Expressions with subexpressions' |
FastFeature |
|
Group |
|
GroupRef |
|
HeaderFooter |
|
Literal |
|
MaxRepeat |
|
NullOp |
|
ParseRecords |
|
PassThrough |
|
Seq |
An Expression matching a set of subexpressions, in sequential order |
Str |
Function Summary | |
---|---|
Escape all non-alphanumeric characters in pattern. | |
expression -> expression where the text is case insensitive | |
_make_fast_lookup()
| |
_make_group_pattern(name,
expression,
attrs)
| |
modify an expression in place to remove case dependencies | |
s -> a string useable inside [] which matches all the characters in s | |
(c) -> into an appropriately escaped pattern for the character | |
(c1, c2) -> the pattern for the range bounded by those two characters | |
_quote(s)
| |
_verify_name(s)
|
Function Details |
---|
escape(pattern)Escape all non-alphanumeric characters in pattern. |
NoCase(expr)expression -> expression where the text is case insensitive |
_make_no_case(node)modify an expression in place to remove case dependencies may return a new top-level node |
_minimize_any_range(s)s -> a string useable inside [] which matches all the characters in s For example, passing in "0123456789" returns "\d". This code isn't perfect. |
_minimize_escape_char(c)(c) -> into an appropriately escaped pattern for the character |
_minimize_escape_range(c1, c2)(c1, c2) -> the pattern for the range bounded by those two characters |
Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Mon Aug 27 16:13:10 2007 | http://epydoc.sf.net |