22 "symbol_table_from_json: JSON input must be an object");
26 const auto it = json_object.
find(
"symbolTable");
28 if(it == json_object.
end())
31 "symbol_table_from_json: JSON object must have key `symbolTable`");
34 if(!it->second.is_object())
37 "symbol_table_from_json: JSON symbol table must be an object");
42 for(
const auto &pair : json_symbol_table)
44 const jsont &json_symbol = pair.second;
48 if(symbol_table.
add(symbol))
50 "symbol_table_from_json: duplicate symbol name `" +
Thrown when failing to deserialize a value from some low level format, like JSON or raw bytes.
iterator find(const std::string &key)
The symbol table base class interface.
virtual void validate(const validation_modet vm=validation_modet::INVARIANT) const =0
bool add(const symbolt &symbol)
Add a new symbol to the symbol table.
irep_idt name
The unique identifier.
const std::string & id2string(const irep_idt &d)
json_objectt & to_json_object(jsont &json)
symbolt symbol_from_json(const jsont &in)
Deserialise a json object to a symbolt.
void symbol_table_from_json(const jsont &in, symbol_table_baset &symbol_table)