summaryrefslogtreecommitdiff
path: root/src/crf.h
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-01-31 09:23:20 +0800
committerJSDurand <mmemmew@gmail.com>2022-01-31 09:23:20 +0800
commita8bd5e9d85ac9928bd29add82e887f82642af893 (patch)
tree74e377f9fccffc2779ff97fa0bd8ad180b9c865c /src/crf.h
parente555c88b8107caf886da229444c2bed1aaef6c2c (diff)
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.
Diffstat (limited to 'src/crf.h')
-rw-r--r--src/crf.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/crf.h b/src/crf.h
index 7ff5a3f..9d1cc78 100644
--- a/src/crf.h
+++ b/src/crf.h
@@ -1,5 +1,5 @@
-#ifndef CNP_H
-#define CNP_H
+#ifndef CRF_H
+#define CRF_H
#include "ht.h"
/* This file implements some support functions for the Clustered
@@ -83,6 +83,8 @@ spa *new_spa();
void destroy_spa(spa * const restrict spap);
+__attribute__((__pure__, __cold__)) ht *spa_ht(CCR_MOD(spa *) spap);
+
/* On error return non-zero */
BOOL spa_insert(spa * const restrict spap, pair3 label);
@@ -156,8 +158,12 @@ BOOL desc_add(procr * const restrict pr, procu * const restrict pu,
/* if no more elements are left, return NULL */
prodecor *pop_procr(procr * pr, procu * pu, NUM *gradep);
+void print_procr(CCR_MOD(procr *) pr);
+
/* destructor */
void destroy_procr(procr * const restrict pr);
void destroy_procu(procu * const restrict pu);
+#define TEST haha
+
#endif