diff options
Diffstat (limited to 'lib/meta.c')
-rw-r--r-- | lib/meta.c | 32 |
1 files changed, 10 insertions, 22 deletions
@@ -63,8 +63,7 @@ découpage en sous routines. */ void meta_parse_line(char *line) { - char buffer[BUFSIZ], *first = NULL, m = 0, *p1 = NULL, *p2 = NULL, *Fnames[MAXF], *Fimplicits[MAXF], - *Snames[MAXF], *Sinames[MAXF], gotname = 0, goteoi = 0, errbuff[BUFSIZ]; + char buffer[BUFSIZ], *first = NULL, m = 0, *p1 = NULL, *p2 = NULL, *Fnames[MAXF], *Fimplicits[MAXF], *Snames[MAXF], *Sinames[MAXF], gotname = 0, goteoi = 0, errbuff[BUFSIZ]; phon_t *phon = NULL; field_t *field = NULL; pattern_t *pattern = NULL; @@ -200,8 +199,7 @@ void meta_parse_line(char *line) pattern->next = patterns->next; patterns->next = pattern; pattern->name = first; - pattern->expr = - (metaexpr_t **) Emalloc(nbfields * sizeof(metaexpr_t *)); + pattern->expr = (metaexpr_t **) Emalloc(nbfields * sizeof(metaexpr_t *)); for (i = 0; i < nbfields; i++) { pattern->expr[i] = tabmetaexpr[i]; } @@ -579,20 +577,16 @@ void main(void) fprintf(stderr, " + %s (%s) type: %s\n", pattern->expr[i]->name ? pattern->expr[i]->name : "Opérateur [", pattern->expr[i]->string ? pattern->expr[i]->string : "Aucune chaîne associée", - pattern->expr[i]->type ? "Constante prédéfinie" : pattern->expr[i]-> - left ? "Binaire" : pattern->expr[i]->right ? "Unaire" : "Feuille"); + pattern->expr[i]->type ? "Constante prédéfinie" : pattern->expr[i]->left ? "Binaire" : pattern->expr[i]->right ? "Unaire" : "Feuille"); if (pattern->expr[i]->left) { fprintf(stderr, " - gauche: %s (%s) type: %s\n", pattern->expr[i]->left->name ? pattern->expr[i]->left->name : "Opérateur [", - pattern->expr[i]->left->string ? pattern->expr[i]->left-> - string : "Aucune chaîne associée", - pattern->expr[i]->left->type ? "Constante prédéfinie" : "Feuille"); + pattern->expr[i]->left->string ? pattern->expr[i]->left->string : "Aucune chaîne associée", pattern->expr[i]->left->type ? "Constante prédéfinie" : "Feuille"); } if (pattern->expr[i]->right) { fprintf(stderr, " - droite: %s (%s) type: %s\n", pattern->expr[i]->right->name ? pattern->expr[i]->right->name : "Opérateur [", - pattern->expr[i]->right->string ? pattern->expr[i]->right-> - string : "Aucune chaîne associée", + pattern->expr[i]->right->string ? pattern->expr[i]->right->string : "Aucune chaîne associée", pattern->expr[i]->right->type ? "Constante prédéfinie" : "Feuille"); } } @@ -600,29 +594,23 @@ void main(void) fprintf(stderr, "\nListe des instructions:\n"); for (instruct = instructs->next; instruct; instruct = instruct->next) { - fprintf(stderr, " o Instruction contenant %i champs explicites et %i champs implicites.\n", - instruct->nbexplicit, instruct->nbimplicit); + fprintf(stderr, " o Instruction contenant %i champs explicites et %i champs implicites.\n", instruct->nbexplicit, instruct->nbimplicit); fprintf(stderr, " => Champs explicites.\n"); for (i = 0; i < instruct->nbexplicit; i++) { fprintf(stderr, " + %s <= %s (type %s)\n", - instruct->names[i], - instruct->strings[i] ? instruct->strings[i] : "Pas de chaîne associée", - instruct->etypes[i] ? "prédéfinit" : "direct"); + instruct->names[i], instruct->strings[i] ? instruct->strings[i] : "Pas de chaîne associée", instruct->etypes[i] ? "prédéfinit" : "direct"); } fprintf(stderr, " => Champs implicites.\n"); for (i = 0; i < instruct->nbimplicit; i++) { switch (instruct->itypes[i]) { case 0: - fprintf(stderr, " + %s <= %s (type direct)\n", instruct->implicits[i], - instruct->istrings[i]); + fprintf(stderr, " + %s <= %s (type direct)\n", instruct->implicits[i], instruct->istrings[i]); break; case 1: - fprintf(stderr, " + %s <= %s (type prédéfinit)\n", instruct->implicits[i], - instruct->istrings[i]); + fprintf(stderr, " + %s <= %s (type prédéfinit)\n", instruct->implicits[i], instruct->istrings[i]); break; case 2: - fprintf(stderr, " + %s <= %i (type valeur)\n", instruct->implicits[i], - instruct->ivalues[i]); + fprintf(stderr, " + %s <= %i (type valeur)\n", instruct->implicits[i], instruct->ivalues[i]); break; } } |