cprover
languages.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@cs.cmu.edu
6 
7 \*******************************************************************/
8 
9 
10 #ifndef CPROVER_LANGAPI_LANGUAGES_H
11 #define CPROVER_LANGAPI_LANGUAGES_H
12 
13 #include <util/language.h>
14 
16 {
17 public:
18  // conversion of expressions
19 
20  bool from_expr(const exprt &expr, std::string &code)
21  {
22  return language->from_expr(expr, code, ns);
23  }
24 
25  bool from_type(const typet &type, std::string &code)
26  {
27  return language->from_type(type, code, ns);
28  }
29 
30  bool to_expr(
31  const std::string &code,
32  const std::string &module,
33  exprt &expr)
34  {
35  return language->to_expr(code, module, expr, ns);
36  }
37 
38  // constructor / destructor
39 
40  languagest(const namespacet &_ns, languaget *_language);
41  virtual ~languagest();
42 
43 protected:
44  const namespacet &ns;
46 };
47 
48 #endif // CPROVER_LANGAPI_LANGUAGES_H
The type of an expression.
Definition: type.h:20
languaget * language
Definition: languages.h:45
virtual ~languagest()
Definition: languages.cpp:17
bool from_expr(const exprt &expr, std::string &code)
Definition: languages.h:20
virtual bool to_expr(const std::string &code, const std::string &module, exprt &expr, const namespacet &ns)=0
TO_BE_DOCUMENTED.
Definition: namespace.h:62
Abstract interface to support a programming language.
bool to_expr(const std::string &code, const std::string &module, exprt &expr)
Definition: languages.h:30
virtual bool from_type(const typet &type, std::string &code, const namespacet &ns)
Definition: language.cpp:41
const namespacet & ns
Definition: languages.h:44
Base class for all expressions.
Definition: expr.h:46
languagest(const namespacet &_ns, languaget *_language)
Definition: languages.cpp:12
bool from_type(const typet &type, std::string &code)
Definition: languages.h:25
virtual bool from_expr(const exprt &expr, std::string &code, const namespacet &ns)
Definition: language.cpp:32