]> granicus.if.org Git - re2c/commit
Moved nontrivial context handling from parser to NFA construction phase.
authorUlya Trofimovich <skvadrik@gmail.com>
Mon, 28 Mar 2016 13:39:11 +0000 (14:39 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Mon, 28 Mar 2016 13:39:11 +0000 (14:39 +0100)
commit84bc67eeb35fa8217e8c9fd1b4c87c43c44c294d
treeb653bd1a6b5696d1e52d62413655f80529834543
parent7db4babea0c871638e747cc663348af2c4f137e2
Moved nontrivial context handling from parser to NFA construction phase.

Parser should simply construct AST; all the complex reasoning about
contexts (fixed vs variable) should be delayed until NFA is being
constructed. This way AST can be immutable and it's very easy to share
parts of AST between different conditions, etc.

Removed rule ranks and rank counter: rules are now stored in NFA-local
array and addressed by index.
57 files changed:
re2c/Makefile.am
re2c/bootstrap/src/parse/lex.cc
re2c/bootstrap/src/parse/parser.cc
re2c/bootstrap/src/parse/y.tab.h
re2c/src/codegen/emit_action.cc
re2c/src/codegen/input_api.cc
re2c/src/codegen/output.cc
re2c/src/codegen/output.h
re2c/src/conf/warn.cc
re2c/src/conf/warn.h
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/ctx.cc [new file with mode: 0644]
re2c/src/ir/ctx.h [new file with mode: 0644]
re2c/src/ir/dfa/context_deduplication.cc
re2c/src/ir/dfa/determinization.cc
re2c/src/ir/dfa/dfa.h
re2c/src/ir/dfa/fallback.cc
re2c/src/ir/dfa/minimization.cc
re2c/src/ir/nfa/nfa.cc
re2c/src/ir/nfa/nfa.h
re2c/src/ir/regexp/make_rule.cc [deleted file]
re2c/src/ir/regexp/regexp.cc
re2c/src/ir/regexp/regexp.h
re2c/src/ir/regexp/split_charset.cc
re2c/src/ir/rule.cc [new file with mode: 0644]
re2c/src/ir/rule.h [new file with mode: 0644]
re2c/src/ir/rule_rank.cc [deleted file]
re2c/src/ir/rule_rank.h [deleted file]
re2c/src/ir/skeleton/control_flow.cc
re2c/src/ir/skeleton/generate_code.cc
re2c/src/ir/skeleton/generate_data.cc
re2c/src/ir/skeleton/path.h
re2c/src/ir/skeleton/skeleton.cc
re2c/src/ir/skeleton/skeleton.h
re2c/src/ir/skeleton/unreachable_nullable.cc
re2c/src/parse/parser.h
re2c/src/parse/parser.ypp
re2c/src/parse/rules.h [deleted file]
re2c/src/parse/spec.h
re2c/test/condition_10.cgif--skeleton.c
re2c/test/contexts/cond_star1.ci--input(custom).c
re2c/test/contexts/cond_star1.ci.c
re2c/test/contexts/cond_star2.ci.c
re2c/test/contexts/fix3.i--contexts.c
re2c/test/contexts/fix3_trail.i--contexts--input(custom).c
re2c/test/contexts/fix3_trail.i--contexts.c
re2c/test/php20150211_zend_ini_scanner.igcd--skeleton--flex-syntax--case-inverted.c
re2c/test/php20150211_zend_language_scanner.igcd--skeleton--flex-syntax--case-inverted.c
re2c/test/repeat-01.cgir--skeleton.c
re2c/test/repeat-02.cgir--skeleton.c
re2c/test/repeat-03.cgir--skeleton.c
re2c/test/reuse_conds_default_0.cgir--skeleton.c
re2c/test/reuse_conds_default_1.cgir--skeleton.c