template<typename Info, typename>
kw::keyword struct

Generic definition of a keyword.

A keyword is a struct that collects the information that makes up a keyword. The requirement on the first template argument, Info, is that it must define the name(), shortDescription(,) and longDescription() member functions returning compile-time (static) std::strings. The shortDescription() member function is used to return a short description of what the keyword is used for, while the longDescription() member function is used for a longer, e.g., a paragraph-long, description on what the keyword can be used for and how it can and should be used. The last template parameter is a pegtl string, a list of character constants, specifying the case-sensitive characters that make up the keyword, which is then matched by the parser. The keyword must be at least one character long, but otherwise its length is only limited by the compiler's recursion handling capability of variadic templates. While the name(), shortDescription() and longDescription() member functions of Info are required, there are also optional ones, such as Info::exptect::description(), which, if defined, must also be static and must return a std::string, describing the type the particular keyword expects during parsing. This is optional since not every keyword expects a value (or values) of a particular type. For example, the keyword 'end' is simply used to close a block in the input file, and what follows does not have a relationship to the keyword. A counterexample is is 'title', which expects a double-quoted string immediately after the keyword title'.