Projet-Systemes-Informatiques/table.h
2023-04-06 11:36:33 +02:00

43 lines
824 B
C

#ifndef TABLE_H
#define TABLE_H
#include <stdio.h>
#include <stdbool.h>
enum enumVarType {INT, FLOAT}; // a adapter
/*defined constants*/
#define START_TABLE_SIZE 128;
/*indexes in the array*/
static int currentIndex; // the next to index to be used
static int maxIndex;
static symbol* symbolTable;
// stack pointers
static int esp;
static int ebp;
static int currentDepth;
typedef struct {
char* name;
bool init;
enumVarType varType;
int offset;
int depth;
} Symbol;
// TODO : move comments here
void reallocateArray(int size);
void checkArraySanity();
void suppressElement(Symbol element);
int initOffset(int index);
void addElement(Symbol element);
void toggleInit(char *name);
int getIndex(char* name);
Symbol getStruct(char* name);
void error(char* mess);
int getOffset(char* name);
#endif