cprover
Loading...
Searching...
No Matches
json_symtab_language.cpp
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: JSON symbol table language. Accepts a JSON format symbol
4 table that has been produced out-of-process, e.g. by using
5 a compiler's front-end.
6
7Author: Chris Smowton, chris.smowton@diffblue.com
8
9\*******************************************************************/
10
12
13#include <util/symbol_table.h>
14
15#include <json/json_parser.h>
16#include <linking/linking.h>
17
18#include "json_symbol_table.h"
19
25 std::istream &instream,
26 const std::string &path)
27{
29}
30
36 symbol_table_baset &symbol_table,
37 const std::string &module)
38{
39 (void)module; // unused parameter
40
41 symbol_tablet new_symbol_table;
42
43 try
44 {
46 return linking(symbol_table, new_symbol_table, get_message_handler());
47 }
48 catch(const std::string &str)
49 {
50 error() << "typecheck: " << str << eom;
51 return true;
52 }
53}
54
58void json_symtab_languaget::show_parse(std::ostream &out)
59{
61}
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:563
bool typecheck(symbol_table_baset &symbol_table, const std::string &module) override
Typecheck a goto program in json form.
void show_parse(std::ostream &out) override
Output the result of the parsed json file to the output stream passed as a parameter to this function...
bool parse(std::istream &instream, const std::string &path) override
Parse a goto program in json form.
void output(std::ostream &out) const
Definition json.h:90
mstreamt & error() const
Definition message.h:399
message_handlert & get_message_handler()
Definition message.h:184
static eomt eom
Definition message.h:297
The symbol table base class interface.
The symbol table.
bool parse_json(std::istream &in, const std::string &filename, message_handlert &message_handler, jsont &dest)
void symbol_table_from_json(const jsont &in, symbol_table_baset &symbol_table)
bool linking(symbol_table_baset &dest_symbol_table, const symbol_table_baset &new_symbol_table, message_handlert &message_handler)
Merges the symbol table new_symbol_table into dest_symbol_table, renaming symbols from new_symbol_tab...
Definition linking.cpp:1565
ANSI-C Linking.
Author: Diffblue Ltd.