-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsymbol.h
48 lines (38 loc) · 856 Bytes
/
symbol.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
#ifndef _SYMBOL_H
#define _SYMBOL_H
#define ATYPENORM 0//value is passed used as id
#define ATYPEADDR 1//reference is passed used as id
int bind_base,Lbind_base,Lbind_argbase;
typedef struct argumentnode
{
char *name;
int type,refer;
struct argumentnode *next;
}argnode;
typedef struct symbolnode
{
char *name;
int type;
int atype;
int size;
int *binding,bind;
struct argumentnode *args;
struct symbolnode *next;
}symnode;
/*
typedef struct symboltable
{
int bind_base;
struct symbolnode *symbols;
struct symboltable *parent;
}
*/
#include "operators.h"
#include "types.h"
symnode* construct();
symnode* Lconstruct();
int getVarType(char *n,symnode *table);
symnode* lookup(char *n,symnode *table);
symnode* makeSymEntry(char *n,symnode *table,int v,int t,argnode *args);
argnode* makeArgNode(int type,char* name,int refer);
#endif