summaryrefslogtreecommitdiff
path: root/prv.h
diff options
context:
space:
mode:
Diffstat (limited to 'prv.h')
-rw-r--r--prv.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/prv.h b/prv.h
new file mode 100644
index 0000000..2f59ec4
--- /dev/null
+++ b/prv.h
@@ -0,0 +1,45 @@
+#ifndef PRV_H
+#define PRV_H
+
+#include "lex.h"
+#include <stddef.h>
+
+struct step
+{
+ enum tktype type;
+ const char *id;
+ int chain;
+};
+
+struct pos
+{
+ const struct seq *seq, *stseq;
+ const struct step *step;
+};
+
+struct prv
+{
+ const struct tk *tk, *stk;
+ struct storage *st;
+ struct tdlevel *levels;
+ struct pos *pos;
+ struct ast *ast;
+ struct type *nest;
+ size_t n, i, block;
+};
+
+struct seq
+{
+ const struct step *steps;
+ int (*fn)(const struct lex *l, struct prv *p);
+ int (*end)(const struct lex *l, struct prv *p);
+ const char *chain;
+};
+
+int kw(const char *s);
+int prev(const struct prv *p);
+int push(const struct pos *pos, struct prv *p);
+int pop(const struct lex *l, struct prv *p);
+char *sdup(const char *s);
+
+#endif