Loading...
Searching...
No Matches
+ Include dependency graph for mode.cpp:
Go to the source code of this file.
Register a language Note: registering a language is required for using the functions in
language_util.h.
Get the language corresponding to the given mode.
Get the mode of the given identifier's symbol.
Get the language corresponding to the mode of the given identifier's symbol.
Get the language corresponding to the registered file name extensions.
Returns the default language.
Typedef Documentation
◆ languagest
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()
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
-
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()
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.
Variable Documentation
◆ languages