CBMC
Loading...
Searching...
No Matches
json_goto_function.cpp File Reference

JSON goto_function deserialization. More...

#include "json_goto_function.h"
#include <util/exception_utils.h>
#include <util/expr.h>
#include <util/json_irep.h>
#include <util/string2int.h>
#include "json_symbol.h"
+ Include dependency graph for json_goto_function.cpp:

Go to the source code of this file.

Functions

static goto_instruction_codet try_get_code (const json_objectt &json)
 Return code at "code" key in a JSON object, if any.
 
static goto_instruction_codet try_get_code (const json_objectt &json, const irep_idt &code_id)
 Return code at "code" key in a JSON object, if any.
 
static exprt try_get_guard (const json_objectt &json)
 Return expression at "guard" key in a JSON object, if any.
 
static goto_programt::instructiont instruction_from_json (const json_objectt &json)
 Deserialize a goto_programt::instructiont from JSON.
 
static goto_programt goto_program_from_json (const jsont &json)
 Deserialize a goto_programt from JSON.
 
goto_functiont goto_function_from_json (const json_objectt &json)
 Deserialize a goto_functiont from JSON.
 

Detailed Description

JSON goto_function deserialization.

Definition in file json_goto_function.cpp.

Function Documentation

◆ goto_function_from_json()

goto_functiont goto_function_from_json ( const json_objectt json)

Deserialize a goto_functiont from JSON.

Parameters
jsonThe JSON object representing a goto_function
Returns
A goto_functiont

Definition at line 301 of file json_goto_function.cpp.

◆ goto_program_from_json()

static goto_programt goto_program_from_json ( const jsont json)
static

Deserialize a goto_programt from JSON.

Parameters
jsonThe JSON object representing a goto_program
Returns
A goto_programt

Definition at line 192 of file json_goto_function.cpp.

◆ instruction_from_json()

static goto_programt::instructiont instruction_from_json ( const json_objectt json)
static

Deserialize a goto_programt::instructiont from JSON.

Parameters
jsonThe JSON object representing an instruction
Returns
A goto_programt::instructiont

Definition at line 72 of file json_goto_function.cpp.

◆ try_get_code() [1/2]

static goto_instruction_codet try_get_code ( const json_objectt json)
static

Return code at "code" key in a JSON object, if any.

Parameters
jsonThe json object to pick the value from.
Returns
An expression, unless an exception was thrown before.

Definition at line 24 of file json_goto_function.cpp.

◆ try_get_code() [2/2]

static goto_instruction_codet try_get_code ( const json_objectt json,
const irep_idt code_id 
)
static

Return code at "code" key in a JSON object, if any.

Parameters
jsonThe json object to pick the value from.
code_idThe expected code type
Returns
An expression, unless an exception was thrown before.

Definition at line 41 of file json_goto_function.cpp.

◆ try_get_guard()

static exprt try_get_guard ( const json_objectt json)
static

Return expression at "guard" key in a JSON object, if any.

Parameters
jsonThe json object to pick the value from.
Returns
An expression, unless an exception was thrown before.

Definition at line 56 of file json_goto_function.cpp.