-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsymbol.h
35 lines (29 loc) · 841 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
#ifndef _SYMBOL_H_
#define _SYMBOL_H_
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "array_dimension.h"
#define SYMBOL_MAX_STRING 42
struct symbol {
char* identifier;
bool isconstant;
bool is_initialised;
bool is_never_used;
bool is_define;
bool is_array;
bool is_copy;
int value; // seulement si c'est une constante ou tableau
char* string; //pour le print
struct array_dimension* array_dimension;//pour les tableaux
struct symbol* next;
};
struct symbol* symbol_alloc();
struct symbol* symbol_newtemp(struct symbol**);
struct symbol* symbol_newtemp_init(struct symbol**,int);
struct symbol* symbol_lookup(struct symbol*, char*);
struct symbol* symbol_add(struct symbol**, char*);
void symbol_print(struct symbol*);
void symbol_free(struct symbol*);
#endif