MCPcopy Create free account
hub / github.com/Genivia/RE-flex / reflex_code_tokenizer

Function reflex_code_tokenizer

tests/test_lorem_tokenizer.cpp:10–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#endif
9
10void reflex_code_tokenizer(reflex::Matcher& m)
11{
12 int c0 = 0, c1 = c0;
13 m.FSM_INIT(c1);
14
15S0:
16 c0 = c1, c1 = m.FSM_CHAR();
17 if ('a' <= c1 && c1 <= 'z') goto S7;
18 if (c1 == '_') goto S7;
19 if ('A' <= c1 && c1 <= 'Z') goto S7;
20 if ('0' <= c1 && c1 <= '9') goto S7;
21 goto S5;
22
23S5:
24 m.FSM_TAKE(2);
25 c0 = c1, c1 = m.FSM_CHAR();
26 return m.FSM_HALT(c1);
27
28S7:
29 m.FSM_TAKE(1);
30 c0 = c1, c1 = m.FSM_CHAR();
31 if ('a' <= c1 && c1 <= 'z') goto S7;
32 if (c1 == '_') goto S7;
33 if ('A' <= c1 && c1 <= 'Z') goto S7;
34 if ('0' <= c1 && c1 <= '9') goto S7;
35 return m.FSM_HALT(c1);
36}
37

Callers

nothing calls this directly

Calls 4

FSM_INITMethod · 0.80
FSM_CHARMethod · 0.80
FSM_TAKEMethod · 0.80
FSM_HALTMethod · 0.80

Tested by

no test coverage detected