summaryrefslogtreecommitdiffstats
path: root/socket.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-09-13 06:34:31 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-09-13 06:34:31 -0700
commite7c55ed9b8ff89310dc08b98eb03fc35ef280e41 (patch)
treee10a87f229c38dd4c1ee23ab396bdbad1c469fee /socket.h
parentaf7509ea7af412e5290906f5c5fa092ff87c077f (diff)
downloadtxr-e7c55ed9b8ff89310dc08b98eb03fc35ef280e41.tar.gz
txr-e7c55ed9b8ff89310dc08b98eb03fc35ef280e41.tar.bz2
txr-e7c55ed9b8ff89310dc08b98eb03fc35ef280e41.zip
regex: re-introduce nfa_accept states.
The nfa_accept state label is re-introduced. This state type has the same representation as nfa_empty; essentially, this replaces the flag. This makes the state type smaller, and we don't have to access the flag to tell if a state is an acceptance state. * regex.c (nfa_kind_t): New enum label, nfa_accept. (struct nfa_state_empty): Member accept removed. (nfa_accept_state_p): Macro tests only for nfa_accept type. (nfa_empty_state_p): New macro. (nfa_state_accept): Set type of new state to nfa_accept; do not set accept flag. (nfa_state_empty): Do not set accept flag. (nfa_state_empty_convert): Do not clear accept flag. (nfa_map_states): Handle nfa_accept in switch, in the same case as nfa_empty. (nfa_thread_epsilons): Don't test for accept state in nfa_empty case; it would be always false now. Add nfa_accept case to switch which only arranges for a traversal of the two transitions. (Though these are expected to be null at the stage of the graph when this function is applied). (nfa_fold_accept): Switch type to nfa_accept rather than setting accept flag. (nfa_closure, nfa_move_closure): Use new macro for testing whether a state is empty.
Diffstat (limited to 'socket.h')
0 files changed, 0 insertions, 0 deletions