|
| constexpr std::string_view | substr_to (std::string_view str, auto token) |
| | A substr of str up to the first occurrence of token, or the entirety of str if token is not found.
|
| |
| constexpr std::string_view | substr_to (std::string_view str, std::invocable< char > auto pred) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. A substr of str up to the first character that satisfies pred, or the entirety of str if pred is never satisfied In essence, performs 'take while not' (a.k.a. 'take until')
|
| |
| constexpr std::string_view | substr_past (std::string_view str, auto what) |
| | A substr of str past all characters satisfying pred In essence, performs 'drop while'.
|
| |
| template<std::size_t N> |
| constexpr auto | make_rev_size_sorted (const std::string_view(&arr)[N]) |
| |
| constexpr bool | is_strlike_prefix (std::string_view str) |
| | Whether the entirety of str is a strlike-prefix See Token::Kind::StringLiteral for details.
|
| |
| constexpr bool | is_int_suffix (std::string_view str) |
| | Whether the entirety of str is an integer-suffix See Token::Kind::IntLiteral for details.
|
| |
| constexpr auto | is_ident_like () |
| | Returns a functor to check for an identifier for a stream of characters Does not verify whether the ident is a reserved token or not. See Token::Kind::Identifier for details.
|
| |
| constexpr auto | digit_or_sep (char c) |
| | Exactly as named. Sep = '.
|
| |
| constexpr auto | xdigit_or_sep (char c) |
| | Exactly as named. Sep = '.
|
| |
| template<Token::Kind Kind> |
| constexpr bool | matches (const Stream &stream) |
| | Check whether the start of stream matches a token kind Assumes that there is no leading whitespace in stream
|
| |
| template<> |
| constexpr bool | matches< StringLiteral > (const Stream &stream) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Whether the start of stream is a string literal token See Token::Kind::StringLiteral for details.
|
| |
| template<> |
| constexpr bool | matches< RawStringLiteral > (const Stream &stream) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Whether the start of stream is a raw string literal token See Token::Kind::RawStringLiteral for details.
|
| |
| template<> |
| constexpr bool | matches< CharLiteral > (const Stream &stream) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Whether the start of stream is a char literal token See Token::Kind::CharLiteral for details.
|
| |
| template<> |
| constexpr bool | matches< BoolLiteral > (const Stream &stream) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. See Token::Kind::BoolLiteral for details.
|
| |
| template<> |
| constexpr bool | matches< IntBinLiteral > (const Stream &stream) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Whether the start of stream is a binary integer literal token See Token::Kind::IntBinLiteral for details.
|
| |
| template<> |
| constexpr bool | matches< IntHexLiteral > (const Stream &stream) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Whether the start of stream is a hexadecimal integer literal token See Token::Kind::IntHexLiteral for details.
|
| |
| template<> |
| constexpr bool | matches< IntOctLiteral > (const Stream &stream) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Whether the start of stream is an octal integer literal token See Token::Kind::IntOctLiteral for details.
|
| |
| template<> |
| constexpr bool | matches< IntDecLiteral > (const Stream &stream) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Whether the start of stream is a decimal integer literal token Written in terms of other int literals. See Token::Kind::IntDecLiteral for details.
|
| |
| template<> |
| constexpr bool | matches< FloatHexLiteral > (const Stream &stream) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Whether the start of stream is a hexadecimal floating point literal token See Token::Kind::FloatLiteral for details.
|
| |
| template<> |
| constexpr bool | matches< FloatLiteral > (const Stream &stream) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Whether the start of stream is a floating point literal token See Token::Kind::FloatLiteral for details.
|
| |
| template<> |
| constexpr bool | matches< Identifier > (const Stream &stream) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Whether the start of stream is an identifier token See Token::Kind::Identifier for details.
|
| |
| template<> |
| constexpr bool | matches< Grouping > (const Stream &stream) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Whether the start of stream is an identifier token See Token::Kind::Identifier for details.
|
| |
| template<> |
| constexpr bool | matches< BinaryOperator > (const Stream &stream) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Whether the start of stream is a binary operator token See Token::Kind::BinaryOperator for details.
|
| |
| template<> |
| constexpr bool | matches< Operator > (const Stream &stream) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Whether the start of stream is an operator token See Token::Kind::Operator for details.
|
| |
| template<Token::Kind Kind> |
| constexpr std::string_view | test_parse (std::string_view str) |
| |
| template<Token::Kind Kind> |
| constexpr std::string_view | parse (Stream &stream) |
| | Parse the token of Kind from the start of the stream. Assumes that the stream actually starts with a token of Kind. (Check with match)
|
| |
| template<> |
| constexpr std::string_view | parse< StringLiteral > (Stream &stream) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. See Token::Kind::StringLiteral for details.
|
| |
Recursive descent parser implementation details.