21 static const std::string &
26 "symbol_from_json: expected string for key '" + key +
"'");
38 "symbol_from_json: expected bool for key '" + key +
"'");
53 if(kv.first ==
"type")
58 else if(kv.first ==
"value")
63 else if(kv.first ==
"location")
68 else if(kv.first ==
"name")
70 else if(kv.first ==
"module")
72 else if(kv.first ==
"baseName")
74 else if(kv.first ==
"mode")
76 else if(kv.first ==
"prettyName")
78 else if(kv.first ==
"isType")
80 else if(kv.first ==
"isMacro")
82 else if(kv.first ==
"isExported")
84 else if(kv.first ==
"isInput")
86 else if(kv.first ==
"isOutput")
88 else if(kv.first ==
"isStateVar")
90 else if(kv.first ==
"isProperty")
92 else if(kv.first ==
"isStaticLifetime")
94 else if(kv.first ==
"isThreadLocal")
96 else if(kv.first ==
"isLvalue")
98 else if(kv.first ==
"isFileLocal")
100 else if(kv.first ==
"isExtern")
102 else if(kv.first ==
"isVolatile")
104 else if(kv.first ==
"isParameter")
106 else if(kv.first ==
"isAuxiliary")
108 else if(kv.first ==
"isWeak")
110 else if(kv.first ==
"prettyType")
113 else if(kv.first ==
"prettyValue")
118 "symbol_from_json: unexpected key '" + kv.first +
"'");
Thrown when failing to deserialize a value from some low level format, like JSON or raw bytes.
Base class for all expressions.
There are a large number of kinds of tree structured or tree-like data in CPROVER.
irept convert_from_json(const jsont &) const
Deserialize a JSON irep representation.
irep_idt base_name
Base (non-scoped) name.
irep_idt module
Name of module the symbol belongs to.
source_locationt location
Source code location of definition of symbol.
typet type
Type of symbol.
irep_idt name
The unique identifier.
irep_idt pretty_name
Language-specific display name.
exprt value
Initial value of symbol.
irep_idt mode
Language mode.
The type of an expression, extends irept.
json_objectt & to_json_object(jsont &json)
static const std::string & try_get_string(const jsont &in, const std::string &key)
Return string value for a given key if present in the json object.
static bool try_get_bool(const jsont &in, const std::string &key)
Return boolean value for a given key if present in the json object.
symbolt symbol_from_json(const jsont &in)
Deserialise a json object to a symbolt.
Defines typet, type_with_subtypet and type_with_subtypest.