Ajout analyse sémantique :

- Verif declaration var & tab
- Verif appel var
This commit is contained in:
2016-03-08 15:57:03 +01:00
parent 2d23d0dc3a
commit 634440714c
10 changed files with 566 additions and 45 deletions

View File

@@ -3,6 +3,7 @@
#include "analyseur_lexical.h"
#include "analyseur_syntaxyque.h"
#include "affiche_arbre_abstrait.h"
#include "affiche_table_symbole.h"
#include "symboles.h"
extern int uniteCourante;
@@ -19,22 +20,24 @@ int main(int argc, char **argv) {
exit(1);
}
initialise_premiers();
initialise_suivants();
if (!strcmp(argv[1], "-l")) {
test_yylex_internal(yyin);
} else if (!strcmp(argv[1], "-s")) {
afficheSyntaxyque = 1;
initialise_premiers();
initialise_suivants();
uniteCourante = yylex();
programme();
} else if (!strcmp(argv[1], "-a")) {
initialise_premiers();
initialise_suivants();
uniteCourante = yylex();
n_prog *p = programme();
affiche_n_prog(p);
} else if (!strcmp(argv[1], "-t")) {
uniteCourante = yylex();
n_prog *p = programme();
affiche_t_table(p);
} else {
fprintf(stderr, "option Inconue");
exit(1);