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 }
symbol_tablet
The symbol table.
Definition: symbol_table.h:13
typet
The type of an expression, extends irept.
Definition: type.h:28
irept::pretty
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
Definition: irep.cpp:495
languaget::final
virtual bool final(symbol_table_baset &symbol_table)
Final adjustments, e.g.
Definition: language.cpp:16
exprt
Base class for all expressions.
Definition: expr.h:55
expr.h
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:90
languaget::from_type
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
languaget::dependencies
virtual void dependencies(const std::string &module, std::set< std::string > &modules)
Definition: language.cpp:26
languaget::from_expr
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
symbol_table_baset
The symbol table base class interface.
Definition: symbol_table_base.h:21
language.h
languaget::interfaces
virtual bool interfaces(symbol_tablet &symbol_table)
Definition: language.cpp:21
languaget::type_to_name
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