From c46b574d5b21fb2728c76c5cab1c46890c0fb1cd Mon Sep 17 00:00:00 2001 From: xleroy Date: Thu, 21 Aug 2014 13:23:30 +0000 Subject: Support C99 compound literals (by expansion in Unblock pass). git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2615 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- cparser/C.mli | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) (limited to 'cparser/C.mli') diff --git a/cparser/C.mli b/cparser/C.mli index b1e44eb..71ab1d4 100644 --- a/cparser/C.mli +++ b/cparser/C.mli @@ -25,7 +25,7 @@ type ident = { name: string; (* name as in the source *) stamp: int } (* unique ID *) -(* kinds of integers *) +(* Kinds of integers *) type ikind = | IBool (** [_Bool] *) @@ -153,6 +153,18 @@ type typ = | TUnion of ident * attributes | TEnum of ident * attributes +(** Struct or union field *) + +type field = { + fld_name: string; + fld_typ: typ; + fld_bitfield: int option +} + +type struct_or_union = + | Struct + | Union + (** Expressions *) type exp = { edesc: exp_desc; etyp: typ } @@ -167,8 +179,17 @@ and exp_desc = (* the type at which the operation is performed *) | EConditional of exp * exp * exp | ECast of typ * exp + | ECompound of typ * init | ECall of exp * exp list +(** Initializers *) + +and init = + | Init_single of exp + | Init_array of init list + | Init_struct of ident * (field * init) list + | Init_union of ident * field * init + (** Statements *) type stmt = { sdesc: stmt_desc; sloc: location } @@ -201,30 +222,6 @@ and slabel = and decl = storage * ident * typ * init option -(** Initializers *) - -and init = - | Init_single of exp - | Init_array of init list - | Init_struct of ident * (field * init) list - | Init_union of ident * field * init - -(** Struct or union field *) - -and field = { - fld_name: string; - fld_typ: typ; - fld_bitfield: int option -} - -type struct_or_union = - | Struct - | Union - -(** Enumerator *) - -type enumerator = ident * int64 * exp option - (** Function definitions *) type fundef = { @@ -239,6 +236,10 @@ type fundef = { fd_body: stmt } +(** Element of an enumeration *) + +type enumerator = ident * int64 * exp option + (** Global declarations *) type globdecl = -- cgit v1.2.3