ref: 72abaa282749e37df7831959b1a344664b1827f3
dir: /dat.h/
typedef struct Nod Nod;
typedef struct Nlst Nlst;
typedef struct Typ Typ;
typedef struct Loc Loc;
#define ZL (Nlst){nil, 0, 0}
struct Typ {
int t;
char linear;
char *name;
Typ *base;
Nod *size;
};
struct Nlst {
Nod **v;
int nv;
int cap;
};
struct Loc {
int line;
char *file;
};
enum {
Tarray,
Tslice,
};
enum {
Nexpr,
Nfor,
Niter,
Nblk,
Nlit,
Nsym,
Ndcl,
};
enum {
Olit,
Ovar,
Oasn,
Oadd,
Osub,
Omul,
Odiv,
Omod,
Oshl,
Oshr,
Olor,
Oland,
Ogt,
Olt,
Oge,
Ole,
Oeq,
One,
Oinc,
Odec,
Orcv,
};
struct Nod {
int t;
Loc loc;
union {
struct {
int nsub;
Nod *sub;
} top;
struct {
int op;
Nod *lhs;
Nod *rhs;
Typ *type;
} expr;
struct {
Nod *idx;
Nod *arg;
Nod *body;
} iter;
struct {
Nod *init;
Nod *cond;
Nod *step;
Nod *body;
} nfor;
struct {
vlong val;
} lit;
struct {
char *sym;
} sym;
struct {
char *name;
Nlst arg;
Nod *body;
} fndef;
struct {
char *name;
char *pkg;
Typ *type;
Nod *init;
} dcl;
struct {
Nlst body;
} blk;
};
};
extern int lexline;
extern char* lexfile;