cprover
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 #include <util/symbol.h>
16 #include <util/symbol_table.h>
17 #include <util/prefix.h>
18 #include <util/cprover_prefix.h>
19 #include <util/std_types.h>
20 
22 {
23  return false;
24 }
25 
27 {
28  return false;
29 }
30 
32  const std::string &,
33  std::set<std::string> &)
34 {
35 }
36 
38  const exprt &expr,
39  std::string &code,
40  const namespacet &)
41 {
42  code=expr.pretty();
43  return false;
44 }
45 
47  const typet &type,
48  std::string &code,
49  const namespacet &)
50 {
51  code=type.pretty();
52  return false;
53 }
54 
56  const typet &type,
57  std::string &name,
58  const namespacet &)
59 {
60  // probably ansi-c/type2name could be used as better fallback if moved to
61  // util/
62  name=type.pretty();
63  return false;
64 }
symbol_tablet
The symbol table.
Definition: symbol_table.h:20
typet
The type of an expression, extends irept.
Definition: type.h:29
irept::pretty
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
Definition: irep.cpp:488
prefix.h
languaget::final
virtual bool final(symbol_table_baset &symbol_table)
Final adjustments, e.g.
Definition: language.cpp:21
exprt
Base class for all expressions.
Definition: expr.h:53
expr.h
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:92
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:46
languaget::dependencies
virtual void dependencies(const std::string &module, std::set< std::string > &modules)
Definition: language.cpp:31
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:37
symbol_table_baset
The symbol table base class interface.
Definition: symbol_table_base.h:22
std_types.h
Pre-defined types.
language.h
Abstract interface to support a programming language.
symbol.h
Symbol table entry.
cprover_prefix.h
languaget::interfaces
virtual bool interfaces(symbol_tablet &symbol_table)
Definition: language.cpp:26
symbol_table.h
Author: Diffblue Ltd.
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:55