Ajout analyse sémantique :
- Verif declaration var & tab - Verif appel var
This commit is contained in:
47
header/dico.h
Normal file
47
header/dico.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#ifndef __DICO__
|
||||
#define __DICO__
|
||||
|
||||
#define _GNU_SOURCE 1
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "syntabs.h"
|
||||
|
||||
#define maxDico 100
|
||||
|
||||
#define C_VARIABLE_GLOBALE 1
|
||||
#define C_VARIABLE_LOCALE 2
|
||||
#define C_ARGUMENT 3
|
||||
|
||||
#define T_ENTIER 1
|
||||
#define T_TABLEAU_ENTIER 2
|
||||
#define T_FONCTION 3
|
||||
|
||||
typedef struct {
|
||||
char *identif;
|
||||
int classe; // portée
|
||||
int type;
|
||||
int adresse;
|
||||
int complement; // taille d'un tableau, nombre d'arguments d'une fonction
|
||||
} desc_identif;
|
||||
|
||||
typedef struct {
|
||||
desc_identif tab[maxDico];
|
||||
int base;
|
||||
int sommet;
|
||||
} dico_;
|
||||
|
||||
void entreeFonction(void);
|
||||
void sortieFonction(void);
|
||||
int ajouteIdentificateur(char *identif, int classe, int type, int adresse, int complement);
|
||||
int rechercheExecutable(char *identif);
|
||||
int rechercheDeclarative(char *identif);
|
||||
void affiche_dico(void);
|
||||
|
||||
dico_ dico;
|
||||
extern int contexte;
|
||||
extern int adresseGlobalCourante;
|
||||
extern int adresseLocaleCourante;
|
||||
extern int adresseArgumentCourant;
|
||||
#endif
|
||||
Reference in New Issue
Block a user