Go to the documentation of this file.
21 static const std::string &
26 "symbol_from_json: expected string for key '" + key +
"'");
38 "symbol_from_json: expected bool for key '" + key +
"'");
51 for(
const auto &kv : in.
object)
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 ==
"base_name")
74 else if(kv.first ==
"mode")
76 else if(kv.first ==
"pretty_name")
78 else if(kv.first ==
"is_type")
80 else if(kv.first ==
"is_macro")
82 else if(kv.first ==
"is_exported")
84 else if(kv.first ==
"is_input")
86 else if(kv.first ==
"is_output")
88 else if(kv.first ==
"is_state_var")
90 else if(kv.first ==
"is_property")
92 else if(kv.first ==
"is_static_lifetime")
94 else if(kv.first ==
"is_thread_local")
96 else if(kv.first ==
"is_lvalue")
98 else if(kv.first ==
"is_file_local")
100 else if(kv.first ==
"is_extern")
102 else if(kv.first ==
"is_volatile")
104 else if(kv.first ==
"is_parameter")
106 else if(kv.first ==
"is_auxiliary")
108 else if(kv.first ==
"is_weak")
112 "symbol_from_json: unexpected key '" + kv.first +
"'");
The type of an expression, extends irept.
typet type
Type of symbol.
Thrown when failing to deserialize a value from some low level format, like JSON or raw bytes.
Base class for all expressions.
irep_idt base_name
Base (non-scoped) name.
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.
irep_idt pretty_name
Language-specific display name.
irep_idt mode
Language mode.
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.
exprt value
Initial value of symbol.
source_locationt location
Source code location of definition of symbol.
Base class for tree-like data structures with sharing.
irep_idt module
Name of module the symbol belongs to.
irep_idt name
The unique identifier.
symbolt symbol_from_json(const jsont &in)
Deserialise a json object to a symbolt.
irept convert_from_json(const jsont &) const
Deserialize a JSON irep representation.