diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-27 21:56:41 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-27 21:56:41 -0700 |
commit | 10a77c022921502a7136aa4f7769406a438596d8 (patch) | |
tree | 6768caa86bad5aed998661af7824581d4622de77 /lib.h | |
parent | d7fa4564690c217d6ac6c62019938a84627f1468 (diff) | |
download | txr-10a77c022921502a7136aa4f7769406a438596d8.tar.gz txr-10a77c022921502a7136aa4f7769406a438596d8.tar.bz2 txr-10a77c022921502a7136aa4f7769406a438596d8.zip |
Support t regex in NFA compiler and in printer.
The t regex means "match nothing". This patch allows the NFA
compiler to handle it. This will be necessary for an upcoming
regex optimizer which can put out such an object. Also, the
recursive regex printer can print the object now.
* regex.c (nfa_kind_t): New enum member, nfa_reject.
(nfa_state_reject): New static function.
(nfa_compile_regex): Compile t regex into a reject
state which cannot reach its corresponding acceptance
state.
(nfa_map_states): Handle nfa_reject case in switch, similarly
to nfa_accept: nothing to transition into.
(print_rec): Render the t regex as the empty character class [].
Diffstat (limited to 'lib.h')
0 files changed, 0 insertions, 0 deletions