summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <>2001-04-15 16:49:39 +0000
committerPixel <>2001-04-15 16:49:39 +0000
commita1377062cc56484ff439eb3b73e7f4efac1c3077 (patch)
tree4080af556c821f4be065b80f5058c1fa8ed77e1a
parentd90a3e9f5e9bb8e93d8e5282f0ee5cae1b7b2119 (diff)
Bug fixes
-rw-r--r--lib/assembler.c23
-rw-r--r--lib/hash.c10
-rw-r--r--po/ProjetArchi.pot107
3 files changed, 76 insertions, 64 deletions
diff --git a/lib/assembler.c b/lib/assembler.c
index 5fc5928..8bceaec 100644
--- a/lib/assembler.c
+++ b/lib/assembler.c
@@ -319,8 +319,11 @@ static expression_t *copy_expression(expression_t * e)
*t = *e;
if (t->symbol) {
- e_t = (expression_t *) NomVarToVar(e->symbol, defines, &trouve);
- if ((trouve) && (t->e_subtype = E_STRING)) {
+ trouve = 0;
+ if (e->e_subtype == E_LABEL) {
+ e_t = (expression_t *) NomVarToVar(e->symbol, defines, &trouve);
+ }
+ if ((trouve) && (t->e_type = E_STRING)) {
free(t);
t = copy_expression(e_t);
return t;
@@ -449,7 +452,10 @@ void push_pile(char *a)
e->avalue = number;
e->symbol = NULL;
} else {
+ trouve = 0;
+ if ((*a != '"') && (*a != '\'')) {
e_t = (expression_t *) NomVarToVar(a, defines, &trouve);
+ }
if (trouve) {
e = copy_expression(e_t);
} else {
@@ -1229,7 +1235,7 @@ static instruct_t *e_match_i(phon_t * phons, instruct_t * instructs, expression_
}
break;
case 'C':
- if (t->e_subtype != E_VALUE) {
+ if ((t->e_subtype != E_VALUE) && (t->e_subtype != E_LABEL)) {
go_out = 1;
if (t->e_subtype == E_OPERATION) {
if (t->op == OP_FUNC_CALL)
@@ -1311,7 +1317,9 @@ static void evaluate_pattern(_TableauVariable * it, expression_t * e)
m = e->pattern->expr[e->index];
if (m->name) {
+ fprintf(stderr, "La pattern a un nom\n");
if (m->string) {
+ fprintf(stderr, "et une string associée\n");
if (m->type) {
if (!strcmp(m->name, "I")) {
exception(1, _("Unknow constant type in the meta language"));
@@ -1322,6 +1330,7 @@ static void evaluate_pattern(_TableauVariable * it, expression_t * e)
pushdword(0, e);
}
} else {
+ fprintf(stderr, "et n'est pas d'un type prédéfinit\n");
if (m->string) {
if (m->string[0] != 'P') {
exception(1,
@@ -1435,17 +1444,21 @@ static int evaluate_field(_TableauVariable it, char * field, field_t * fields) {
r = 0;
n = 0;
+ fprintf(stderr, "Evaluation du champ %s\n", field);
+
for (i = 0; i < fields->nbr; i++) {
t = (expression_t *) NomVarToVar(fields->names[i], it, &trouve);
e = 0;
+ fprintf(stderr, "On veut la variable %s pour le champ %i\n", fields->names[i], i);
if (trouve) {
if (t->e_subtype != E_VALUE) {
exception(1, _("Can't evaluate directly expression"));
}
e = t->avalue;
}
+ fprintf(stderr, "Elle vaut %i\n", e);
n = fields->sizes[i];
- if ((e & (n - 1)) != e) {
+ if ((e & ((1 << n) - 1)) != e) {
exception(1, _("Value too large for field"));
}
r = (r << n) | e;
@@ -1616,8 +1629,8 @@ void asm_eol(void)
t->avalue = e_current->index;
t->child = t->next = NULL;
t->pattern = NULL;
+ fprintf(stderr, "Insertion de la variable %s, de valeur %i.\n", instr->names[i], t->avalue);
InsererVarDansTab(&it, CreerElement(instr->names[i], t));
- free(t);
evaluate_pattern(&it, e_current);
break;
default:
diff --git a/lib/hash.c b/lib/hash.c
index 2850444..80e44af 100644
--- a/lib/hash.c
+++ b/lib/hash.c
@@ -19,7 +19,7 @@ static int FonctionHachage(char *clef)
return (i);
}
}
- return (strlen(CHAINEHACHAGE));
+ return -1;
}
_Element CreerElement(char *Nom, _TypeVariable Var)
@@ -95,7 +95,7 @@ char SupprimerDansTab(_TableauVariable * t, char *Nom)
{
int index = FonctionHachage(Nom);
- if (0 <= index && index <= strlen(CHAINEHACHAGE)) {
+ if (0 <= index && index < strlen(CHAINEHACHAGE)) {
Supprimer(&((*t)[index]), Nom);
} else {
return (0);
@@ -107,7 +107,7 @@ char InsererVarDansTab(_TableauVariable * t, _Element e)
{
int index = FonctionHachage(e.NomVar);
- if (0 <= index && index <= strlen(CHAINEHACHAGE)) {
+ if (0 <= index && index < strlen(CHAINEHACHAGE)) {
(*t)[index] = InserTete((*t)[index], e);
} else {
return (0);
@@ -159,7 +159,7 @@ int Initialise(_TableauVariable * t)
unsigned int i;
(*t) = (_TableauVariable) Emalloc(sizeof(_ListeChaine) * (strlen(CHAINEHACHAGE) + 1));
- for (i = 0; i <= strlen(CHAINEHACHAGE); i++) {
+ for (i = 0; i < strlen(CHAINEHACHAGE); i++) {
(*t)[i] = NULL;
}
return (i);
@@ -169,7 +169,7 @@ void DetruitTab(_TableauVariable * t)
{
int i;
- for (i = 0; i <= strlen(CHAINEHACHAGE); i++) {
+ for (i = 0; i < strlen(CHAINEHACHAGE); i++) {
Detruit(&((*t)[i]));
}
diff --git a/po/ProjetArchi.pot b/po/ProjetArchi.pot
index ef32584..67a0380 100644
--- a/po/ProjetArchi.pot
+++ b/po/ProjetArchi.pot
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2001-04-15 18:19+0200\n"
+"POT-Creation-Date: 2001-04-15 18:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -26,206 +26,206 @@ msgstr ""
msgid "You can't have the startpoint elsewhere than the .text segment"
msgstr ""
-#: lib/assembler.c:395
+#: lib/assembler.c:398
msgid "Not a valid . directive"
msgstr ""
-#: lib/assembler.c:424
+#: lib/assembler.c:427
msgid "Not a valid # directive"
msgstr ""
#. Cas des directives .
-#: lib/assembler.c:432
+#: lib/assembler.c:435
msgid "Error: extra parameters to a . directive."
msgstr ""
-#: lib/assembler.c:541
+#: lib/assembler.c:547
msgid "Too much arguments to #undef"
msgstr ""
-#: lib/assembler.c:545
+#: lib/assembler.c:551
msgid "Defined symbol not found."
msgstr ""
-#: lib/assembler.c:551
+#: lib/assembler.c:557
msgid "Too much arguments to #include"
msgstr ""
-#: lib/assembler.c:553
+#: lib/assembler.c:559
#, c-format
msgid "Including file at line %i"
msgstr ""
-#: lib/assembler.c:556
+#: lib/assembler.c:562
msgid "Error reading include file"
msgstr ""
-#: lib/assembler.c:608 lib/assembler.c:614
+#: lib/assembler.c:614 lib/assembler.c:620
msgid "Zero divide."
msgstr ""
-#: lib/assembler.c:627 lib/assembler.c:634
+#: lib/assembler.c:633 lib/assembler.c:640
msgid "Error: unable to compute the immediate value"
msgstr ""
-#: lib/assembler.c:643
+#: lib/assembler.c:649
msgid "Function unknow"
msgstr ""
-#: lib/assembler.c:650
+#: lib/assembler.c:656
msgid "Addresses addition not allowed"
msgstr ""
-#: lib/assembler.c:654
+#: lib/assembler.c:660
msgid "You can only use the decal operator on labels"
msgstr ""
-#: lib/assembler.c:659 lib/assembler.c:662 lib/assembler.c:693
+#: lib/assembler.c:665 lib/assembler.c:668 lib/assembler.c:699
msgid "Address operation invalid"
msgstr ""
-#: lib/assembler.c:665 lib/assembler.c:697
+#: lib/assembler.c:671 lib/assembler.c:703
msgid "Addresses operations not allowed"
msgstr ""
-#: lib/assembler.c:668 lib/assembler.c:790 lib/assembler.c:827
-#: lib/assembler.c:901
+#: lib/assembler.c:674 lib/assembler.c:796 lib/assembler.c:833
+#: lib/assembler.c:907
msgid "Expression too complex or invalid"
msgstr ""
-#: lib/assembler.c:701 lib/assembler.c:714 lib/assembler.c:767
-#: lib/assembler.c:779 lib/assembler.c:816
+#: lib/assembler.c:707 lib/assembler.c:720 lib/assembler.c:773
+#: lib/assembler.c:785 lib/assembler.c:822
msgid "Address type not supported"
msgstr ""
-#: lib/assembler.c:783
+#: lib/assembler.c:789
msgid "Address addition not supported"
msgstr ""
-#: lib/assembler.c:820 lib/assembler.c:872
+#: lib/assembler.c:826 lib/assembler.c:878
msgid "Expression invalid"
msgstr ""
#. Bon si l'on est ici, c'est pas bon signe non plus...
-#: lib/assembler.c:945
+#: lib/assembler.c:951
msgid "Expression too complex"
msgstr ""
-#: lib/assembler.c:1008
+#: lib/assembler.c:1014
msgid "Something wrong, nested operator called..."
msgstr ""
-#: lib/assembler.c:1079
+#: lib/assembler.c:1085
msgid "Something wrong, lparenthesis operator called..."
msgstr ""
-#: lib/assembler.c:1082
+#: lib/assembler.c:1088
msgid "Something wrong, should never got here..."
msgstr ""
-#: lib/assembler.c:1249
+#: lib/assembler.c:1255
msgid "Unknow predefined string into the meta language"
msgstr ""
-#: lib/assembler.c:1306
+#: lib/assembler.c:1312
msgid "Pattern not matching..."
msgstr ""
-#: lib/assembler.c:1317 lib/assembler.c:1349 lib/assembler.c:1606
-#: lib/assembler.c:1624
+#: lib/assembler.c:1325 lib/assembler.c:1358 lib/assembler.c:1619
+#: lib/assembler.c:1637
msgid "Unknow constant type in the meta language"
msgstr ""
-#: lib/assembler.c:1329 lib/assembler.c:1373 lib/assembler.c:1403
+#: lib/assembler.c:1338 lib/assembler.c:1382 lib/assembler.c:1412
msgid ""
"Error in the metalanguage (pattern should be here if not a constant type)"
msgstr ""
-#: lib/assembler.c:1361 lib/assembler.c:1389 lib/assembler.c:1397
-#: lib/assembler.c:1647
+#: lib/assembler.c:1370 lib/assembler.c:1398 lib/assembler.c:1406
+#: lib/assembler.c:1660
msgid "Logical error in meta language"
msgstr ""
-#: lib/assembler.c:1432
+#: lib/assembler.c:1441
msgid "Unknow field in metalanguage"
msgstr ""
-#: lib/assembler.c:1443
+#: lib/assembler.c:1455
msgid "Can't evaluate directly expression"
msgstr ""
-#: lib/assembler.c:1449
+#: lib/assembler.c:1462
msgid "Value too large for field"
msgstr ""
-#: lib/assembler.c:1503 lib/assembler.c:1673
+#: lib/assembler.c:1516 lib/assembler.c:1686
msgid "Unknow instruction"
msgstr ""
-#: lib/assembler.c:1528
+#: lib/assembler.c:1541
msgid "Unknow constant"
msgstr ""
-#: lib/assembler.c:1537
+#: lib/assembler.c:1550
msgid "Bad constant for an immediate value"
msgstr ""
-#: lib/assembler.c:1554
+#: lib/assembler.c:1567
msgid "Bad constant for a string"
msgstr ""
-#: lib/assembler.c:1571
+#: lib/assembler.c:1584
msgid "Bad array size"
msgstr ""
-#: lib/assembler.c:1580
+#: lib/assembler.c:1593
msgid "You can only have an instruction into a .text segment"
msgstr ""
-#: lib/assembler.c:1583
+#: lib/assembler.c:1596
msgid "Unmatched instruction"
msgstr ""
-#: lib/assembler.c:1639
+#: lib/assembler.c:1652
msgid "Syntax error in meta language"
msgstr ""
-#: lib/assembler.c:1712
+#: lib/assembler.c:1725
msgid "Loading file"
msgstr ""
-#: lib/assembler.c:1713 lib/meta.c:516
+#: lib/assembler.c:1726 lib/meta.c:516
#, c-format
msgid "Opening file '%s'"
msgstr ""
-#: lib/assembler.c:1721 lib/meta.c:524
+#: lib/assembler.c:1734 lib/meta.c:524
msgid "Reading file"
msgstr ""
-#: lib/assembler.c:1723 lib/meta.c:526
+#: lib/assembler.c:1736 lib/meta.c:526
#, c-format
msgid "Reading line %i"
msgstr ""
-#: lib/assembler.c:1732
+#: lib/assembler.c:1745
#, c-format
msgid "Summering line %s"
msgstr ""
-#: lib/assembler.c:1748
+#: lib/assembler.c:1761
msgid "Opening output file"
msgstr ""
-#: lib/assembler.c:1751
+#: lib/assembler.c:1764
msgid "Error writing output file"
msgstr ""
-#: lib/assembler.c:1755
+#: lib/assembler.c:1768
msgid "Error reading file"
msgstr ""
-#: lib/assembler.c:1757
+#: lib/assembler.c:1770
msgid "Writing output file"
msgstr ""
@@ -391,7 +391,6 @@ msgstr ""
msgid "Signal received: segfault"
msgstr ""
-#. signal(SIGSEGV, segfaulthand);
#: src/compilo.c:54
msgid ""
"\n"