12 #ifndef CPROVER_LANGAPI_LANGUAGE_H
13 #define CPROVER_LANGAPI_LANGUAGE_H
22 #include <unordered_set>
31 #define OPT_FUNCTIONS \
34 #define HELP_FUNCTIONS " {y--function} {uname} \t set main function name\n"
47 std::istream &instream,
48 const std::string &path,
49 std::ostream &outstream,
60 std::istream &instream,
61 const std::string &path,
79 const std::string &module,
80 std::set<std::string> &modules);
111 (void)message_handler;
128 const std::string &module,
148 const std::string &module,
150 const bool keep_file_local)
154 "three-argument typecheck should only be called for files written"
155 " in a language that allows file-local symbols, like C");
160 virtual std::string
id()
const = 0;
209 const std::string &code,
210 const std::string &module,
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
virtual void modules_provided(std::set< std::string > &modules)
virtual std::string description() const =0
virtual std::set< std::string > extensions() const =0
virtual bool can_keep_file_local()
Is it possible to call three-argument typecheck() on this object?
virtual void dependencies(const std::string &module, std::set< std::string > &modules)
virtual bool typecheck(symbol_table_baset &symbol_table, const std::string &module, message_handlert &message_handler, const bool keep_file_local)
typecheck without removing specified entries from the symbol table
virtual bool from_type(const typet &type, std::string &code, const namespacet &ns)
Formats the given type in a language-specific way.
virtual bool parse(std::istream &instream, const std::string &path, message_handlert &message_handler)=0
virtual std::unique_ptr< languaget > new_language()=0
virtual bool type_to_name(const typet &type, std::string &name, const namespacet &ns)
Encodes the given type in a language-specific way.
virtual std::string id() const =0
virtual bool from_expr(const exprt &expr, std::string &code, const namespacet &ns)
Formats the given expression in a language-specific way.
virtual void convert_lazy_method(const irep_idt &function_id, symbol_table_baset &symbol_table, message_handlert &message_handler)
Requests this languaget should populate the body of method function_id in symbol_table.
virtual bool generate_support_functions(symbol_table_baset &symbol_table, message_handlert &message_handler)=0
Create language-specific support functions, such as __CPROVER_start, __CPROVER_initialize and languag...
virtual bool typecheck(symbol_table_baset &symbol_table, const std::string &module, message_handlert &message_handler)=0
virtual bool preprocess(std::istream &instream, const std::string &path, std::ostream &outstream, message_handlert &)
virtual bool interfaces(symbol_table_baset &symbol_table, message_handlert &message_handler)
virtual bool to_expr(const std::string &code, const std::string &module, exprt &expr, const namespacet &ns, message_handlert &message_handler)=0
Parses the given string into an expression.
virtual void methods_provided(std::unordered_set< irep_idt > &methods) const
Should fill methods with the symbol identifiers of all methods this languaget can provide a body for,...
virtual void set_language_options(const optionst &, message_handlert &)
Set language-specific options.
virtual void show_parse(std::ostream &out, message_handlert &message_handler)=0
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
The symbol table base class interface.
The type of an expression, extends irept.