Valid-structdeclor
Validate a structure declarator.
- Signature
(valid-structdeclor structdeclor previous type table ienv)
→
(mv erp new-structdeclor new-previous return-types new-table)
- Arguments
- structdeclor — Guard (structdeclorp structdeclor).
- previous — Guard (ident-listp previous).
- type — Guard (typep type).
- table — Guard (valid-tablep table).
- ienv — Guard (ienvp ienv).
- Returns
- new-structdeclor — Type (structdeclorp new-structdeclor).
- new-previous — Type (ident-listp new-previous).
- return-types — Type (type-setp return-types).
- new-table — Type (valid-tablep new-table).
The previous input and new-previous output
have the same meaning as in valid-structdecl.
The type input comes from the list of specifiers and qualifiers
that precedes the list of structure declarators
of which this structure declarator is an element.
We ensure that there is either a declarator or a constant expression
(this is actually a syntactic constraint,
but it is currently not captured in the abstract syntax,
so we check it here).
If there is a declarator, we validate it,
and we add the declared identifier to the list member names,
after ensuring that it is not already there.
If there is a constant expression, we validate it,
but for now we do not perform any checks related to its value
[C:6.7.2.1/4];
we also do not constrain the types of bit fields [C:6.7.2.1/5],
but we ensure that the constant expression, if present, is integer.