]> sourceware.org Git - systemtap.git/commit
stapregex PR15065 (6/8) :: Core algorithm -- compute TNFA actions.
authorSerhei Makarov <serhei.public@gmail.com>
Fri, 8 Sep 2017 01:49:49 +0000 (21:49 -0400)
committerSerhei Makarov <serhei.public@gmail.com>
Fri, 8 Sep 2017 03:06:15 +0000 (23:06 -0400)
commit8873c23d7ee292a5e60a733bcbfcd5539a0e272f
tree7e1291d606e6b9e14ac3dfa60b84ea3f670cb3a2
parent3f822291b308dbd08eae179c2727d02725a8f270
stapregex PR15065 (6/8) :: Core algorithm -- compute TNFA actions.

* stapregex-dfa.cxx: Implement Laurikari's TNFA algorithm.
(arc_priority::refine_higher, ::refine_lower): Detect overflow.
(arc_compare): Previous implementation was incorrect, fix it.
(dfa::add_map_item): New function.
(te_closure): Properly consider arc_priorities.
(same_ins): New function.
(dfa::find_equivalent): Algorithm to compute reordering actions.
(dfa::compute_action): Algorithm to compute TNFA actions.
(dfa::compute_finalizer): Algorithm to compute finalizers.
(dfa::dfa): Consider arc_priorities and reordering actions.
(operator << for map_item): New function.
(operator << for tdfa_action): Use << for map_item.
(kernel_point::print): New function.
(state::print): Include diagnostic info for TNFA algorithm.
(operator << for state): New function.
(operator << for dfa): New function.

* stapregex-dfa.h (operator << for map_item): New function.
(struct tdfa_insn): Add save_tag option for finalizers.
(kernel_point::print): New function.
(struct span): Add jump_pairs field.
(struct state): Add dfa field to access containing DFA. Also
add accept_kp field to track TNFA actions for accepting states.
(state::state): Add dfa field to constructor.
(state::print): Use ordinary ostream, not translator_output.
(operator << for state): New function.
(struct dfa): Add success_outcome and fail_outcome field to
explicitly track the indices of 'accept' and 'fail' outcomes.
(dfa::dfa): Add an option to set index of 'accept' outcome.
(dfa::add_map_item): New function.
(dfa::compute_action): New function.
(dfa::compute_finalizer): New function.

* stapregex.cxx (regex_to_stapdfa): Add comment -- here is how
you can force TNFA tag operations to be generated even when the
stap script doesn't request any groups.
stapregex-dfa.cxx
stapregex-dfa.h
stapregex.cxx
This page took 0.59629 seconds and 5 git commands to generate.