Préparation pour test intermediaire
- Analyseur lexical OK - Analyseur syntaxyque OK
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user