aboutsummaryrefslogtreecommitdiff
path: root/tools/re2c/ins.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/re2c/ins.h')
-rw-r--r--tools/re2c/ins.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/tools/re2c/ins.h b/tools/re2c/ins.h
new file mode 100644
index 0000000..ba6c087
--- /dev/null
+++ b/tools/re2c/ins.h
@@ -0,0 +1,40 @@
+#ifndef re2c_ins_h
+#define re2c_ins_h
+
+#include "tools/re2c/basics.h"
+
+#define nChars 256
+typedef unsigned char Char;
+
+#define CHAR 0
+#define GOTO 1
+#define FORK 2
+#define TERM 3
+#define CTXT 4
+
+typedef union Ins {
+ struct {
+ byte tag;
+ byte marked;
+ void *link;
+ } i;
+ struct {
+ unsigned short value;
+ unsigned short bump;
+ void *link;
+ } c;
+} Ins;
+
+static int isMarked(Ins *i){
+ return i->i.marked != 0;
+}
+
+static void mark(Ins *i){
+ i->i.marked = 1;
+}
+
+static void unmark(Ins *i){
+ i->i.marked = 0;
+}
+
+#endif