aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/cc/cc.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cmd/cc/cc.h')
-rw-r--r--sys/cmd/cc/cc.h53
1 files changed, 37 insertions, 16 deletions
diff --git a/sys/cmd/cc/cc.h b/sys/cmd/cc/cc.h
index 7d30360..4b61346 100644
--- a/sys/cmd/cc/cc.h
+++ b/sys/cmd/cc/cc.h
@@ -373,10 +373,10 @@ enum
Dvars,
/* names (shouldn't interact with base AST node enumeration */
- Nident = iota(0),
- Nparen = iota(1),
- Nindex = iota(2),
- Ncall = iota(3),
+ Nident,
+ Nparen,
+ Nindex,
+ Ncall,
};
/* expressions */
@@ -561,23 +561,40 @@ struct Ptr
Ptr *link;
};
+struct Param
+{
+ uint32 qual;
+ Type *type;
+ string name;
+};
+
struct Name
{
- struct Node;
+ uint32 kind;
union {
string ident;
struct Dtor *paren;
- };
- union {
- Expr *i;
- Expr *p;
+ /* This is bloated ! */
+ struct {
+ Name *name;
+ union {
+ struct {
+ uint32 q;
+ Expr *x;
+ } idx;
+ struct {
+ int n;
+ struct Param *arg;
+ } call;
+ };
+ } sfx;
};
};
struct Dtor
{
- Ptr ptr;
- Name name;
+ Ptr ptr;
+ Name *name;
};
struct Decls
@@ -592,12 +609,16 @@ struct Decl
{
struct Node;
uint32 spec;
- string name;
- Type *type;
union {
- Stmt *func;
- Expr *init;
- struct Decls *link;
+ struct {
+ string name;
+ Type *type;
+ union {
+ Stmt *body;
+ Expr *init;
+ };
+ };
+ struct Decls vars;
};
};