/home/travis/build/MoarVM/MoarVM/src/6model/reprs/NFA.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* NFA constants. */ |
2 | 2.42M | #define MVM_NFA_EDGE_FATE 0 |
3 | 13.0M | #define MVM_NFA_EDGE_EPSILON 1 |
4 | 5.04M | #define MVM_NFA_EDGE_CODEPOINT 2 |
5 | 6 | #define MVM_NFA_EDGE_CODEPOINT_NEG 3 |
6 | 864k | #define MVM_NFA_EDGE_CHARCLASS 4 |
7 | 89.3k | #define MVM_NFA_EDGE_CHARCLASS_NEG 5 |
8 | 1.71M | #define MVM_NFA_EDGE_CHARLIST 6 |
9 | 17.6k | #define MVM_NFA_EDGE_CHARLIST_NEG 7 |
10 | 0 | #define MVM_NFA_EDGE_SUBRULE 8 |
11 | 0 | #define MVM_NFA_EDGE_CODEPOINT_I 9 |
12 | 0 | #define MVM_NFA_EDGE_CODEPOINT_I_NEG 10 |
13 | | #define MVM_NFA_EDGE_GENERIC_VAR 11 |
14 | 6.63k | #define MVM_NFA_EDGE_CHARRANGE 12 |
15 | 0 | #define MVM_NFA_EDGE_CHARRANGE_NEG 13 |
16 | 1.15M | #define MVM_NFA_EDGE_CODEPOINT_LL 14 |
17 | 0 | #define MVM_NFA_EDGE_CODEPOINT_I_LL 15 |
18 | 6 | #define MVM_NFA_EDGE_CODEPOINT_M 16 |
19 | 6 | #define MVM_NFA_EDGE_CODEPOINT_M_NEG 17 |
20 | | #define MVM_NFA_EDGE_CODEPOINT_M_LL 18 |
21 | 0 | #define MVM_NFA_EDGE_CODEPOINT_IM 19 |
22 | 0 | #define MVM_NFA_EDGE_CODEPOINT_IM_NEG 20 |
23 | | #define MVM_NFA_EDGE_CODEPOINT_IM_LL 21 |
24 | 0 | #define MVM_NFA_EDGE_CHARRANGE_M 22 |
25 | 0 | #define MVM_NFA_EDGE_CHARRANGE_M_NEG 23 |
26 | | |
27 | | /* State entry. */ |
28 | | struct MVMNFAStateInfo { |
29 | | MVMint64 act; |
30 | | MVMint64 to; |
31 | | union { |
32 | | MVMGrapheme32 g; |
33 | | MVMint64 i; |
34 | | MVMString *s; |
35 | | struct { |
36 | | MVMGrapheme32 uc; |
37 | | MVMGrapheme32 lc; |
38 | | } uclc; |
39 | | } arg; |
40 | | }; |
41 | | |
42 | | /* Body of an NFA. */ |
43 | | struct MVMNFABody { |
44 | | MVMObject *fates; |
45 | | MVMint64 num_states; |
46 | | MVMint64 *num_state_edges; |
47 | | MVMNFAStateInfo **states; |
48 | | }; |
49 | | |
50 | | struct MVMNFA { |
51 | | MVMObject common; |
52 | | MVMNFABody body; |
53 | | }; |
54 | | |
55 | | /* Function for REPR setup. */ |
56 | | const MVMREPROps * MVMNFA_initialize(MVMThreadContext *tc); |
57 | | |
58 | | /* Other NFA related functions. */ |
59 | | MVMObject * MVM_nfa_from_statelist(MVMThreadContext *tc, MVMObject *states, MVMObject *nfa_type); |
60 | | MVMObject * MVM_nfa_run_proto(MVMThreadContext *tc, MVMObject *nfa, MVMString *target, MVMint64 offset); |
61 | | void MVM_nfa_run_alt(MVMThreadContext *tc, MVMObject *nfa, MVMString *target, |
62 | | MVMint64 offset, MVMObject *bstack, MVMObject *cstack, MVMObject *labels); |