-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLine.hpp
More file actions
executable file
·32 lines (25 loc) · 820 Bytes
/
Line.hpp
File metadata and controls
executable file
·32 lines (25 loc) · 820 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
#ifndef _LINE_HPP
#define _LINE_HPP
#include "Statement.hpp"
#include <string>
#include <iostream>
#include "DataStructures/PriorityQueue.hpp"
#include "Operator.hpp"
#include "Tokenizer.hpp"
#include "Variable.hpp"
class Line : public Statement {
protected:
std::string line;
private:
Variable* evaluateRecursive(PriorityQueue<Operator>& opQueue, SinglyLinkedList<std::string>& tokens, VariableHashMap& variables, int min, int max, int scope);
void evaluate(std::string& line, VariableHashMap& variables, Variable** rtn);
public:
Line(std::string ln, VariableHashMap& vars, int scope) : line(ln), Statement(vars, scope, Statement::LINE) {}
void execute();
void print();
void printSimple() {
print();
}
virtual Variable* evaluate();
};
#endif //_LINE_HPP