|
Haio 0.2.X
Homebrew Asset IO/CDN
|
Namespaces | |
| namespace | Detail |
Classes | |
| struct | Rule |
| struct | Note |
| struct | Option |
| struct | Word |
Enumerations | |
| enum class | Opt { Size , Crop , CropRect , Resize , Radius , Format , PixFmt , Filter , Limit , Palette , Fx } |
Functions | |
| constexpr std::optional< Word > | optionOf (std::string_view token) |
Variables | |
| const auto | paren = x3::string("\\(") | x3::string("\\)") | x3::string("(") | x3::string(")") |
| const auto | singleQuoted = x3::lexeme['\'' >> *(x3::char_ - '\'') >> '\''] |
| const auto | doubleQuoted = x3::lexeme['"' >> *(('\\' >> x3::char_) | (x3::char_ - '"')) >> '"'] |
| const auto | word = x3::lexeme[+(x3::char_ - x3::space - '"' - '\'' - '(' - ')')] |
| const auto | arg = x3::raw[singleQuoted | doubleQuoted | paren | word] |
| const auto | cmdline = x3::skip(x3::space)[*arg] |
| constexpr std::array | ebnfRules |
| constexpr Option | options [] |
| constexpr std::string_view | generatorKinds [] = {"xc", "canvas", "gradient", "radial-gradient"} |
| constexpr auto | commandRules |
| constexpr std::array | notes |
| struct Haio::Cli::Lexer::Rule |
Definition at line 23 of file haio_cli_grammar.hpp.
| Class Members | ||
|---|---|---|
| string_view | expression | |
| string_view | name | |
| struct Haio::Cli::Lexer::Note |
Definition at line 28 of file haio_cli_grammar.hpp.
| Class Members | ||
|---|---|---|
| string_view | text | |
| struct Haio::Cli::Lexer::Option |
every option the convert line takes, and how many words follow each.
it is a table because the same facts were written down three times: as an if in the parser, as a rule in the grammar this file documents, and as a line in the usage text. three copies of one list is three chances to disagree, and they did – "--size" was in the grammar and in the usage and in neither branch of the parser, and "--palette=cga" went looking for its value in the next word along, because the equals sign was only ever matched against the spelling the error message used.
the count is the part that matters. reading an option is the same work whatever it means: take the words the table says it takes, from after an equals sign or from one along, and hand them to whoever knows what they are for. that last step is the only thing particular to the option, and it is all the parser's switch is left doing.
Definition at line 75 of file haio_cli_grammar.hpp.
| Class Members | ||
|---|---|---|
| int | args = 1 |
how many words follow it |
| bool | filter = true |
whether it is one of the filters, which is what the grammar calls the options that may repeat between the source and the output. -size is not one: it belongs to the generator that has to follow it. |
| string_view | help | |
| Opt | kind | |
| bool | optional = false |
... and whether it can do without them, which only -crop can |
| string_view | rule |
the name this option's rule has in the grammar |
| array< string_view, 4 > | spellings |
every spelling it answers to; the first is the one the usage text shows |
| string_view | takes |
and the rule the words after it have to match |
| struct Haio::Cli::Lexer::Word |
an option, the spelling it arrived as, and whatever an equals sign carried with it
Definition at line 150 of file haio_cli_grammar.hpp.

| Class Members | ||
|---|---|---|
| bool | hasValue = false | |
| const Option * | option = nullptr | |
| string_view | spelling | |
| string_view | value | |
|
strong |
which option a word turned out to name, so that a spelling is recognised once, by the table below, rather than by whichever branch of the parser gets to it first.
| Enumerator | |
|---|---|
| Size | |
| Crop | |
| CropRect | |
| Resize | |
| Radius | |
| Format | |
| PixFmt | |
| Filter | |
| Limit | |
| Palette | |
| Fx | |
Definition at line 45 of file haio_cli_grammar.hpp.
|
constexpr |
the option a word names, or nothing when it names none.
"-resize=8x8" and "-resize 8x8" are one thing said two ways, so the equals sign is split off here rather than inside each option's own branch: whoever matched a spelling by hand had to remember this too, and one of them did not.
Definition at line 164 of file haio_cli_grammar.hpp.

|
inline |
Definition at line 20 of file haio_cli_grammar.hpp.
|
inline |
Definition at line 21 of file haio_cli_grammar.hpp.
|
inlineconstexpr |
Definition at line 314 of file haio_cli_grammar.hpp.
|
inline |
Definition at line 18 of file haio_cli_grammar.hpp.
|
inlineconstexpr |
Definition at line 32 of file haio_cli_grammar.hpp.
|
inlineconstexpr |
the generators, which are a prefix on the source rather than an option of their own
Definition at line 181 of file haio_cli_grammar.hpp.
|
inlineconstexpr |
Definition at line 317 of file haio_cli_grammar.hpp.
|
inlineconstexpr |
Definition at line 103 of file haio_cli_grammar.hpp.
|
inline |
Definition at line 16 of file haio_cli_grammar.hpp.
|
inline |
Definition at line 17 of file haio_cli_grammar.hpp.
|
inline |
Definition at line 19 of file haio_cli_grammar.hpp.