A compile-time validated pattern describing the accepted form of an algorithm specification. See AlgorithmSpec::match for how patterns are used.
Pattern grammar:
pattern := head [ '(' element (',' element)* ')' ] head := token ('|' token)* alternatives (aliases) | '' any head element := placeholder [ '...' ] '...' = one or more, must be last | literal a token which must appear | '[' literal ']' an optional literal, skipped if absent | token '(' element (',' element) ')' a literal with nested elements placeholder := '{' ident [':' type] ['=' default | '?'] '}' type := name | int | str default is name
A placeholder with a default ('=') or marked '?' is optional. Once an optional element appears, every following element must also be optional. Defaults are only permitted for int and str placeholders. An int must be a canonical decimal integer with no arguments; a str binds the text of the argument verbatim, including any nested arguments; a name binds the argument as a specification for passing on to another factory.
A '*' head matches any name, with AlgorithmMatch::head reporting which one. This is for provider wrappers which immediately look the head up in a table of supported algorithms; a factory pattern should always name its heads.
Patterns are only constructible from string literals, so a pattern and any match made from it may reference the pattern text indefinitely.
Definition at line 55 of file algorithm_spec.h.