MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
Loading...
Searching...
No Matches
types.hpp File Reference

Token, character, and operator type enumerations for the scanner. More...

#include <iostream>
#include <optional>
#include <string>
#include <vector>
Include dependency graph for types.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  types

Enumerations

enum class  types::TokenType {
  types::TT_ID , types::TT_ARG , types::TT_SYM , types::TT_STR ,
  types::TT_NUM , types::TT_HEX , types::TT_NULL
}
 Classification of scanned tokens. More...
enum class  types::CharType {
  types::TT_CHAR , types::TT_DIGIT , types::TT_SYMBOL , types::TT_STRING ,
  types::TT_SINGLE , types::TT_SPACE , types::TT_NULL
}
 Classification of individual characters during lexing. More...
enum class  types::OperatorType {
  types::OP_INC , types::OP_DEC , types::OP_LSHIFT_ASSIGN , types::OP_RSHIFT_ASSIGN ,
  types::OP_PLUS_ASSIGN , types::OP_MINUS_ASSIGN , types::OP_MUL_ASSIGN , types::OP_DIV_ASSIGN ,
  types::OP_MOD_ASSIGN , types::OP_AND_ASSIGN , types::OP_OR_ASSIGN , types::OP_XOR_ASSIGN ,
  types::OP_LSHIFT , types::OP_RSHIFT , types::OP_EQ , types::OP_NEQ ,
  types::OP_LE , types::OP_GE , types::OP_AND_AND , types::OP_OR_OR ,
  types::OP_ARROW , types::OP_PLUS , types::OP_MINUS , types::OP_MUL ,
  types::OP_DIV , types::OP_MOD , types::OP_ASSIGN , types::OP_AND ,
  types::OP_OR , types::OP_XOR , types::OP_NOT , types::OP_LT ,
  types::OP_GT , types::OP_LPAREN , types::OP_RPAREN , types::OP_LBRACKET ,
  types::OP_RBRACKET , types::OP_LBRACE , types::OP_RBRACE , types::OP_COMMA ,
  types::OP_SEMICOLON , types::OP_COLON , types::OP_DOT , types::OP_QUESTION ,
  types::OP_HASH , types::OP_SCOPE , types::OP_TILDE , types::OP_DOLLAR ,
  types::OP_AT
}
 Enumeration of all recognised operator symbols. More...
enum class  types::KeywordType {
  types::KW_LET , types::KW_PROC , types::KW_DEFINE , types::KW_IF ,
  types::KW_ELSE , types::KW_SWITCH , types::KW_WHILE , types::KW_FOR ,
  types::KW_RETURN , types::KW_BREAK , types::KW_CONTINUE
}
 Keyword type enumeration. More...

Functions

void types::print_type_TokenType (std::ostream &out, const TokenType &tt)
 Print a TokenType name to a stream.
void types::print_type_CharType (std::ostream &out, const CharType &c)
 Print a CharType name to a stream.
std::optional< OperatorType > types::lookUp (const std::string &op)
 Look up an operator string and return its OperatorType.
std::optional< KeywordType > types::lookUp_Keyword (const std::string &op)
 Look up a keyword string and return its KeywordType.

Variables

std::vector< std::string > types::opName
 Human-readable display names indexed by OperatorType.
std::vector< std::string > types::opStrings
 Operator string representations indexed by OperatorType.
std::vector< std::string > types::kwStr {"let", "proc", "define", "if", "else", "switch", "while", "for", "return", "break", "continue"}
 Keyword string representations indexed by KeywordType.
std::vector< std::string > types::strTokenType {"Identifier", "Argument", "Symbols", "String", "Numeric", "Hex", "NULL"}
 string names of TokenType values
std::vector< std::string > types::sstrCharType
 string names of CharType values

Detailed Description

Token, character, and operator type enumerations for the scanner.

Author
Jared Bruni

Definition in file types.hpp.