-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlang.h
55 lines (44 loc) · 769 Bytes
/
lang.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
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef LANG
#define LANG
#include <stdio.h>
#include "ast.h"
#include "lut.h"
#define MAX_STACK_SLOTS 2
typedef struct ExtraData {
char *filename;
int line;
int col;
int size;
} ExtraData;
typedef struct Instruction {
InstructionType type;
Token *tok;
} Instruction;
typedef struct StringNode {
int capacity;
int index;
Node **nodes;
} StringNode;
typedef struct Program {
int id;
int errored;
Node *root;
Lut global_lut;
Lut local_lut;
Lut function_lut;
StringNode strings;
Token *tok;
int used_system;
int used_console;
int used_screen;
int used_mouse;
int used_datetime;
int used_print;
int used_audio;
int used_sine;
void *scanner;
void *parser;
ExtraData data;
FILE * output;
} Program;
#endif