]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | /* |
28bf4b0b | 2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001. |
885824d3 | 3 | ** See ../LICENSE for license information. |
4 | */ | |
5 | /* | |
6 | ** typeExpr.h | |
7 | */ | |
8 | ||
9 | typedef enum | |
10 | { | |
11 | TEXPR_BASE, TEXPR_PTR, TEXPR_ARRAY, TEXPR_FCN | |
12 | } typeExprKind; | |
13 | ||
28bf4b0b | 14 | struct s_typeExpr |
885824d3 | 15 | { |
16 | int wrapped; /* number of balanced parentheses around this program node */ | |
17 | typeExprKind kind; /* different kinds of type constructors */ | |
18 | union { | |
19 | ltoken base; | |
20 | /*@null@*/ typeExpr pointer; | |
21 | struct { | |
22 | /*@null@*/ typeExpr elementtype; | |
23 | /*@null@*/ termNode size; | |
24 | } array; | |
25 | struct { | |
26 | /*@null@*/ typeExpr returntype; /* not really ... return-part maybe */ | |
27 | paramNodeList args; | |
28 | } function; | |
29 | } content; | |
30 | sort sort; | |
31 | } ; | |
32 | ||
33 | extern void typeExpr_free (/*@only@*/ /*@null@*/ typeExpr p_x); | |
34 | extern /*@only@*/ cstring typeExpr_unparse (/*@null@*/ typeExpr p_x); | |
35 | extern /*@only@*/ cstring typeExpr_unparseNoBase (/*@null@*/ typeExpr p_x); | |
36 | ||
37 | /* like a declaratorNode but without varId */ | |
38 | typedef typeExpr abstDeclaratorNode; | |
39 | ||
40 | extern void abstDeclaratorNode_free (/*@only@*/ /*@null@*/ abstDeclaratorNode p_x); | |
41 | # define abstDeclaratorNode_free(x) typeExpr_free(x); | |
42 | ||
43 |