Skip to content

Instantly share code, notes, and snippets.

Avatar

geofflangdale

View GitHub Profile
View basicdfa-gist
struct BasicDFA {
typedef u8 State;
u8 transitions[16][256];
State start_state;
BasicDFA(std::vector<std::tuple<u32, u32, u8>> & trans_vec, u8 start_state_, u8 default_state) {
...
}
State apply(const u8 * data, size_t len, State s) {
size_t i = 0;
for (; i+7 < len; i+=8) {