stores the mapping of different keywords and types More...
#include <tokens.h>
Static Public Member Functions | |
static bool | isInIgnoreCharArr (const std::string &toCheck) |
checks if the passed in toCheck arg is an ignorable character | |
static bool | isInDIGITSarr (const std::string &toCheck) |
checks if the passed in toCheck arg is a digit | |
static bool | isInLETTERSarr (const std::string &toCheck) |
checks if the passed in toCheck arg is a letter | |
static bool | isInKEYWORDSarr (const std::string &toCheck) |
checks if the passed in toCheck arg is a keyword in the language | |
static std::string | tokentype (const int &index) |
gets the token which maps to the passed in index arg in std::string format | |
static bool | isOperatorNode (const std::string &nodeType) |
checks if the passed in nodeType arg is an operator node | |
Static Public Attributes | |
static const std::array< std::string, tokens::tokensArrSIZE > | tokensArr |
stores the various supported tokens such as +, - etc | |
static const std::array< char, tokens::ignoreCharArrSIZE > | ignoreCharArr = {' ', '\t', '\n'} |
stores ignorable characters such as ' ', \n etc | |
static const std::array< char, tokens::DIGITSSIZE > | DIGITS = {'.', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} |
stores range of all digits from 0 - 9 | |
static const std::array< std::string, tokens::KEYWORDSSIZE > | KEYWORDS |
stores the various keywords such number, for, while | |
static const std::array< char, tokens::LETTERSSIZE > | LETTERS |
stores all letters in the alphabet in upper and lower case and the underscore symbol '_' | |
static const std::array< std::string, tokens::visitNodesArrSIZE > | visitNodesArr |
stores which node type should be visited for the currently selected node(only used in parser.cpp and interpreterr.cpp) '_' | |
Static Private Attributes | |
static const int | tokensArrSIZE = 33 |
the sizes of the arrays which store all of the languages tokens and keywords | |
static const int | ignoreCharArrSIZE = 3 |
static const int | DIGITSSIZE = 11 |
static const int | KEYWORDSSIZE = 14 |
static const int | LETTERSSIZE = 53 |
static const int | visitNodesArrSIZE = 34 |
stores the mapping of different keywords and types
includes Exceptions for classes that may include tokens
handles the creation of tokens when reading the program file