-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastident.h
42 lines (32 loc) · 941 Bytes
/
astident.h
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
#ifndef ASTIDENT_H
#define ASTIDENT_H
#include "astexpr.h"
class AstIdent : public AstExpr
{
public:
enum class Type {DeclPrivate, DeclPublic, Unbound, Reference};
AstIdent(std::string symbol, Type type)
: symbol(symbol)
, type(type)
{}
void apply_bind(AstBlock *scope);
void set_stack_start(unsigned int stack_size);
Stream *execute(Context *context);
std::string to_string(unsigned int indent = 0)
{
switch (type) {
case Type::DeclPrivate: return "-" + symbol;
case Type::DeclPublic: return "+" + symbol;
case Type::Unbound: return "." + symbol;
case Type::Reference: return symbol;
}
}
static const std::string ImplicitIn;
static const std::string ImplicitOut;
static const std::string AutoOut;
protected:
std::string symbol;
Type type;
unsigned int stack_id = 0;
};
#endif // ASTIDENT_H