P4C
The P4 Compiler
|
Public Member Functions | |
Token (Kind kind) noexcept | |
Token (Kind kind, const char *beg, const char *end) noexcept | |
Token (Kind kind, const char *beg, std::size_t len) noexcept | |
bool | is (Kind kind) const noexcept |
bool | isNot (Kind kind) const noexcept |
bool | isOneOf (Kind k1, Kind k2) const noexcept |
Functions for multiple comparison kind. | |
template<typename... Ts> | |
bool | isOneOf (Kind k1, Kind k2, Ts... ks) const noexcept |
Kind | kind () const noexcept |
The function to get kind from token. | |
void | kind (Kind kind) noexcept |
The function to replace the token kind with another kind. | |
std::string_view | lexeme () const noexcept |
The function to get lexeme from token. | |
void | lexeme (std::string_view lexeme) noexcept |
The function to replace the token lexeme with another lexeme. | |
Public Attributes | |
Kind | m_kind {} |
std::string_view | m_lexeme {} |
|
nodiscardnoexcept |
Kind comparison function. Allows you to compare token kind with the specified kind and return bool values, replacement for ==
|
nodiscardnoexcept |
Kind comparison function. Allows you to compare token kind with the specified kind and return bool values, replacement for !=