CBMC
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
mode.cpp File Reference
#include "mode.h"
#include <list>
#include <memory>
#include <set>
#include "language.h"
#include <util/invariant.h>
#include <util/namespace.h>
#include <util/symbol.h>
+ Include dependency graph for mode.cpp:

Go to the source code of this file.

Classes

struct   language_entryt
 

Typedefs

 

Functions

  Register a language Note: registering a language is required for using the functions in language_util.h.
 
std::unique_ptr< languagetget_language_from_mode (const irep_idt &mode)
  Get the language corresponding to the given mode.
 
  Get the mode of the given identifier's symbol.
 
std::unique_ptr< languagetget_language_from_identifier (const namespacet &ns, const irep_idt &identifier)
  Get the language corresponding to the mode of the given identifier's symbol.
 
std::unique_ptr< languagetget_language_from_filename (const std::string &filename)
  Get the language corresponding to the registered file name extensions.
 
std::unique_ptr< languagetget_default_language ()
  Returns the default language.
 

Variables

 

Typedef Documentation

◆  languagest

Definition at line 32 of file mode.cpp.

Function Documentation

◆  get_default_language()

std::unique_ptr< languaget > get_default_language ( )

Returns the default language.

Returns
the first registered language

Definition at line 139 of file mode.cpp.

◆  get_language_from_filename()

std::unique_ptr< languaget > get_language_from_filename ( const std::string &  filename )

Get the language corresponding to the registered file name extensions.

Parameters
filename a filename
Returns
the corresponding language or nullptr if the extension cannot be resolved to any registered language

Definition at line 102 of file mode.cpp.

◆  get_language_from_identifier()

std::unique_ptr< languaget > get_language_from_identifier ( const namespacetns,
const irep_idtidentifier 
)

Get the language corresponding to the mode of the given identifier's symbol.

Parameters
ns a namespace
identifier an identifier
Returns
the corresponding language if the mode is not ID_unknown, or the default language otherwise; Note: It is assumed as an invariant that languages of symbols in the symbol table have been registered.

Definition at line 84 of file mode.cpp.

◆  get_language_from_mode()

std::unique_ptr< languaget > get_language_from_mode ( const irep_idtmode )

Get the language corresponding to the given mode.

Parameters
mode the mode, e.g. ID_C
Returns
the language or nullptr if the language has not been registered

Definition at line 51 of file mode.cpp.

◆  get_mode_from_identifier()

const irep_idt & get_mode_from_identifier ( const namespacetns,
const irep_idtidentifier 
)

Get the mode of the given identifier's symbol.

Parameters
ns a namespace
identifier an identifier
Returns
the mode, e.g. ID_C, if the identifier is in the given symbol table, or ID_unknown otherwise

Definition at line 66 of file mode.cpp.

◆  register_language()

void register_language ( language_factoryt  factory )

Register a language Note: registering a language is required for using the functions in language_util.h.

Parameters
factory a language factory, e.g. new_ansi_c_language

Definition at line 39 of file mode.cpp.

Variable Documentation

◆  languages

languagest languages

Definition at line 33 of file mode.cpp.

AltStyle によって変換されたページ (->オリジナル) /