CBMC
mode.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_MODE_H
11 #define CPROVER_LANGAPI_MODE_H
12 
13 #include <util/irep.h>
14 
15 #include <memory> // unique_ptr
16 
17 class languaget;
18 class namespacet;
19 
20 std::unique_ptr<languaget> get_language_from_mode(const irep_idt &mode);
21 const irep_idt &
22 get_mode_from_identifier(const namespacet &ns, const irep_idt &identifier);
23 std::unique_ptr<languaget>
24 get_language_from_identifier(const namespacet &ns, const irep_idt &identifier);
25 std::unique_ptr<languaget> get_language_from_filename(
26  const std::string &filename);
27 std::unique_ptr<languaget> get_default_language();
28 
29 typedef std::unique_ptr<languaget> (*language_factoryt)();
31 
32 #endif // CPROVER_LANGAPI_MODE_H
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:38
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:94
std::unique_ptr< languaget > get_language_from_filename(const std::string &filename)
Get the language corresponding to the registered file name extensions.
Definition: mode.cpp:102
std::unique_ptr< languaget >(* language_factoryt)()
Definition: mode.h:29
void register_language(language_factoryt factory)
Register a language Note: registering a language is required for using the functions in language_util...
Definition: mode.cpp:39
std::unique_ptr< languaget > get_language_from_identifier(const namespacet &ns, const irep_idt &identifier)
Get the language corresponding to the mode of the given identifier's symbol.
Definition: mode.cpp:84
std::unique_ptr< languaget > get_language_from_mode(const irep_idt &mode)
Get the language corresponding to the given mode.
Definition: mode.cpp:51
std::unique_ptr< languaget > get_default_language()
Returns the default language.
Definition: mode.cpp:139
const irep_idt & get_mode_from_identifier(const namespacet &ns, const irep_idt &identifier)
Get the mode of the given identifier's symbol.
Definition: mode.cpp:66