Converts a regular expression pattern string into an Expression
tree.
This is not meant to be an externally usable module.
This works by using msre_parse.py to parse the pattern. The result is
a tree data structure, where the nodes in the tree are tuples. The first
element of the tuple is the name of the node type. The format of the
other elements depends on the type.
The conversion routine is pretty simple - convert each msre_parse
tuple node into a Martel Expression node. It's a recusive
implementation.
|
|
|
convert_not_literal(group_names,
name,
val) |
source code
|
|
|
|
|
|
|
convert_assert(group_names,
name,
(direction, terms)) |
source code
|
|
|
convert_assert_not(group_names,
name,
(direction, terms)) |
source code
|
|
|
convert_branch(group_names,
name,
(ignore, branches)) |
source code
|
|
|
invert(s)
s -> a string containing all the characters not present in s |
source code
|
|
|
|
|
convert_subpattern(group_names,
name,
(id, terms)) |
source code
|
|
|
|
|
convert_max_repeat(group_names,
name,
(min_count, max_count, terms)) |
source code
|
|
|
|
|
|
|
make_expression(pattern)
pattern -> the Expression tree for the given pattern string |
source code
|
|