-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTable_des_symboles.h
More file actions
50 lines (35 loc) · 1.15 KB
/
Copy pathTable_des_symboles.h
File metadata and controls
50 lines (35 loc) · 1.15 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
/*
* Table des symboles.h
*
* Associative array encoded as linked list of pair (symbol_name, symbol_value)
*
* To be used only with getter get_symbol_value and setter set_symbol_value.
*
* Type attribute can be customized.
*
* Symbol names must be valid sid from Table des chaines.
*
*/
#ifndef TABLE_DES_SYMBOLES_H
#define TABLE_DES_SYMBOLES_H
// #include "Table_des_chaines.h"
/* Déclarations des types d'attributs */
char* type2string (int);
struct ATTRIBUTE {
int type;
int offset;
int depth;
/* les autres attributs dont vous pourriez avoir besoin
pour les symboles seront déclarés ici */
};
typedef struct ATTRIBUTE * attribute;
attribute makeSymbol(int type, int offset, int depth);
attribute new_attribute ();
/* returns the pointeur to a newly allocated (but uninitialized) attribute value structure */
/* get the symbol value of symb_id from the symbol table, NULL if it fails */
attribute get_symbol_value(char * symb_id);
/* add the symbol symb_id with given value */
attribute set_symbol_value(char * symb_id,attribute value);
/* remove the variables of a block*/
void remove_local_variables(int numVar);
#endif