Command line and input file parsing and grammars for all executables.
This directory contains parsing-related functionality for all executables. It has multiple grammar definitions for
- command line parsers for all executables, in subdirectories
- input file parsers for those executables that take an input file, in subdirectories
Grammar definitions are defined using the Parsing Expression Grammar Template Library (PEGTL) according to Parsing Expression Grammar (PEG). As the PEGTL documentation describes
Grammars are written as regular C++ code, created with template programming (not template meta programming), i.e. nested template instantiations that naturally correspond to the inductive definition of PEGs (and other parser-combinator approaches).
Grammars are thus written purely in C++ and the compiler generates the parsers using PEGTL.
CommonGrammar.h defines the smallest building blocks of all grammars. It contains generic functions that are reused among multiple command line and input file grammars.
The state (or stack) of the grammar is a tagged tuple (tk::
src/Control/<executable>/Types.h declare the types of the components of a grammar's state. The components are usually also tuples to nest multiple levels of hierarchies, to group related information together.
Control.h defines a generic base class, tk::
Tags.h defines empty structs that are used as labels during compile time. These labels are used to index into tagged tuples.
Keywords.h defines all keywords accepted by all parsers together with their documentation.
Toggle.h defines a generic switch with multiple states, from which specialized switches derive. Directories
<executable>/Options define specific switches, specializing a tk::
<executable>, e.g., UnitTest.
- directory FileConv/
- Types, command line parsing, and grammar for FileConv
- directory Inciter/
- Types, options, command line parsing, and grammar for Inciter
- directory MeshConv/
- Types, command line parsing, and grammar for MeshConv
- directory Options/
- Options for multiple executables.
- directory RNGTest/
- Types, options, command line parsing, and grammar for RNGTest
- directory UnitTest/
- Types, command line parsing, and grammar for UnitTest
- directory Walker/
- Types, options, command line parsing, and grammar for Walker
- file CommonGrammar.hpp
- Generic, low-level grammar, re-used by specific grammars.
- file Control.hpp
- Control base contains generic accessors to tagged tuple elements.
- file FileParser.cpp
- File parser base class definition.
- file FileParser.hpp
- File parser base class declaration.
- file HelpFactory.hpp
- Command-line and input deck help factory.
- file Keyword.hpp
- Generic definition of a keyword.
- file Keywords.hpp
- Definition of all keywords.
- file MKLGrammar.hpp
- Intel MKL-related grammar.
- file Random123Grammar.hpp
- Random123-related grammar.
- file RNGParam.hpp
- Types for storing parameters of random number generators.
- file RNGSSEGrammar.hpp
- RNGSSE-related grammar.
- file StatCtr.hpp
- Types and associated functions to deal with moments and PDFs.
- file StringParser.cpp
- String parser base class definition.
- file StringParser.hpp
- String parser base class declaration.
- file SystemComponents.hpp
- Operations on numbers of scalar components of systems of equations.
- file Tags.hpp
- file Toggle.hpp
- Toggle is the base for an Option, doing generic searches.