-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
53 lines (45 loc) · 1.01 KB
/
main.c
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
/*
** Auteur Bruno Poterie
** Projet FORTH
** Fichier main.c
** Date 18/11/2020
*/
#include "forth.h"
#include "pile.h"
#include "dictionnaire.h"
#include "interprete.h"
#include "interface.h"
#include <stdio.h>
int main(int argc, char * argv[])
{
char *element;
Retcode ret;
printf("Micro-Forth ESEO v%s\n",VERSION);
// phase d'initialisation
InterfaceInit();
PileInit();
DicoInit();
InterpreteInit();
// boucle générale
// * lire les mots au clavier
// * les interpreter
while (finSession==false)
{
ret=ElementSuivant(&element);
switch (ret)
{
case OK:
ret = Interprete(element);
if (ret != OK)
AfficheErreur(ret,"erreur lors de l'interpretation");
break;
case ERR_EOF:
finSession = true;
break;
default:
AfficheErreur(ret,"erreur dans la lecture du token suivant");
}
}
printf("Au revoir\n");
return 0;
}