-
Notifications
You must be signed in to change notification settings - Fork 0
/
symtab.h
39 lines (28 loc) · 765 Bytes
/
symtab.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
/**********************************************
CS515 Compilers
Project1
Spring 2016
**********************************************/
#ifndef SYMTAB_H
#define SYMTAB_H
#include <string.h>
/* The symbol table implementation uses a single hash */
/* function. Starting from the hashed position, entries */
/* are searched in increasing index order until a */
/* matching entry is found, or an empty entry is reached. */
typedef struct {
char *name;
int offset;
int rowDim;
int colDim;
/* need to add stuff here */
} SymTabEntry;
extern
void InitSymbolTable();
extern
SymTabEntry * lookup(char *name);
extern
void insert(char *name,int offset,int rowDim,int colDim);
extern
void PrintSymbolTable();
#endif