#include "mode.h"
#include <list>
#include <memory>
#include <set>
#include "language.h"
#include <util/invariant.h>
#include <util/namespace.h>
#include <util/symbol.h>
Go to the source code of this file.
◆ languagest
◆ 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
-
- 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()
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()
Get the language corresponding to the given mode.
- Parameters
-
- Returns
- the language or
nullptr
if the language has not been registered
Definition at line 51 of file mode.cpp.
◆ get_mode_from_identifier()
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()
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.
◆ languages