]> granicus.if.org Git - re2c/commit
Backup overwritten tags in fallback states.
authorUlya Trofimovich <skvadrik@gmail.com>
Wed, 5 Oct 2016 16:26:28 +0000 (17:26 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Wed, 5 Oct 2016 16:32:56 +0000 (17:32 +0100)
commit2b7aec358e324999d30520c542414591a2838710
treec0de2d943624c41241e83a60e587bfaf35d2b26c
parent71e94f3e4ebac528c7dd22e43121b8aac797cc02
Backup overwritten tags in fallback states.

We need to backup tags in fallback states: these tags may be
updated on some non-accepting path from fallback state, and if
the attempt to match longer rule fails, there's no way to restore
the overwritten tags.

Such tags may appear in self-overlapping rules, e.g.:
    (@p "ab")* {}

We create a special backup variable for each potentially overwritten
tag. Backup tags do not participate in deduplication.
23 files changed:
re2c/Makefile.am
re2c/src/codegen/bitmap.cc
re2c/src/codegen/emit.h
re2c/src/codegen/emit_action.cc
re2c/src/codegen/emit_dfa.cc
re2c/src/codegen/go.h
re2c/src/codegen/go_construct.cc
re2c/src/codegen/go_emit.cc
re2c/src/ir/adfa/action.h
re2c/src/ir/adfa/adfa.cc
re2c/src/ir/adfa/adfa.h
re2c/src/ir/adfa/prepare.cc
re2c/src/ir/compile.cc
re2c/src/ir/dfa/dead_rules.cc
re2c/src/ir/dfa/determinization.cc
re2c/src/ir/dfa/dfa.h
re2c/src/ir/dfa/fallback_tags.cc [new file with mode: 0644]
re2c/src/ir/dfa/minimization.cc
re2c/src/ir/dfa/tag_deduplication.cc
re2c/src/ir/skeleton/skeleton.cc
re2c/src/ir/tag.h
re2c/test/tags/fallback3.i--tags.c [new file with mode: 0644]
re2c/test/tags/fallback3.i--tags.re [new file with mode: 0644]