aboutsummaryrefslogtreecommitdiff
path: root/src/prc1/parse.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/prc1/parse.h')
-rw-r--r--src/prc1/parse.h36
1 files changed, 33 insertions, 3 deletions
diff --git a/src/prc1/parse.h b/src/prc1/parse.h
index 5d3d25a..97c7848 100644
--- a/src/prc1/parse.h
+++ b/src/prc1/parse.h
@@ -49,7 +49,7 @@ struct builtin
struct type
{
- enum {U, S, C, P, T, PTR, ARY, BUILTIN} type;
+ enum ttype {U, S, C, P, T, PTR, ARY, BUILTIN} type;
const struct tk *tk;
size_t sz, align;
int sign;
@@ -68,6 +68,36 @@ struct type
} u;
};
+struct sym
+{
+ enum symtype
+ {
+ SYM_ID,
+ SYM_TMP,
+ SYM_LIT,
+ SYM_CAST,
+ SYM_NUM,
+ SYM_ADDR,
+ SYM_SZ,
+ SYM_CNT,
+ SYM_OFF
+ } type;
+
+ struct sym *child, *next, *parent;
+ const struct tk *tk;
+
+ union
+ {
+ const struct tmp *tmp;
+ const struct type *t;
+ struct
+ {
+ int sign;
+ union c c;
+ } num;
+ } u;
+};
+
struct param
{
const struct tk *tk;
@@ -79,14 +109,13 @@ struct pr
const struct tk *tk;
struct param *params, *ret;
size_t nparams;
- int variadic;
+ int using, returning, variadic;
};
struct td
{
const struct tk *tk;
struct type *types;
- size_t ntypes;
};
struct tmp
@@ -103,6 +132,7 @@ struct fn
enum linkage {EXTERNAL, STATIC} linkage;
struct storage *lk, *ws, *gl;
struct stmt *stmts;
+ struct sym *syms;
struct tmp *tmps;
struct im *imps;
struct pr *pr;