- All Superinterfaces:
Conversion
A MemConversion converts an expression of pointer or set-of pointer type to $mem type.
Given an expression e that will be converted to have $mem type,
the following restrictions will be applied to e:
- If e has the form:
invalid input: '&'(*p), apply the rest of the restrictions onp; Or if e has the form:invalid input: '&'(p[e'])andphas (set-of) pointer type, apply the rest of the restrictions onp. eand any sub-expressions ofemust not be any of these form:*p, p[e'], p->idwherephas the type of a set-of pointers- If
eand any sub-expressions ofehas type of a set-of pointers, it can only have such a forme' + I, wheree'is a sub-expression ofandIis an expression of (set-of) integer type
The restrictions above is used to prevent cases like
int * p[N];
$mem m = p[0 .. n]. It is hard, if not impossible to represent the
value of m if n, N have non-concrete values.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.civl.abc.ast.conversion.IF.Conversion
Conversion.ConversionKind -
Method Summary
Modifier and TypeMethodDescriptionReturns the type of the entity after applying this conversion.Methods inherited from interface dev.civl.abc.ast.conversion.IF.Conversion
conversionKind, getOldType
-
Method Details
-
getNewType
MemType getNewType()Description copied from interface:ConversionReturns the type of the entity after applying this conversion.- Specified by:
getNewTypein interfaceConversion- Returns:
- the post-conversion type
-