summaryrefslogtreecommitdiff
path: root/include/meta.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/meta.h')
-rw-r--r--include/meta.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/include/meta.h b/include/meta.h
new file mode 100644
index 0000000..7e456a5
--- /dev/null
+++ b/include/meta.h
@@ -0,0 +1,56 @@
+#ifndef __META_H__
+#define __META_H__
+
+#define MAXF 32
+#define MAXP 256
+#define MAXM 64
+
+typedef struct phon_t {
+ char *p1;
+ char *p2;
+ struct phon_t *next;
+} phon_t;
+
+typedef struct field_t {
+ char *name;
+ char **names;
+ int *sizes, nbr;
+ struct field_t *next;
+} field_t;
+
+typedef struct metaexpr_t {
+ char * name;
+ int type;
+ char * string;
+ /* left = right = NULL => feuille
+ left = NULL => opérateur unaire
+ sinon => opérateur binaire
+ */
+ struct metaexpr_t * left, * right;
+} metaexpr_t;
+
+typedef struct pattern_t {
+ char * name;
+ metaexpr_t ** expr;
+ int nbr;
+ struct pattern_t *next;
+} pattern_t;
+
+typedef struct instruct_t {
+ char ** names;
+ char ** strings;
+ char ** implicits;
+ char ** istrings;
+ int * etypes, * itypes, * ivalues, nbexplicit, nbimplicit;
+ struct instruct_t * next;
+} instruct_t;
+
+extern phon_t *phons;
+extern field_t *fields;
+extern pattern_t *patterns;
+extern instruct_t *instructs;
+
+void meta_parse_line(char *);
+int meta_init(void);
+void meta_flush(void);
+#endif