Package rxpy :: Package engine :: Package simple :: Module engine :: Class SimpleEngine
[hide private]
[frames] | no frames]

Class SimpleEngine

source code


The interpreter.
Instance Methods [hide private]
 
run(self, text, pos=0, search=False)
Execute a search.
source code
 
__run(self, graph, state, search=False)
Run a sub-search.
source code
 
string(self, next, text, state) source code
 
character(self, next, charset, state) source code
 
start_group(self, next, number, state) source code
 
end_group(self, next, number, state) source code
 
group_reference(self, next, number, state) source code
 
group_conditional(self, next, number, state) source code
 
split(self, next, state) source code
 
match(self, state) source code
 
dot(self, next, multiline, state) source code
 
start_of_line(self, next, multiline, state) source code
 
end_of_line(self, next, multiline, state) source code
 
lookahead(self, next, node, equal, forwards, state) source code
 
repeat(self, next, node, begin, end, lazy, state) source code
 
word_boundary(self, next, inverted, state) source code
 
digit(self, next, inverted, state) source code
 
space(self, next, inverted, state) source code
 
word(self, next, inverted, state) source code

Inherited from base.BaseEngine: __init__

Inherited from graph.visitor.BaseVisitor: conditional

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

run(self, text, pos=0, search=False)

source code 
Execute a search.
Overrides: base.BaseEngine.run

__run(self, graph, state, search=False)

source code 

Run a sub-search. We support multiple searches (stacks) so that we can invoke the same interpreter for lookaheads etc.

This is a simple trampoline - it stores state on a stack and invokes the visitor interface on each graph node. Visitor methods return either the new node and state, or raise Fail on failure, or Match on success.

string(self, next, text, state)

source code 
Overrides: graph.visitor.BaseVisitor.string

character(self, next, charset, state)

source code 
Overrides: graph.visitor.BaseVisitor.character

start_group(self, next, number, state)

source code 
Overrides: graph.visitor.BaseVisitor.start_group

end_group(self, next, number, state)

source code 
Overrides: graph.visitor.BaseVisitor.end_group

group_reference(self, next, number, state)

source code 
Overrides: graph.visitor.BaseVisitor.group_reference

split(self, next, state)

source code 
Overrides: graph.visitor.BaseVisitor.split

match(self, state)

source code 
Overrides: graph.visitor.BaseVisitor.match

dot(self, next, multiline, state)

source code 
Overrides: graph.visitor.BaseVisitor.dot

start_of_line(self, next, multiline, state)

source code 
Overrides: graph.visitor.BaseVisitor.start_of_line

end_of_line(self, next, multiline, state)

source code 
Overrides: graph.visitor.BaseVisitor.end_of_line

lookahead(self, next, node, equal, forwards, state)

source code 
Overrides: graph.visitor.BaseVisitor.lookahead

repeat(self, next, node, begin, end, lazy, state)

source code 
Overrides: graph.visitor.BaseVisitor.repeat

word_boundary(self, next, inverted, state)

source code 
Overrides: graph.visitor.BaseVisitor.word_boundary

digit(self, next, inverted, state)

source code 
Overrides: graph.visitor.BaseVisitor.digit

space(self, next, inverted, state)

source code 
Overrides: graph.visitor.BaseVisitor.space

word(self, next, inverted, state)

source code 
Overrides: graph.visitor.BaseVisitor.word