diff options
Diffstat (limited to 'lib/assembler.c')
-rw-r--r-- | lib/assembler.c | 88 |
1 files changed, 31 insertions, 57 deletions
diff --git a/lib/assembler.c b/lib/assembler.c index 043b28f..e3a49bf 100644 --- a/lib/assembler.c +++ b/lib/assembler.c @@ -793,8 +793,7 @@ static void evaluate(expression_t * e) et si c'est le cas, il ne faut pas que ce soit - C. Sinon nous ne devons pas avoir de labels pour B ou C */ - if ((e->child->child->next->child->next->e_subtype == E_PATTERN) && - (e->child->child->next->op == OP_MOINS)) { + if ((e->child->child->next->child->next->e_subtype == E_PATTERN) && (e->child->child->next->op == OP_MOINS)) { exception(1, _("Address type not supported")); } @@ -804,8 +803,7 @@ static void evaluate(expression_t * e) /* Si B et C sont du même type, on jette l'éponge... */ - if (e->child->child->next->child->e_subtype == - e->child->child->next->child->next->e_subtype) { + if (e->child->child->next->child->e_subtype == e->child->child->next->child->next->e_subtype) { exception(1, _("Expression too complex or invalid")); } @@ -830,8 +828,7 @@ static void evaluate(expression_t * e) et si c'est le cas, il ne faut pas que ce soit - C. Sinon nous ne devons pas avoir de patterns pour B ou C. */ - if ((e->child->child->next->child->next->e_subtype == E_LABEL) && - (e->child->child->next->op == OP_MOINS)) { + if ((e->child->child->next->child->next->e_subtype == E_LABEL) && (e->child->child->next->op == OP_MOINS)) { exception(1, _("Address type not supported")); } @@ -841,8 +838,7 @@ static void evaluate(expression_t * e) /* Si B et C sont du même type, on jette l'éponge... */ - if (e->child->child->next->child->e_subtype == - e->child->child->next->child->next->e_subtype) { + if (e->child->child->next->child->e_subtype == e->child->child->next->child->next->e_subtype) { exception(1, _("Expression too complex or invalid")); } @@ -901,11 +897,9 @@ static void evaluate(expression_t * e) } else if (e->child->child->next->child->next->e_subtype == E_VALUE) { /* Quasiment la même chose qu'au dessus... */ if (e->child->child->next->op == OP_MOINS) { - e->child->child->avalue -= - e->child->child->next->child->avalue; + e->child->child->avalue -= e->child->child->next->child->avalue; } else { - e->child->child->avalue += - e->child->child->next->child->avalue; + e->child->child->avalue += e->child->child->next->child->avalue; } t = e->child->child->next; e->child->child->next = t->child; @@ -915,8 +909,7 @@ static void evaluate(expression_t * e) } else { /* Si B et C sont du même type, on jette l'éponge... */ - if (e->child->child->next->child->e_subtype == - e->child->child->next->child->next->e_subtype) { + if (e->child->child->next->child->e_subtype == e->child->child->next->child->next->e_subtype) { exception(1, _("Expression too complex or invalid")); } @@ -1296,29 +1289,23 @@ static instruct_t *e_match_i(phon_t * phons, instruct_t * instructs, expression_ } #ifdef DEBUG if (instructs) { - fprintf(stderr, " o Instruction contenant %i champs explicites et %i champs implicites.\n", - instructs->nbexplicit, instructs->nbimplicit); + fprintf(stderr, " o Instruction contenant %i champs explicites et %i champs implicites.\n", instructs->nbexplicit, instructs->nbimplicit); fprintf(stderr, " => Champs explicites.\n"); for (i = 0; i < instructs->nbexplicit; i++) { fprintf(stderr, " + %s <= %s (type %s)\n", - instructs->names[i], - instructs->strings[i] ? instructs->strings[i] : "Pas de chaîne associée", - instructs->etypes[i] ? "prédéfinit" : "direct"); + instructs->names[i], instructs->strings[i] ? instructs->strings[i] : "Pas de chaîne associée", instructs->etypes[i] ? "prédéfinit" : "direct"); } fprintf(stderr, " => Champs implicites.\n"); for (i = 0; i < instructs->nbimplicit; i++) { switch (instructs->itypes[i]) { case 0: - fprintf(stderr, " + %s <= %s (type direct)\n", instructs->implicits[i], - instructs->istrings[i]); + fprintf(stderr, " + %s <= %s (type direct)\n", instructs->implicits[i], instructs->istrings[i]); break; case 1: - fprintf(stderr, " + %s <= %s (type prédéfinit)\n", instructs->implicits[i], - instructs->istrings[i]); + fprintf(stderr, " + %s <= %s (type prédéfinit)\n", instructs->implicits[i], instructs->istrings[i]); break; case 2: - fprintf(stderr, " + %s <= %i (type valeur)\n", instructs->implicits[i], - instructs->ivalues[i]); + fprintf(stderr, " + %s <= %i (type valeur)\n", instructs->implicits[i], instructs->ivalues[i]); break; } } @@ -1354,9 +1341,8 @@ static void evaluate_pattern(_TableauVariable * it, expression_t * e) } else { if (m->string) { if (m->string[0] != 'P') { - exception(1, - _ - ("Error in the metalanguage (pattern should be here if not a constant type)"));} + exception(1, _("Error in the metalanguage (pattern should be here if not a constant type)")); + } t = (expression_t *) Emalloc(sizeof(expression_t)); t->next = t->child = t->prev = t->father = NULL; t->e_type = t->e_subtype = E_VALUE; @@ -1396,9 +1382,8 @@ static void evaluate_pattern(_TableauVariable * it, expression_t * e) } else { if (m->string) { if (m->string[0] != 'P') { - exception(1, - _ - ("Error in the metalanguage (pattern should be here if not a constant type)"));} + exception(1, _("Error in the metalanguage (pattern should be here if not a constant type)")); + } t = (expression_t *) Emalloc(sizeof(expression_t)); t->next = t->child = t->prev = t->father = NULL; t->e_type = t->e_subtype = E_VALUE; @@ -1423,9 +1408,8 @@ static void evaluate_pattern(_TableauVariable * it, expression_t * e) } else { if (m->string) { if (m->string[0] != 'P') { - exception(1, - _ - ("Error in the metalanguage (pattern should be here if not a constant type)"));} + exception(1, _("Error in the metalanguage (pattern should be here if not a constant type)")); + } t = (expression_t *) Emalloc(sizeof(expression_t)); t->next = t->child = t->prev = t->father = NULL; t->e_type = t->e_subtype = E_VALUE; @@ -1623,12 +1607,11 @@ void asm_eol(void) pushdword(0, e_current); } } else { - exception(1, - _ - ("Unknow constant type in the meta language"));} + exception(1, _("Unknow constant type in the meta language")); + } } else { - InsererVarDansTab(&it, - CreerElement(instr->names[i], e_current));} + InsererVarDansTab(&it, CreerElement(instr->names[i], e_current)); + } break; case 'O': if (instr->etypes) { @@ -1639,9 +1622,8 @@ void asm_eol(void) pushdword(0, e_current); } } else { - exception(1, - _ - ("Unknow constant type in the meta language"));} + exception(1, _("Unknow constant type in the meta language")); + } } break; case 'P': @@ -1653,8 +1635,7 @@ void asm_eol(void) t->symbol = NULL; InsererVarDansTab(&it, CreerElement(instr->names[i], t)); #ifdef DEBUG - fprintf(stderr, "On a %s qui vaut %i\n", instr->names[i], - e_current->index); + fprintf(stderr, "On a %s qui vaut %i\n", instr->names[i], e_current->index); #endif evaluate_pattern(&it, e_current); break; @@ -1831,8 +1812,7 @@ void asm_eof(FILE * f) pushcontext(_("Dumping text segment")); for (ttext = ttext->next; ttext; ttext = ttext->next) { - sprintf(errctx, _("Processing word number %i coming from line %i of the file %s."), - ttext->offset, ttext->line, ttext->filename); + sprintf(errctx, _("Processing word number %i coming from line %i of the file %s."), ttext->offset, ttext->line, ttext->filename); #ifdef DEBUG fprintf(stderr, "%s\n", errctx); #endif @@ -1887,8 +1867,7 @@ void asm_eof(FILE * f) && (ttext->Expr->child->next->e_subtype == E_LABEL))) { if (ttext->Expr->child->e_subtype == E_LABEL) { #ifdef DEBUG - fprintf(stderr, "Symbole externe %s\n", - ttext->Expr->child->symbol); + fprintf(stderr, "Symbole externe %s\n", ttext->Expr->child->symbol); #endif a = ttext->Expr->child->next->avalue; nbsymbols++; @@ -1899,8 +1878,7 @@ void asm_eof(FILE * f) nbe++; } else { #ifdef DEBUG - fprintf(stderr, "Symbole externe %s\n", - ttext->Expr->child->next->symbol); + fprintf(stderr, "Symbole externe %s\n", ttext->Expr->child->next->symbol); #endif a = ttext->Expr->child->avalue; nbsymbols++; @@ -1973,8 +1951,7 @@ void asm_eof(FILE * f) pushcontext(_("Dumping data segment")); for (tdata = tdata->next; tdata; tdata = tdata->next) { - sprintf(errctx, _("Processing word number %i coming from line %i of the file %s."), - tdata->offset, tdata->line, tdata->filename); + sprintf(errctx, _("Processing word number %i coming from line %i of the file %s."), tdata->offset, tdata->line, tdata->filename); #ifdef DEBUG fprintf(stderr, "%s\n", errctx); #endif @@ -2059,8 +2036,7 @@ void asm_eof(FILE * f) pushcontext(_("Dumping bss segment")); for (tbss = tbss->next; tbss; tbss = tbss->next) { - sprintf(errctx, _("Processing word number %i coming from line %i of the file %s."), - tbss->offset, tbss->line, tbss->filename); + sprintf(errctx, _("Processing word number %i coming from line %i of the file %s."), tbss->offset, tbss->line, tbss->filename); pushcontext(errctx); if (!tbss->size) { @@ -2105,9 +2081,7 @@ void asm_eof(FILE * f) unlink("__text__"); fprintf(stderr, - _ - ("Statistics: %i words of text, %i words of data, and %i words reserved.\n%i symbols generated with %i internal and %i external.\n"), - s_text, s_data, s_bss, nbsymbols, nbi, nbe); + _("Statistics: %i words of text, %i words of data, and %i words reserved.\n%i symbols generated with %i internal and %i external.\n"), s_text, s_data, s_bss, nbsymbols, nbi, nbe); } /* Diverses fonctions pour faire plein de free() partout */ |