summaryrefslogtreecommitdiff
path: root/src/test/check_dfa.c
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-02-06 23:35:42 +0800
committerJSDurand <mmemmew@gmail.com>2022-02-06 23:50:22 +0800
commitaaa12504c6095b2cdfa213a3d4b269bbd5e7038a (patch)
tree9513833a65f0f2687b238fe6d0415bd5877ed8ae /src/test/check_dfa.c
parent3d709982b66314b23b5957041580dd4918561a53 (diff)
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.
Diffstat (limited to 'src/test/check_dfa.c')
-rw-r--r--src/test/check_dfa.c10
1 files changed, 10 insertions, 0 deletions
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;
}