CBMC
language.cpp
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Abstract interface to support a programming language
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
11 
12 #include "language.h"
13 
14 #include <util/expr.h>
15 
17 {
18  return false;
19 }
20 
22 {
23  return false;
24 }
25 
27  const std::string &,
28  std::set<std::string> &)
29 {
30 }
31 
33  const exprt &expr,
34  std::string &code,
35  const namespacet &)
36 {
37  code=expr.pretty();
38  return false;
39 }
40 
42  const typet &type,
43  std::string &code,
44  const namespacet &)
45 {
46  code=type.pretty();
47  return false;
48 }
49 
51  const typet &type,
52  std::string &name,
53  const namespacet &)
54 {
55  // probably ansi-c/type2name could be used as better fallback if moved to
56  // util/
57  name=type.pretty();
58  return false;
59 }
Base class for all expressions.
Definition: expr.h:56
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
Definition: irep.cpp:482
virtual bool final(symbol_table_baset &symbol_table)
Final adjustments, e.g.
Definition: language.cpp:16
virtual void dependencies(const std::string &module, std::set< std::string > &modules)
Definition: language.cpp:26
virtual bool from_type(const typet &type, std::string &code, const namespacet &ns)
Formats the given type in a language-specific way.
Definition: language.cpp:41
virtual bool type_to_name(const typet &type, std::string &name, const namespacet &ns)
Encodes the given type in a language-specific way.
Definition: language.cpp:50
virtual bool from_expr(const exprt &expr, std::string &code, const namespacet &ns)
Formats the given expression in a language-specific way.
Definition: language.cpp:32
virtual bool interfaces(symbol_table_baset &symbol_table, message_handlert &message_handler)
Definition: language.cpp:21
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:94
The symbol table base class interface.
The type of an expression, extends irept.
Definition: type.h:29
Abstract interface to support a programming language.