From aaa12504c6095b2cdfa213a3d4b269bbd5e7038a Mon Sep 17 00:00:00 2001 From: JSDurand Date: Sun, 6 Feb 2022 23:35:42 +0800 Subject: dfa: add the type of "ranged dfas" Strictly speaking, they are not DFA's at all. They contain ranges which can determine whether or not a character belongs to the specified predicate terminal. --- src/test/check_dfa.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/test/check_dfa.c') diff --git a/src/test/check_dfa.c b/src/test/check_dfa.c index a728fb8..426eee4 100644 --- a/src/test/check_dfa.c +++ b/src/test/check_dfa.c @@ -104,5 +104,15 @@ main(int UNUSED argc, char ** UNUSED argv) * printf("the result = %d\n", result); */ if (dfap) destroy_dfa(dfap); + + dfap = dfa_from_ranges(3, (NUM []) { 1, 10, 'a', 'z', 'A', 'Z' }); + + if (dfap) { + printf("Successfully created a DFA from an array of ranges\n"); + print_dfa(dfap); + } + + if (dfap) destroy_dfa(dfap); + return 0; } -- cgit v1.2.3-18-g5258