mstring  1.3.1
Generates C++ message functions and classes from localized message definitions
MStringParser.hh File Reference

The message-definition grammar, a hand-written recursive-descent parser on top of cparse (replaces the former flex/bison front end). More...

#include <iosfwd>
#include <string>
#include <vector>
#include <cparse/Parser.hh>
#include "Module.hh"
#include "Settings.hh"
+ Include dependency graph for MStringParser.hh:
+ This graph shows which files directly or indirectly include this file:

Classes

struct  ParseContext
 State shared by the parser of the main file and the parsers of the files it $IMPORTs — an imported file changes the same settings and adds to the same module, exactly as if it were inline. More...
 
class  MStringParser
 
struct  MStringParser::Location
 
struct  MStringParser::Abort
 Thrown by error() after it recorded the diagnostic; caught in start(). More...
 

Functions

void CheckTranslations (ParseContext &context)
 Whole-module warnings, after parsing: a message that lacks a text in a language other messages have (it falls back to its default text), and a parameter one language's text uses and another's does not. More...
 

Detailed Description

The message-definition grammar, a hand-written recursive-descent parser on top of cparse (replaces the former flex/bison front end).

The input is line oriented. Outside a message only $DIRECTIVE lines, blank lines and # comments may appear. After $MESSAGE name come the @ name type parameter lines, then the texts: [language charset] set headers, ‘'single quoted’,"double quoted"and|bar` lines. The next directive ends the message. See docs/syntax.md for the full grammar.

Function Documentation

◆ CheckTranslations()

void CheckTranslations ( ParseContext &  context)

Whole-module warnings, after parsing: a message that lacks a text in a language other messages have (it falls back to its default text), and a parameter one language's text uses and another's does not.

References Message::Col, ParseContext::diagnostics, Message::File, LocaleMessage::Language, Message::Line, Message::Locales, Module::Messages, ParseContext::module, Parameter::Name, Message::Name, and Message::Parameters.

Referenced by main().

+ Here is the caller graph for this function: