Préparation pour test intermediaire

- Analyseur lexical OK
- Analyseur syntaxyque OK
This commit is contained in:
2016-02-09 15:45:20 +01:00
parent 3b5b693f67
commit 755d2b6140
63 changed files with 8847 additions and 49 deletions

View File

@@ -11,23 +11,26 @@ FILE *yyin;
int main(int argc, char **argv) {
yyin = fopen(argv[1], "r");
if(argc == 0 && yyin == NULL){
fprintf(stderr, "impossible d'ouvrir le fichier %s\n", argv[1]);
yyin = fopen(argv[2], "r");
if(argc < 3 && yyin == NULL){
fprintf(stderr, "impossible d'ouvrir le fichier %s\n", argv[2]);
exit(1);
}
//test_yylex_internal(yyin);
if (!strcmp(argv[1], "-l")) {
test_yylex_internal(yyin);
} else if (!strcmp(argv[1], "-s")) {
initialise_premiers();
initialise_suivants();
initialise_premiers();
initialise_suivants();
uniteCourante = yylex();
programme();
} else {
fprintf(stderr, "option Inconue");
}
uniteCourante = yylex();
programme();
uniteCourante = yylex();
if(uniteCourante != FIN) {
printf("Erreur EOF");
}