Defined in header <cparse/Parser.hh>
virtual std::string getGrammarName() const noexcept = 0;
Returns a short identifier for the grammar. Used by writeTraceMessage() and suitable for embedding in log lines.
Parameters
None.
Return value
A short string identifying the grammar. Anything that makes sense in logs — "fson", "csv-lite", "umtsm-input".
Exceptions
noexcept. Implementations should not throw.
Notes
This is one of only two = 0 methods on Parser; the other is start(). Both must be overridden by concrete grammars.
Example
class CsvParser : public fedem::parser::Parser
{
public:
std::string getGrammarName() const noexcept override { return "csv"; }
// ...
};
See also
- Parser::start — the other pure virtual.
- Parser::writeTraceMessage — writes the grammar name into trace output.

