file
CommonGrammar.hppGeneric, low-level grammar, re-used by specific grammars.
Contents
- Reference
Generic, low-level grammar. We use the Parsing Expression Grammar Template Library (PEGTL) to create the grammar and the associated parser.
Namespaces
Classes
-
template<template<class> class use>struct tk::grm::is_keyword
-
template<typename Rule>struct tk::grm::action
-
template<typename... As>struct tk::grm::call
- Helper for calling action::apply for multiple actions.
-
template<class rule, class... actions>struct tk::grm::act
- Rule used to trigger action(s) for a rule.
-
template<class rule, class... actions>struct tk::grm::action<act<rule, actions...>>
- struct tk::grm::msg
- Rule used to trigger action.
- struct tk::grm::action<msg<type, key>>
-
template<typename tag, typename... tags>struct tk::grm::Set
- Rule used to trigger action.
-
template<typename tag, typename... tags>struct tk::grm::action<Set<tag, tags...>>
-
template<typename tag, typename... tags>struct tk::grm::Store
- Rule used to trigger action.
-
template<typename tag, typename... tags>struct tk::grm::action<Store<tag, tags...>>
-
template<typename tag, typename... tags>struct tk::grm::Store_back
- Rule used to trigger action.
-
template<typename tag, typename... tags>struct tk::grm::action<Store_back<tag, tags...>>
-
template<typename tag, typename... tags>struct tk::grm::Store_back_bool
- Rule used to trigger action.
-
template<typename tag, typename... tags>struct tk::grm::action<Store_back_bool<tag, tags...>>
- Convert and push back a bool to vector of ints in state at position given by tags.
-
template<typename tag, typename... tags>struct tk::grm::Store_back_back
- Rule used to trigger action.
-
template<typename tag, typename... tags>struct tk::grm::action<Store_back_back<tag, tags...>>
- Convert and push back value to vector of back of vector in state at position given by tags.
-
template<typename tag, typename... tags>struct tk::grm::Store_back_back_back
- Rule used to trigger action.
-
template<typename tag, typename... tags>struct tk::grm::action<Store_back_back_back<tag, tags...>>
- Convert and push back value to vector of back of vector of back of vector in state at position given by tags.
-
template<typename... tags>struct tk::grm::Invert_switch
- Rule used to trigger action.
-
template<typename... tags>struct tk::grm::action<Invert_switch<tags...>>
-
template<template<class> class use, class Option, typename tag, typename... tags>struct tk::grm::store_back_option
- Rule used to trigger action.
-
template<template<class> class use, class Option, typename tag, typename... tags>struct tk::grm::action<store_back_option<use, Option, tag, tags...>>
-
template<template<class> class use, class Option, typename tag, typename... tags>struct tk::grm::store_back_back_option
- Rule used to trigger action.
-
template<template<class> class use, class Option, typename tag, typename... tags>struct tk::grm::action<store_back_back_option<use, Option, tag, tags...>>
- Push back option to vector of back of vector in state at position given by tags.
-
template<typename sel, typename vec, typename Tag, typename... Tags>struct tk::grm::insert_seed
- Rule used to trigger action.
-
template<typename sel, typename vec, typename Tag, typename... Tags>struct tk::grm::action<insert_seed<sel, vec, Tag, Tags...>>
- Convert and insert value to map at position given by tags.
-
template<template<class> class use, class Option, typename field, typename sel, typename vec, typename tag, typename... tags>struct tk::grm::insert_option
- Rule used to trigger action.
-
template<template<class> class use, class Option, typename field, typename sel, typename vec, typename tag, typename... tags>struct tk::grm::action<insert_option<use, Option, field, sel, vec, tag, tags...>>
- Convert and insert option value to map at position given by tags.
-
template<typename prec>struct tk::grm::store_precision
- Rule used to trigger action.
-
template<class prec>struct tk::grm::action<store_precision<prec>>
- Set numeric precision for ASCII output of floating-point values.
- struct tk::grm::helpkw
- Rule used to trigger action.
-
template<>struct tk::grm::action<helpkw>
- Find keyword among all keywords and if found, store the keyword and its info on which help was requested behind tag::
helpkw in Stack. -
template<typename push>struct tk::grm::match_depvar
- Rule used to trigger action.
-
template<class push>struct tk::grm::action<match_depvar<push>>
- Match depvar (dependent variable) to one of the selected ones.
- struct tk::grm::match_pdfname
- Rule used to trigger action.
-
template<>struct tk::grm::action<match_pdfname>
- Match PDF name to the registered ones.
-
template<template<class> class use, class Option, typename sel, typename vec, typename... tags>struct tk::grm::check_store_option
- Rule used to trigger action.
-
template<template<class> class use, class Option, typename sel, typename vec, typename... tags>struct tk::grm::action<check_store_option<use, Option, sel, vec, tags...>>
- Put option in state at position given by tags if among the selected.
- struct tk::grm::add_depvar
- Rule used to trigger action.
-
template<>struct tk::grm::action<add_depvar>
- Add depvar (dependent variable) to the selected ones.
-
template<class keyword, typename tag, typename... tags>struct tk::grm::check_lower_bound
- Rule used to trigger action.
-
template<class keyword, typename tag, typename... tags>struct tk::grm::action<check_lower_bound<keyword, tag, tags...>>
- Check if value is larger than lower bound.
-
template<class keyword, typename tag, typename... tags>struct tk::grm::check_upper_bound
- Rule used to trigger action.
-
template<class keyword, typename tag, typename... tags>struct tk::grm::action<check_upper_bound<keyword, tag, tags...>>
- Check if value is lower than upper bound.
-
template<typename tag, typename... tags>struct tk::grm::start_vector
- Rule used to trigger action.
-
template<class tag, class... tags>struct tk::grm::action<start_vector<tag, tags...>>
- Start new vector in vector.
-
template<typename tag, typename... tags>struct tk::grm::start_vector_back
- Rule used to trigger action.
-
template<class tag, class... tags>struct tk::grm::action<start_vector_back<tag, tags...>>
- Start new vector in back of a vector.
-
template<typename tk::struct tk::grm::push_term
ctr:: Moment, char var = '\0'> - Rule used to trigger action.
-
template<tk::struct tk::grm::action<push_term<m, var>>
ctr:: Moment m, char var> - Add matched value as Term into vector of vector of statistics.
-
template<tk::struct tk::grm::push_sample
ctr:: Moment m> - Rule used to trigger action.
-
template<tk::struct tk::grm::action<push_sample<m>>
ctr:: Moment m> - Add matched value as Term into vector of vector of PDFs.
- struct tk::grm::push_binsize
- Rule used to trigger action.
-
template<>struct tk::grm::action<push_binsize>
- Push matched value into vector of vector binsizes.
- struct tk::grm::push_extents
- Rule used to trigger action.
-
template<>struct tk::grm::action<push_extents>
- Push matched value into vector of PDF extents.
-
template<class eq, class param, class... xparam>struct tk::grm::check_vector
- Rule used to trigger action.
-
template<class eq, class param, class... xparam>struct tk::grm::action<check_vector<eq, param, xparam...>>
- Check parameter vector.
- struct tk::grm::noop
- Rule used to trigger action.
-
template<>struct tk::grm::action<noop>
- Action that does nothing.
-
template<class eq, class param, class... xparam>struct tk::grm::check_spikes
- Rule used to trigger action.
-
template<class eq, class param, class... xparam>struct tk::grm::action<check_spikes<eq, param, xparam...>>
-
template<class eq, class param, class... xparam>struct tk::grm::check_betapdfs
- Rule used to trigger action.
-
template<class eq, class param, class... xparam>struct tk::grm::action<check_betapdfs<eq, param, xparam...>>
-
template<class eq, class param, class... xparam>struct tk::grm::check_gammapdfs
- Rule used to trigger action.
-
template<class eq, class param, class... xparam>struct tk::grm::action<check_gammapdfs<eq, param, xparam...>>
-
template<class eq, class param, class... xparam>struct tk::grm::check_dirichletpdf
- Rule used to trigger action.
-
template<class eq, class param, class... xparam>struct tk::grm::action<check_dirichletpdf<eq, param, xparam...>>
-
template<class eq, class param, class... xparam>struct tk::grm::check_gaussians
- Rule used to trigger action.
-
template<class eq, class param, class... xparam>struct tk::grm::action<check_gaussians<eq, param, xparam...>>
- struct tk::grm::check_expectation
- Rule used to trigger action.
-
template<>struct tk::grm::action<check_expectation>
- Check if there is at least one variable in expectation.
- struct tk::grm::check_binsizes
- Rule used to trigger action.
-
template<>struct tk::grm::action<check_binsizes>
- Check if the number of binsizes equal the PDF sample space variables.
- struct tk::grm::check_extents
- Rule used to trigger action.
-
template<>struct tk::grm::action<check_extents>
- Check if the number of extents equal 2 * the PDF sample space variables.
- struct tk::grm::check_samples
- Rule used to trigger action.
-
template<>struct tk::grm::action<check_samples>
- Check if there is at least one sample space variable in PDF.
- struct tk::grm::save_field
- Rule used to trigger action.
-
template<>struct tk::grm::action<save_field>
- Save field ID to parser's state so push_
term can pick it up. -
template<typename Tag, typename... Tags>struct tk::grm::store_lua
- Rule used to trigger action.
-
template<typename Tag, typename... Tags>struct tk::grm::action<store_lua<Tag, Tags...>>
- Append character parsed in a lua ... end block to a string.
-
template<class token, class erased>struct tk::grm::trim
- Read 'token' until 'erased' trimming, i.e., not consuming, 'erased'.
- struct tk::grm::unknown
- Match unknown keyword and handle error.
-
template<class keyword>struct tk::grm::alias
-
template<class keyword>struct tk::grm::verbose
-
template<class token>struct tk::grm::readkw
- Read keyword 'token' padded by blank at left and space at right.
-
template<class keyword, typename = void>struct tk::grm::readcmd
-
template<class keyword>struct tk::grm::readcmd<keyword, typename if_<false, typename keyword::info::alias>::type>
-
template<class keyword, class... actions>struct tk::grm::scan
- Scan input padded by blank at left and space at right and if it matches 'keyword', apply 'actions'.
-
template<class keywords, class action, class end = pegtl::space>struct tk::grm::scan_until
- Scan input padded by blank at left and space at right and if it matches 'keywords', apply 'action'.
-
template<class keyword, class... actions>struct tk::grm::exact_scan
- Scan input padded by blank at left and space at right and if it exactly matches 'keyword', apply 'actions'.
- struct tk::grm::comment
- Parse comment: start with '#' until eol.
- struct tk::grm::ignore
- Ignore comments and empty lines.
- struct tk::grm::number
- Parse a number: an optional sign followed by digits.
-
template<class endkeyword, typename... tokens>struct tk::grm::block
- Plow through 'tokens' until 'endkeyword'.
- struct tk::grm::vector
-
template<class insert, char lbound = '"', char rbound = '"'>struct tk::grm::quoted
- Scan string between characters 'lbound' and 'rbound' and if matches apply action 'insert'.
-
template<class keyword, class insert, class kw_type = pegtl::digit>struct tk::grm::process
- Process 'keyword' and if matches, parse following token (expecting 'kw_type' and call 'insert' action on it.
-
template<class keyword, class... actions>struct tk::grm::process_alpha
- Process 'keyword' and if matches, parse following token (expecting pegtl::alpha and call zero or more actions on it.
-
template<template<class> class use, class keyword, class insert, class kw_type, class tag, class... tags>struct tk::grm::process_cmd
- Process command line 'keyword' and call its 'insert' action if matches 'kw_type'.
-
template<template<class> class use, class keyword, typename tag, typename... tags>struct tk::grm::process_cmd_switch
-
template<typename keywords, typename... ign>struct tk::grm::read_file
- Generic file parser entry point: parse 'keywords' and 'ignore' until end of file.
- struct tk::grm::charmarg
- Process but ignore Charm++'s charmrun arguments starting with '+'.
-
template<typename keywords>struct tk::grm::read_string
- Generic string parser entry point: parse 'keywords' until end of string.
-
template<template<class> class use, typename keyword, typename option, typename field, typename sel, typename vec, typename... tags>struct tk::grm::rng_option
-
template<typename var>struct tk::grm::fieldvar
- Match fieldvar: a character, denoting a variable, optionally followed by a digit.
- struct tk::grm::term
- Match term: upper or lowercase fieldvar matched to selected depvars for stats.
-
template<class c, tk::struct tk::grm::sample_space_var
ctr:: Moment m> - sample space variable: fieldvar matched to selected depvars
- struct tk::grm::samples
- Match samples: sample space variables optionally separated by fillers.