summaryrefslogtreecommitdiff
path: root/src/runtime/c/pgf/data.h
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-06-16 15:14:34 +0000
committerkrasimir <krasimir@chalmers.se>2010-06-16 15:14:34 +0000
commitc760c52223c4737bf2803e2c28699a923c4c12c5 (patch)
tree78a93bc98fe5914105cdbdc747f9968c9c50b446 /src/runtime/c/pgf/data.h
parent106d056f54ca8cdc887680d822ac31614ccf383b (diff)
grammar loader and unloader in C. Abstract Syntax only!
Diffstat (limited to 'src/runtime/c/pgf/data.h')
-rw-r--r--src/runtime/c/pgf/data.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/runtime/c/pgf/data.h b/src/runtime/c/pgf/data.h
new file mode 100644
index 000000000..b17ea6d66
--- /dev/null
+++ b/src/runtime/c/pgf/data.h
@@ -0,0 +1,76 @@
+#ifndef PGF_DATA_H
+#define PGF_DATA_H
+
+typedef int BindType;
+
+#include "expr.h"
+#include "type.h"
+
+struct _String {
+ int len;
+ unsigned int chars[];
+};
+
+struct _CId {
+ int len;
+ char chars[];
+};
+
+typedef struct _CIdList {
+ int count;
+ CId names[];
+} *CIdList;
+
+typedef struct _AbsCat {
+ CId name;
+ Context hypos;
+ CIdList funs;
+} *AbsCat;
+
+typedef struct _AbsCats {
+ int count;
+ struct _AbsCat lst[];
+} *AbsCats;
+
+typedef struct _AbsFun {
+ CId name;
+ Type ty;
+ int arrity;
+ Equations equs;
+} *AbsFun;
+
+typedef struct _AbsFuns {
+ int count;
+ struct _AbsFun lst[];
+} *AbsFuns;
+
+struct _Flag {
+ CId name;
+ Literal value;
+} ;
+
+typedef struct _Flags {
+ int count;
+ struct _Flag values[];
+} *Flags;
+
+typedef struct _Abstract {
+ CId name;
+ Flags flags;
+ AbsFuns funs;
+ AbsCats cats;
+} *Abstract;
+
+typedef struct _Concrete {
+ CId name;
+ Flags flags;
+} *Concrete;
+
+struct _PGF {
+ Flags flags;
+ int nConcr;
+ struct _Abstract abstract;
+ struct _Concrete concretes[];
+};
+
+#endif