7.10 The C structure

c_decl

Datatype

Specification:
datatype c_decl = UNDEF_DECL | VAR_DECL of { name : name, ctype : c_type } | FUN_DECL of { name : name, source : c_type list, target : c_type } | TYPE_DECL of { name : name, defn : c_type, size : int } | CONST_DECL of { name : name, ctype : c_type }

Description:

This data type is used to represent C type declaration info and has the following structure:

UNDEF_DECL
This value is included as a default return value for queries rather than using option values (that is, NONE and SOME) for wrapping and unwrapping these values.

VAR_DECL of { name : name, ctype : c_type }

C variable declarations can be recorded in this form. The type information may be updated and modified.

FUN_DECL of { name : name, source : c_type list, target : c_type }

C function declaration information can be recorded in this form. The type information may be updated and modified.

TYPE_DECL of { name : name, defn : c_type, size : int }

C type information associated with a name (that is, typedef and struct/union/enum declarations) can be recorded in this form. The associated type and size information may be updated and modified.

CONST_DECL of { name : name, ctype : c_type }

Type information associated with simple literal #define constants can be recorded in this form.


MLWorks Reference Manual (version 1.0) - 3 DEC 1996

Generated with Harlequin WebMaker