-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterpreter.h
More file actions
69 lines (36 loc) · 950 Bytes
/
Interpreter.h
File metadata and controls
69 lines (36 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//Project 8 Interpreter
//Brian Coombs
//EE 312
#ifndef _INTERPRETER_H
#define _INTERPRETER_H
#include "String.h"
#include "ExpTree.h"
#include <map>
#include <stdint.h>
extern std::map<String, int> vars;
extern bool readingFromDoVector;
extern map<int, int> currentTokenInDoLoop;
extern vector<vector<String>> tokensLists;
extern int currentDoVector;
void run(void);
//Primary functions
void text(void);
void output(void);
void var(void);
void set(void);
void whileLoop(void);
void endWhile(void);
void checkComment(void);
void ifState(void);
void endIf(void);
void elseState(void);
//Helper functions
bool strCompare(String token, String exp);
ExpTree* createOrLoadExpTree(void);
bool checkValidKeyWord(void);
Node* createSymbolNode(void);
void createTokenLists();
void skipNestedIfsUntilLastFi();
bool skipUntilReachFiOrElse();
void printVars(map<String, int> vars);
#endif //PROJECT_8_INTERPRETER_A_INTERPRETER_H