Module Typed_number

module Typed_number: sig .. end

Manipulate the type of numbers.

Manipulate the type of numbers.


type strnum = 
| Str_Z
| Str_R
| C_number

Type of a string that represents a number. Used when a string is required to encode a constant number because it is not representable in any C type

val add_cast : loc:Cil_types.location ->
?name:string ->
Env.t ->
Cil_types.kernel_function ->
Cil_types.typ option ->
strnum ->
Cil_types.term option -> Cil_types.exp -> Cil_types.exp * Env.t

add_cast ~loc ?name env kf ctx sty t_opt e convert number expression e in a way that it is compatible with the given typing context ctx. sty indicates if the expression is a string representing a number (integer or real) or directly a C number type. t_opt is the term that is represented by the expression e.