-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStatement.h
More file actions
35 lines (27 loc) · 817 Bytes
/
Statement.h
File metadata and controls
35 lines (27 loc) · 817 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
#ifndef STATEMENT_H
#define STATEMENT_H
#include "ScriptMemory.h"
#include "ScriptCompile.h"
#include "Token.h"
#include <vector>
#include <optional>
class ScriptCode;
class Statement
{
public:
Statement(std::vector<std::shared_ptr<Statement>>& tokens, bool expression = false);
Statement(std::shared_ptr<Statement> lhs, const Token& token, std::shared_ptr<Statement> rhs);
Statement(int key);
~Statement(void);
void compile(ScriptCompile& comp);
std::shared_ptr<Variable> run(const std::shared_ptr<ScriptMemory>& mem);
bool hasReturn();
bool isConstant(ScriptCompile& comp);
ScriptTypeData getType(ScriptCompile& comp, bool operative);
std::string output(const std::string& indent = "");
std::shared_ptr<Statement> lhs, rhs;
Token token;
int keyword;
std::shared_ptr<ScriptCode> code;
};
#endif