init premiers & suivants

This commit is contained in:
2016-02-09 12:54:38 +01:00
parent a9ec673316
commit 3b5b693f67
3 changed files with 8 additions and 5 deletions

View File

@@ -12,12 +12,16 @@ FILE *yyin;
int main(int argc, char **argv) {
yyin = fopen(argv[1], "r");
if(yyin == NULL){
if(argc == 0 && yyin == NULL){
fprintf(stderr, "impossible d'ouvrir le fichier %s\n", argv[1]);
exit(1);
}
//test_yylex_internal(yyin);
initialise_premiers();
initialise_suivants();
uniteCourante = yylex();
programme();

View File

@@ -158,7 +158,6 @@ void initialise_premiers(void){
// TODO: Compléter le tableau premiers ici
}
int est_premier(int terminal, int non_terminal)
{
int est_premier(int non_terminal, int terminal) {
return premiers[non_terminal][terminal];
}

View File

@@ -313,7 +313,7 @@ void initialise_suivants(void){
suivants[_listeExpressionsBis_][PARENTHESE_FERMANTE] = 1;
}
int est_suivant(int terminal, int non_terminal)
int est_suivant(int non_terminal, int terminal)
{
return suivants[non_terminal][terminal];
}