forked from ovr/StaticScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscope.ts
More file actions
30 lines (21 loc) · 804 Bytes
/
scope.ts
File metadata and controls
30 lines (21 loc) · 804 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
import * as llvm from "llvm-node";
import {FunctionDeclaration} from "typescript";
import {Value} from "./value";
export class VariablesTable extends Map<string, Value> {
}
export class FunctionsTable extends Map<string, llvm.Function> {
}
export class ClassesTable extends Map<string, llvm.StructType> {
}
export class EnclosureFunction {
public llvmFunction: llvm.Function;
public declaration: FunctionDeclaration|null = null;
}
export class Scope {
public enclosureFunction: EnclosureFunction;
public functions: FunctionsTable = new FunctionsTable();
public variables: VariablesTable = new VariablesTable();
public classes: ClassesTable = new ClassesTable();
public breakBlock: llvm.BasicBlock|null = null;
public continueBlock: llvm.BasicBlock|null = null;
}