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

  1. The message file is parsed — $IMPORTed files as if they were inline. Directives update the current settings; each $MESSAGE takes a copy of them, so a setting affects only the messages after it.
  2. Whole-module checks run: translation checks (warnings) and consistency checks (errors).
  3. The header and the source are written — each only when its content changed, so an unchanged message file does not trigger a rebuild.

Contents

PartPages
The module$MODULE, $NAMESPACE, $INCLUDE, $USING, $IMPORT, $EXPORT, $LANGUAGE
Messages$MESSAGE, Parameters, Texts & locale selection
ArtefactsNaming & switching, $STRING, $STREAMABLE, $ERROR, $EXCEPTION, $THROW, $SYSLOG, Member functions
Generated codeFiles & 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:

ArtefactGenerates
$STRINGstd::string NotFoundStr( path ), NotFoundStr( path, loc )
$STREAMABLEclass NotFoundStreamable — std::cout << NotFoundStreamable( path )
$ERRORvoid NotFoundError( path ) — to std::cerr, then std::exit( EXIT_FAILURE )
$EXCEPTIONclass 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).