This manual describes what mstring does with a message file — the semantics. The Language section is the syntax, with a railroad diagram per construct.
How a run works
- The message file is parsed —
$IMPORTed files as if they were inline. Directives update the current settings; each$MESSAGEtakes a copy of them, so a setting affects only the messages after it. - Whole-module checks run: translation checks (warnings) and consistency checks (errors).
- The header and the source are written — each only when its content changed, so an unchanged message file does not trigger a rebuild.
Contents
| Part | Pages |
|---|---|
| The module | $MODULE, $NAMESPACE, $INCLUDE, $USING, $IMPORT, $EXPORT, $LANGUAGE |
| Messages | $MESSAGE, Parameters, Texts & locale selection |
| Artefacts | Naming & switching, $STRING, $STREAMABLE, $ERROR, $EXCEPTION, $THROW, $SYSLOG, Member functions |
| Generated code | Files & layout, Text functions, Classes, INLINE modules |
| Diagnostics |
At a glance
For $MESSAGE NotFound with @ path std::string const &, and every artefact enabled with its default name:
| Artefact | Generates | |
|---|---|---|
$STRING | std::string NotFoundStr( path ), NotFoundStr( path, loc ) | |
$STREAMABLE | class NotFoundStreamable — std::cout << NotFoundStreamable( path ) | |
$ERROR | void NotFoundError( path ) — to std::cerr, then std::exit( EXIT_FAILURE ) | |
$EXCEPTION | class NotFoundException with What() and what() | |
$THROW | [[noreturn]] void ThrowNotFound( path ) | |
$SYSLOG | `void LogNotFound( path, int optionparameter = LOGUSER \ | LOG_INFO )` |
The generated code needs only the C++17 standard library (<syslog.h> for $SYSLOG).

