]> Savannah Git Hosting - gnulib.git/commit
dfa: simplify initial state
authorNorihiro Tanaka <noritnk@kcn.ne.jp>
Tue, 18 Sep 2018 16:58:22 +0000 (09:58 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 19 Sep 2018 02:16:52 +0000 (19:16 -0700)
commite648401be0895249f29c8804aefff49a5ff7b957
tree2ecbb34d349dc8876ef6616471a18344421f0999
parentf88c93f4b5ca570e102878720aa7f6c584bcc6fd
dfa: simplify initial state

Simplifying the initial state enables easier optimization of the NFA.
* lib/dfa.c (enum token): Add new element BEG.
(prtok): Adjust due to adding element BEG.
(dfaparse): Put BEG at a head of tokens.
(state_index): Adjust due to adding element BEG.
(dfaanalyze): Concatenate BEG to other tokens, and simplify to
build initial state.
(dfamust): Adjust due to adding element BEG.  DFAMUST ignores it.
ChangeLog
lib/dfa.c