]> granicus.if.org Git - re2c/commit
Added yet another intermediate representation (after AST, before NFA).
authorUlya Trofimovich <skvadrik@gmail.com>
Sat, 25 Feb 2017 17:00:49 +0000 (17:00 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Sun, 26 Feb 2017 00:05:34 +0000 (00:05 +0000)
commita27e6e232faf8c4321402012a5214f26520560dc
treed4f08c43ddcbde2b47f08598d9a9f2eb4cc40c6d
parentfa01aad3f7ed7586bfc976f60486dba978fdb9ed
Added yet another intermediate representation (after AST, before NFA).

Rationale: AST must be immutable, because it is shared among different
regexps, rules, conditions and blocks. NFA is mutable, but inconvenient
for some transformations (adding fixed and default tags, rewriting parts
of regexp, etc.). Before this commit all these transformations were done
in one pass (during convertion of AST to NFA) which made the code rather
complex. In order to add POSIX captures we'll need to add even more
complexity (tracking captures, creating tags for them, maintaining tag
order, etc.).
48 files changed:
re2c/Makefile.am
re2c/bootstrap/src/parse/lex.cc
re2c/bootstrap/src/parse/parser.cc
re2c/src/ir/compile.cc
re2c/src/ir/dfa/determinization.cc
re2c/src/ir/nfa/counters.cc [deleted file]
re2c/src/ir/nfa/estimate_size.cc [new file with mode: 0644]
re2c/src/ir/nfa/init_rules.cc [deleted file]
re2c/src/ir/nfa/nfa.cc [deleted file]
re2c/src/ir/nfa/nfa.h
re2c/src/ir/nfa/re_to_nfa.cc [new file with mode: 0644]
re2c/src/ir/nfa/regexps2nfa.cc [deleted file]
re2c/src/ir/re/ast_to_re.cc [new file with mode: 0644]
re2c/src/ir/re/default_tags.cc [new file with mode: 0644]
re2c/src/ir/re/fixed_tags.cc [new file with mode: 0644]
re2c/src/ir/re/re.h [new file with mode: 0644]
re2c/src/ir/regexp/nullable.cc
re2c/src/ir/regexp/regexp.cc
re2c/src/ir/regexp/regexp.h
re2c/src/ir/regexp/split_charset.cc
re2c/src/ir/tag.h
re2c/src/parse/parser.ypp
re2c/test/tags/conf1.i--tags--input(custom).c
re2c/test/tags/conf1.i--tags.c
re2c/test/tags/conf2.i--tags--input(custom).c
re2c/test/tags/conf2.i--tags.c
re2c/test/tags/conf3.i--tags--input(custom).c
re2c/test/tags/conf3.i--tags.c
re2c/test/tags/copy_coalescing1.i--tags.c
re2c/test/tags/dedup4.i--tags.c
re2c/test/tags/exponential_bottoms.i--tags.c
re2c/test/tags/fix2.i--tags.c
re2c/test/tags/fix2_trail.i--tags--input(custom).c
re2c/test/tags/fix2_trail.i--tags.c
re2c/test/tags/fix3.i--tags.c
re2c/test/tags/fix3_trail.i--tags--input(custom).c
re2c/test/tags/fix3_trail.i--tags.c
re2c/test/tags/fix4.i--tags.c
re2c/test/tags/fix4_trail.i--tags--input(custom).c
re2c/test/tags/fix4_trail.i--tags.c
re2c/test/tags/fix5.i--tags.c
re2c/test/tags/fix5_trail.i--tags--input(custom).c
re2c/test/tags/fix5_trail.i--tags.c
re2c/test/tags/interference.i--tags.c
re2c/test/tags/lost_yybackuptag.i--tags--no-lookahead--input(custom).c
re2c/test/tags/tags_in_trail.i--tags.c
re2c/test/tags/twopass.i--tags.c
re2c/test/tags/uniq.i--tags.c