forked from gcharlet/minipro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenviron.h
34 lines (33 loc) · 1.56 KB
/
environ.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
/* environ.h */
#ifndef ENVIRON_H
#define ENVIRON_H
/* ----------------------------types--------------------------------------------*/
/* environnement := liste de couples (identificateur, entier) */
typedef struct cellenv{
char *ID;
int VAL;
struct cellenv *SUIV;} *ENV;
/*------------------FONCTIONS ---------------------------------------------------*/
/*---------------------allocation memoire----------------------------------------*/
extern char *Idalloc(); /* retourne un tableau de MAXIDENT char */
extern ENV Envalloc(); /* retourne un ENV */
/*---------------------environnements--------------------------------------------*/
extern int initenv(ENV *prho,char *var);/* initialise l'ident var dans *prho */
extern int ecrire_env(ENV rho);/* affiche l'environnement */
extern int eval(int op, int arg1, int arg2); /* retourne (arg1 op arg2) */
extern ENV rech(char *chaine, ENV listident);/* retourne la position de chaine */
extern int affect(ENV rho, char *var, int val);/* affecte val a la variable var */
extern int valch(ENV rho, char *var); /* valeur de var dans envirnt rho */
/* ------------------CONSTANTES -------------------------------------------------*/
#define MAXIDENT 16 /* long max d'un identificateur de variable */
#define MAXQUAD 5*MAXIDENT /* long max d'un quadruplet c3a */
#define Pl 257
#define Mo 258
#define Mu 259
#define Af 260
#define Afc 261
#define Sk 262
#define Jp 263
#define Jz 264
#define St 265
#endif