10 std::vector<std::string>
strTokenType{
"Identifier",
"Argument",
"Symbols",
"String",
"Numeric",
"Hex",
"NULL"};
11 std::vector<std::string>
strCharType{
"Characters",
"Digits",
"Symbols",
"String",
"Quote",
"Space",
"NULL"};
14 unsigned int t_type =
static_cast<unsigned int>(tt);
20 unsigned int t_type =
static_cast<unsigned int>(c);
25 std::optional<OperatorType>
lookUp(
const std::string &op) {
26 for (
size_t i = 0; i <
opStrings.size(); ++i) {
34 for (
size_t i = 0; i <
kwStr.size(); ++i) {
std::optional< OperatorType > lookUp(const std::string &op)
Look up an operator string and return its OperatorType.
KeywordType
Keyword type enumeration.
std::vector< std::string > strTokenType
string names of TokenType values
TokenType
Classification of scanned tokens.
std::vector< std::string > kwStr
Keyword string representations indexed by KeywordType.
std::vector< std::string > opStrings
Operator string representations indexed by OperatorType.
std::optional< KeywordType > lookUp_Keyword(const std::string &op)
Look up a keyword string and return its KeywordType.
OperatorType
Enumeration of all recognised operator symbols.
void print_type_CharType(std::ostream &out, const CharType &c)
Print a CharType name to a stream.
std::vector< std::string > strCharType
void print_type_TokenType(std::ostream &out, const TokenType &tt)
Print a TokenType name to a stream.
CharType
Classification of individual characters during lexing.
Token, character, and operator type enumerations for the scanner.