From a8bd5e9d85ac9928bd29add82e887f82642af893 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Mon, 31 Jan 2022 09:23:20 +0800 Subject: test/check_cnp: working algorithm I now have a working algorithm in test/check_cnp. It can correctly parse the grammar for an esoteric language called "Brainfuck". This language does not matter. What matters is that it contains parentheses. So this shows that at least for grammars as complex as parentheses, this parser works well. Haha. --- src/dfa.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/dfa.h') diff --git a/src/dfa.h b/src/dfa.h index a22409f..70c8bf6 100644 --- a/src/dfa.h +++ b/src/dfa.h @@ -32,18 +32,18 @@ dfa *new_dfa(); void destroy_dfa(dfa *table); -void print_dfa(const dfa * const restrict table); +void print_dfa(CCR_MOD(dfa *) table); dfa *dfa_from_bytes(int sequence_size, - const NUM * const restrict data); + CCR_MOD(NUM *) data); dfa *dfa_from_bytes_neg(int sequence_size, - const NUM * const restrict data); + CCR_MOD(NUM *) data); dfa *dfa_from_bytes_both(int sequence_size, - const NUM * const restrict data, + CCR_MOD(NUM *) data, int neg_sequence_size, - const NUM * const restrict negdata); + CCR_MOD(NUM *) negdata); /* TODO: Reject character bytes from a given DFA. */ @@ -59,6 +59,6 @@ dfa *dfa_from_bytes_both(int sequence_size, inline BOOL dfa_any_fun(const NUM UNUSED code) { return 1; } -BOOL run_dfa(const dfa * const restrict table, const NUM code); +BOOL run_dfa(CCR_MOD(dfa *) table, const NUM code); #endif -- cgit v1.2.3-18-g5258