summaryrefslogtreecommitdiff
path: root/src/grammar.h
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-02-05 23:23:03 +0800
committerJSDurand <mmemmew@gmail.com>2022-02-05 23:23:03 +0800
commit1c8cbfd09ff9dd02f6d8d938c45e3f29a35f6f32 (patch)
treee3d6bb3b5246bcfa38662615ad59663d5b0377d1 /src/grammar.h
parent510b10b96b546fcc6c6b6be85050305ddd192a41 (diff)
predicates start working now
Now we have a working implementation of predicates. It now only remains to write the parser of grammars. Of course we shall generate this parser by this parser generator itself, because why not. ;-P
Diffstat (limited to 'src/grammar.h')
-rw-r--r--src/grammar.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/grammar.h b/src/grammar.h
index e18ad0e..89a66ba 100644
--- a/src/grammar.h
+++ b/src/grammar.h
@@ -78,6 +78,8 @@ PTD *new_ptd(str *user_name, str *raw_name, dfa *dfap);
/* FLAG is used to destroy the strings contained within */
void destroy_ptd(PTD *p, int flag);
+BOOL ptd_run(PTD *p, NUM code);
+
/* If a TNT of type TERMINAL has value END_OF_INPUT, then it means,
surprisingly, the end of input. */
enum { END_OF_INPUT = -1 };
@@ -172,6 +174,9 @@ List *grammar_names(CCR_MOD(Grammar *)g);
/* look up a rule */
Rule_group *grammar_rule(CCR_MOD(Grammar *) g, NT nt);
+/* lookup a predicate */
+PTD *grammar_ptd(CCR_MOD(Grammar *) g, PT pt);
+
/* NTS should be already allocated to be an array of BOOLs. The size
of this array should be the same as the length of the array of
non-terminals of G. If any of the above two conditions is not