grammar loader and unloader in C. Abstract Syntax only!

This commit is contained in:
krasimir
2010-06-16 15:14:34 +00:00
parent 7398216aa9
commit 7b315e94a4
8 changed files with 914 additions and 0 deletions

76
src/runtime/c/pgf/data.h Normal file
View File

@@ -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