Ajout de l'analyse syntaxique des expresion :

- ()
    - +
    - *
This commit is contained in:
2016-01-26 15:41:24 +01:00
parent ae21824d2c
commit e71dc9bae0
7 changed files with 120 additions and 25 deletions

View File

@@ -1,17 +1,33 @@
#include <stdio.h>
#include <stdlib.h>
#include "analyseur_lexical.h"
#include "analyseur_syntaxyque.h"
#include "symboles.h"
extern int uniteCourante;
char yytext[100];
FILE *yyin;
int main(int argc, char **argv) {
yyin = fopen(argv[1], "r");
if(yyin == NULL){
fprintf(stderr, "impossible d'ouvrir le fichier %s\n", argv[1]);
exit(1);
}
test_yylex_internal(yyin);
return 0;
}
yyin = fopen(argv[1], "r");
if(yyin == NULL){
fprintf(stderr, "impossible d'ouvrir le fichier %s\n", argv[1]);
exit(1);
}
// test_yylex_internal(yyin);
uniteCourante = yylex();
affiche_xml_texte(yytext);
expArith();
uniteCourante = yylex();
if(uniteCourante != FIN) {
printf("Erreur EOF");
}
return 0;
}