10#include "../Exceptions/Exceptions.h"
127 const static std::array<std::string, tokens::tokensArrSIZE>
tokensArr;
137 const static std::array<char, tokens::DIGITSSIZE>
DIGITS;
142 const static std::array<std::string, tokens::KEYWORDSSIZE>
KEYWORDS;
147 const static std::array<char, tokens::LETTERSSIZE>
LETTERS;
152 const static std::array<std::string, tokens::visitNodesArrSIZE>
visitNodesArr;
187 static std::string
tokentype(
const int& index);
KEYWRODSTYPE
mapping of supported keywords
Definition tokens.h:95
@ DISPLAYLINE
Definition tokens.h:100
@ PRINTNEWLINE
Definition tokens.h:99
@ IF
Definition tokens.h:102
@ WHILE
Definition tokens.h:106
@ FUNCTION__DECL
Definition tokens.h:108
@ STRINGKEY
Definition tokens.h:97
@ ELSEIF
Definition tokens.h:103
@ ELSE
Definition tokens.h:104
@ FUNCTION__CALL
Definition tokens.h:109
@ FOR
Definition tokens.h:107
@ THEN
Definition tokens.h:105
@ PRINTLINE
Definition tokens.h:98
@ DISPLAYNEWLINE
Definition tokens.h:101
@ NUMBERKEY
Definition tokens.h:96
VISITNODES
mapping of different types nodes(interpreterr.cpp uses this)
Definition tokens.h:54
@ IFSTATEMENTNODE
Definition tokens.h:77
@ OPNODELESSTHANOREQUALTO
Definition tokens.h:74
@ OPNODEMINUS
Definition tokens.h:56
@ OPNODEEQUALSEQUALS
Definition tokens.h:70
@ FUNCTIONDECLARATION
Definition tokens.h:88
@ OPNODELESSTHAN
Definition tokens.h:72
@ OPNODEDIVIDE
Definition tokens.h:58
@ OPNODENOT
Definition tokens.h:67
@ OPNODEPLUS
Definition tokens.h:55
@ OPNODEMULTIPLY
Definition tokens.h:57
@ OPNODEMODULUS
Definition tokens.h:69
@ FORSTATEMENT
Definition tokens.h:87
@ OPNODEMINUSEQUALS
Definition tokens.h:82
@ STRINGNODE
Definition tokens.h:65
@ OPNODEMULTIPLYEQUALS
Definition tokens.h:83
@ OPNODENOTEQUALTO
Definition tokens.h:75
@ NULLPTRNODE
Definition tokens.h:89
@ WHILESTATEMENT
Definition tokens.h:80
@ NUMBERVARNODE
Definition tokens.h:63
@ BUITINFUNCTION
Definition tokens.h:76
@ POWEROPNODE
Definition tokens.h:62
@ OPNODEPLUSEQUALS
Definition tokens.h:81
@ STRINGVARNODE
Definition tokens.h:64
@ PLUSUNARYOPNODE
Definition tokens.h:60
@ OPNODEDIVIDEEQUALS
Definition tokens.h:84
@ ELSESTATEMENT
Definition tokens.h:79
@ ELSEIFSTATEMENTNODE
Definition tokens.h:78
@ OPNODEGREATERTHANOREQUALTO
Definition tokens.h:73
@ MINUSUNARYOPNODE
Definition tokens.h:61
@ OPNODEAND
Definition tokens.h:66
@ NUMBERNODE
Definition tokens.h:59
@ OPNODEGREATERTHAN
Definition tokens.h:71
@ OPNODEOR
Definition tokens.h:68
@ OPNODEMODULUSEQUALS
Definition tokens.h:85
@ OPNODEPOWEREQUALS
Definition tokens.h:86
TOKENS
mapping of different types of supported tokens
Definition tokens.h:15
@ NOT
Definition tokens.h:29
@ DIVIDE
Definition tokens.h:20
@ ENDLOCALSCOPE
Definition tokens.h:39
@ FORLOOPSEP
Definition tokens.h:46
@ KEYWORD
Definition tokens.h:25
@ NUMBER
Definition tokens.h:16
@ MODULUS
Definition tokens.h:31
@ RPAREN
Definition tokens.h:22
@ POWER
Definition tokens.h:23
@ LPAREN
Definition tokens.h:21
@ FUNCARGSEP
Definition tokens.h:47
@ MINUSEQUALS
Definition tokens.h:41
@ GREATERTHAN
Definition tokens.h:33
@ POWEREQUALS
Definition tokens.h:45
@ BEGINLOCALSCOPE
Definition tokens.h:38
@ LESSTHANOREQUALTO
Definition tokens.h:36
@ PLUSEQUALS
Definition tokens.h:40
@ GREATERTHANOREQUALTO
Definition tokens.h:35
@ EQUALSEQUALS
Definition tokens.h:32
@ IDENTIFIER
Definition tokens.h:24
@ AND
Definition tokens.h:28
@ PLUS
Definition tokens.h:17
@ LESSTHAN
Definition tokens.h:34
@ DIVIDEEQUALS
Definition tokens.h:43
@ EQUALS
Definition tokens.h:26
@ OR
Definition tokens.h:30
@ NOTEQUALTO
Definition tokens.h:37
@ MULTIPLYEQUALS
Definition tokens.h:42
@ MODULUSEQUALS
Definition tokens.h:44
@ NULLNODE
Definition tokens.h:48
@ MULTIPLY
Definition tokens.h:19
@ STRING
Definition tokens.h:27
@ MINUS
Definition tokens.h:18
static bool isInDIGITSarr(const std::string &toCheck)
checks if the passed in toCheck arg is a digit
Definition tokens.cpp:40
static const int LETTERSSIZE
Definition tokens.h:121
static const std::array< std::string, tokens::tokensArrSIZE > tokensArr
stores the various supported tokens such as +, - etc
Definition tokens.h:127
static bool isInKEYWORDSarr(const std::string &toCheck)
checks if the passed in toCheck arg is a keyword in the language
Definition tokens.cpp:54
static const std::array< char, tokens::DIGITSSIZE > DIGITS
stores range of all digits from 0 - 9
Definition tokens.h:137
static const int KEYWORDSSIZE
Definition tokens.h:120
static const int tokensArrSIZE
the sizes of the arrays which store all of the languages tokens and keywords
Definition tokens.h:120
static const int ignoreCharArrSIZE
Definition tokens.h:120
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....
Definition tokens.h:152
static std::string tokentype(const int &index)
gets the token which maps to the passed in index arg in std::string format
Definition tokens.cpp:74
static const std::array< std::string, tokens::KEYWORDSSIZE > KEYWORDS
stores the various keywords such number, for, while
Definition tokens.h:142
static bool isInLETTERSarr(const std::string &toCheck)
checks if the passed in toCheck arg is a letter
Definition tokens.cpp:47
static const std::array< char, tokens::LETTERSSIZE > LETTERS
stores all letters in the alphabet in upper and lower case and the underscore symbol '_'
Definition tokens.h:147
static const std::array< char, tokens::ignoreCharArrSIZE > ignoreCharArr
stores ignorable characters such as ' ', \n etc
Definition tokens.h:132
static bool isInIgnoreCharArr(const std::string &toCheck)
checks if the passed in toCheck arg is an ignorable character
Definition tokens.cpp:33
static const int DIGITSSIZE
Definition tokens.h:120
static bool isOperatorNode(const std::string &nodeType)
checks if the passed in nodeType arg is an operator node
Definition tokens.cpp:61
static const int visitNodesArrSIZE
Definition tokens.h:121
stores the mapping of different keywords and types
Definition tokens.h:115
int type
number used to represent token type in enums
Definition tokens.h:205
std::string __represent__() const
returns a string representation of the the type and value class member variables
Definition tokens.cpp:79
std::string value
can be none if the no value is assigned, eg plus or minus operations
Definition tokens.h:210
creates an object with the mapping of a token that was assigned to it from the 'tokens' class
Definition tokens.h:200