summaryrefslogtreecommitdiff
path: root/include/meta.h
blob: 2f3f74819069b9b0146fb051aa7bd7aa941e184f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#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);
int meta_load(char *);
#endif