cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
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
16
bool
languaget::final
(
symbol_table_baset
&)
17
{
18
return
false
;
19
}
20
21
bool
languaget::interfaces
(
symbol_table_baset
&,
message_handlert
&)
22
{
23
return
false
;
24
}
25
26
void
languaget::dependencies
(
27
const
std::string &,
28
std::set<std::string> &)
29
{
30
}
31
32
bool
languaget::from_expr
(
33
const
exprt
&expr,
34
std::string &code,
35
const
namespacet
&)
36
{
37
code=expr.
pretty
();
38
return
false
;
39
}
40
41
bool
languaget::from_type
(
42
const
typet
&type,
43
std::string &code,
44
const
namespacet
&)
45
{
46
code=type.
pretty
();
47
return
false
;
48
}
49
50
bool
languaget::type_to_name
(
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
}
exprt
Base class for all expressions.
Definition
expr.h:57
irept::pretty
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
Definition
irep.cpp:482
languaget::final
virtual bool final(symbol_table_baset &symbol_table)
Final adjustments, e.g.
Definition
language.cpp:16
languaget::dependencies
virtual void dependencies(const std::string &module, std::set< std::string > &modules)
Definition
language.cpp:26
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::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
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
languaget::interfaces
virtual bool interfaces(symbol_table_baset &symbol_table, message_handlert &message_handler)
Definition
language.cpp:21
message_handlert
Definition
message.h:27
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition
namespace.h:91
symbol_table_baset
The symbol table base class interface.
Definition
symbol_table_base.h:23
typet
The type of an expression, extends irept.
Definition
type.h:29
expr.h
language.h
Abstract interface to support a programming language.
langapi
language.cpp
Generated by
1.17.0