-
Notifications
You must be signed in to change notification settings - Fork 0
/
array_tab.h
54 lines (45 loc) · 1.12 KB
/
array_tab.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
49
50
51
52
53
54
#ifndef VARARRAY_H
#define VARARRAY_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include "variables_tab.h"
int arrays_count;
int arrays_capacity;
int arrays_vars;
typedef struct rangelist_type{
int deb;
int fin;
int length;
int totLenght;
struct rangelist_type* suivant;
}rangelist_type;
typedef struct arraytype_type{
int type;
struct rangelist_type* rangelist;
}arraytype_type;
// Define the variable structure.
typedef struct varArray {
variable* array;
rangelist_type* range;
int dim;
int nbvars;
int type;
}varArray;
// Utility function to initialize vars_array
void initArrayTab();
/*
Function that returns the saved variables in a given char address.
*/
void arrays_to_string(FILE *returns);
/*
Function that simply returns the code of the variable given in the array of variables.
If the variable does not exists, return NULL.
*/
varArray* getArray(char* varName);
/*
Function that returns the result of the insertion in the vars_array.
*/
varArray* insertArray(char* varName, int context, arraytype_type* arraytype, FILE *returns);
#endif