Haio 0.2.X
Homebrew Asset IO/CDN
Loading...
Searching...
No Matches
Haio::Cli::Lexer::Detail Namespace Reference

Functions

consteval void alternative (std::string &out, size_t &lineStart, std::string_view piece)
consteval std::string_view quotedList (auto &&spellings)
consteval std::string_view expressionOf (const Option &option)
consteval auto optionRules ()
consteval std::string_view filterAlternation ()
consteval std::string_view formatAlternation ()
consteval std::string_view colorAlternation ()
template<size_t A, size_t B, size_t C>
consteval auto joined (const std::array< Rule, A > &a, const std::array< Rule, B > &b, const std::array< Rule, C > &c)

Variables

constexpr std::array structureRules
constexpr std::array leafRules

Function Documentation

◆ alternative()

void Haio::Cli::Lexer::Detail::alternative ( std::string & out,
size_t & lineStart,
std::string_view piece )
consteval

an alternation, broken across lines wherever one would run too wide to read

Definition at line 186 of file haio_cli_grammar.hpp.

Here is the call graph for this function:

◆ colorAlternation()

std::string_view Haio::Cli::Lexer::Detail::colorAlternation ( )
consteval

and every name a colour answers to, which is the enum plus the borrowed spellings

Definition at line 262 of file haio_cli_grammar.hpp.

Here is the call graph for this function:

◆ expressionOf()

std::string_view Haio::Cli::Lexer::Detail::expressionOf ( const Option & option)
consteval

'( "-resize" | "--resize" | "--size" ) , size', which is an option's whole grammar

Definition at line 210 of file haio_cli_grammar.hpp.

Here is the call graph for this function:

◆ filterAlternation()

std::string_view Haio::Cli::Lexer::Detail::filterAlternation ( )
consteval

the filters, named rather than spelled out, which is what { filter } stands for

Definition at line 236 of file haio_cli_grammar.hpp.

Here is the call graph for this function:

◆ formatAlternation()

std::string_view Haio::Cli::Lexer::Detail::formatAlternation ( )
consteval

every name the Format enum answers to, straight off the enum.

the list used to be written out by hand, which is how the grammar came to offer "etc1" and "rgb565" as containers long after they had stopped being any such thing. the parser has always asked the enum; now the page that documents it does too.

Definition at line 252 of file haio_cli_grammar.hpp.

Here is the call graph for this function:

◆ joined()

template<size_t A, size_t B, size_t C>
auto Haio::Cli::Lexer::Detail::joined ( const std::array< Rule, A > & a,
const std::array< Rule, B > & b,
const std::array< Rule, C > & c )
consteval

Definition at line 275 of file haio_cli_grammar.hpp.

Here is the call graph for this function:

◆ optionRules()

auto Haio::Cli::Lexer::Detail::optionRules ( )
consteval

one rule per option, off the table rather than beside it

Definition at line 227 of file haio_cli_grammar.hpp.

Here is the call graph for this function:

◆ quotedList()

std::string_view Haio::Cli::Lexer::Detail::quotedList ( auto && spellings)
consteval

Definition at line 199 of file haio_cli_grammar.hpp.

Here is the call graph for this function:

Variable Documentation

◆ leafRules

std::array Haio::Cli::Lexer::Detail::leafRules
inlineconstexpr
Initial value:
= {
Rule{"format-name", formatAlternation()},
Rule{"colour-name", colorAlternation()},
Rule{"dither-name", R"("nearest" | "bayer" | "floyd" | "strict")"},
Rule{"limit-spec", R"(( "sort" | "spread" ) , ":" , integer)"},
Rule{"palette-spec", R"(palette-name , [ ":" , range , { "," , range } ])"},
Rule{"range", R"(integer , [ ".." , integer ])"},
Rule{"size", R"(integer , ( "x" | "X" ) , integer | integer , ( "%" | "pct" ))"},
Rule{"crop-geometry", R"(integer , ( "x" | "X" ) , integer , [ signed-integer , signed-integer ])"},
Rule{"rect", R"(integer , "," , integer , "," , integer , "," , integer)"},
Rule{"integer", "digit , { digit }"},
Rule{"signed-integer", R"(( "+" | "-" ) , integer)"},
}
consteval std::string_view formatAlternation()
consteval std::string_view colorAlternation()

and the words the options take, which is the part no table can say either

Definition at line 298 of file haio_cli_grammar.hpp.

◆ structureRules

std::array Haio::Cli::Lexer::Detail::structureRules
inlineconstexpr
Initial value:
= {
Rule{"convert-command", R"("convert" , source , { filter } , output)"},
Rule{"source", "file-spec | generator"},
Rule{"output", "file-spec"},
Rule{"file-spec", R"([ format-name , ":" ] , path)"},
Rule{"path", "arg"},
Rule{"generator", "size-option , generator-source"},
Rule{"generator-source", R"(generator-kind , ":" , generator-value)"},
Rule{"generator-kind", quotedList(generatorKinds)},
Rule{"filter", filterAlternation()},
}
consteval std::string_view filterAlternation()
consteval std::string_view quotedList(auto &&spellings)
constexpr std::string_view generatorKinds[]

the shape of the line, which is the part no table can say

Definition at line 285 of file haio_cli_grammar.hpp.