-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspl.h
More file actions
52 lines (45 loc) · 1.05 KB
/
spl.h
File metadata and controls
52 lines (45 loc) · 1.05 KB
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
#include <stdio.h>
#include "data.h"
#include "file.h"
#include "label.h"
#include "node.h"
#include "y.tab.h"
#define LEGAL 0
#define PAGE_PER_INTERRUPT 2
#define PAGE_SIZE 512
#define CONSTANT_NAME_MAX_LEN 30
extern int linecount;
extern int out_linecount;
extern int flag_break;
extern int regcount;
extern int depth;
extern unsigned long temp_pos;
extern FILE *fp;
struct define
{
char name[CONSTANT_NAME_MAX_LEN];
int value;
struct define *next;
};
extern struct define *root_define;
struct define *lookup_constant(char *name);
struct alias
{
char name[CONSTANT_NAME_MAX_LEN];
int reg, depth;
struct alias *next;
};
extern struct alias *root_alias;
struct define* lookup_constant(char *name);
struct alias *lookup_alias(char *name);
struct alias *lookup_alias_reg(int reg);
void push_alias(char *name, int reg);
void pop_alias();
void insert_constant(char *name, int value);
void add_predefined_constants();
node *substitute_id(node *id);
void getreg(node *root, char reg[]);
void codegen(node *root);
int yylex();
int yyparse();
int yyerror();