]> granicus.if.org Git - re2c/commit
Fixed rule reachability analyses.
authorUlya Trofimovich <skvadrik@gmail.com>
Mon, 23 May 2016 11:49:33 +0000 (12:49 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Mon, 23 May 2016 13:28:19 +0000 (14:28 +0100)
commit1478ee98f93719a8d1b592a35a647c293e8b0c65
tree21619ea051cecef0a31e211dd2f1eef20b139f8c
parentf23886af40f7bc2d5ee4048cde09e116bf7d72a8
Fixed rule reachability analyses.

The previous algorithm handled loops incorrectly: if deep-first search
from current DFA state happened to visit looping paths before non-looping
paths, then result accumulated from non-looping paths was not propagated
into loopback states.

Now we use back propagation (from states that have transitions to default
state), which handles loops correctly.
22 files changed:
re2c/Makefile.am
re2c/src/codegen/emit_dfa.cc
re2c/src/ir/compile.cc
re2c/src/ir/dfa/dead_rules.cc [new file with mode: 0644]
re2c/src/ir/dfa/dfa.h
re2c/src/ir/rule.h
re2c/src/ir/skeleton/skeleton.h
re2c/src/ir/skeleton/unreachable.cc [deleted file]
re2c/test/bug61.i--empty-class(match-none).c
re2c/test/bug61_difference_full.i--empty-class(match-none).c
re2c/test/bug61_difference_negative.i--empty-class(match-none).c
re2c/test/bug61_difference_positive.i--empty-class(match-none).c
re2c/test/bug61_negative.i--empty-class(match-none).c
re2c/test/bug61_positive.i--empty-class(match-none).c
re2c/test/php20150211_zend_ini_scanner.c--emit-dot--flex-syntax--case-inverted.c
re2c/test/php20150211_zend_ini_scanner.igcd--flex-syntax--case-inverted.c
re2c/test/php20150211_zend_ini_scanner.igcd--skeleton--flex-syntax--case-inverted.c
re2c/test/php20150211_zend_ini_scanner_trimmed.ic--flex-syntax.c
re2c/test/php20150211_zend_ini_scanner_trimmed.icwb--flex-syntax.c
re2c/test/rexx.--empty-class(match-none).c
re2c/test/wunreachable_rules.i.c [new file with mode: 0644]
re2c/test/wunreachable_rules.i.re [new file with mode: 0644]