summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/assembler.c16
-rw-r--r--lib/instructions.txt4
-rw-r--r--po/ProjetArchi.pot61
-rw-r--r--po/cat-id-tbl.c103
-rw-r--r--src/compilo.c2
5 files changed, 96 insertions, 90 deletions
diff --git a/lib/assembler.c b/lib/assembler.c
index b472ce1..25b975b 100644
--- a/lib/assembler.c
+++ b/lib/assembler.c
@@ -1127,7 +1127,7 @@ static void super_pattern(pattern_t * patterns, expression_t * e)
return;
if (!((e->op == OP_DECAL) || (e->op == OP_DIRECT)))
return;
-
+
for (patterns = patterns->next; patterns; patterns = patterns->next) {
for (i = 0; i < patterns->nbr; i++) {
if (!patterns->expr[i]->name) {
@@ -1136,11 +1136,13 @@ static void super_pattern(pattern_t * patterns, expression_t * e)
if (!patterns->expr[i]->left) {
e->pattern = patterns;
e->index = i;
+ return;
}
} else {
if (patterns->expr[i]->left) {
e->pattern = patterns;
e->index = i;
+ return;
}
}
}
@@ -1153,11 +1155,13 @@ static void super_pattern(pattern_t * patterns, expression_t * e)
&& (e->child->next->e_subtype == E_VALUE))) {
e->pattern = patterns;
e->index = i;
+ return;
}
} else {
if (e->e_subtype == E_LABEL) {
e->pattern = patterns;
e->index = i;
+ return;
}
}
}
@@ -1321,7 +1325,7 @@ static void evaluate_pattern(_TableauVariable * it, expression_t * e)
if (m->string) {
fprintf(stderr, "et une string associée\n");
if (m->type) {
- if (!strcmp(m->name, "I")) {
+ if (strcmp(m->name, "I")) {
exception(1, _("Unknow constant type in the meta language"));
}
if (e->e_subtype == E_VALUE) {
@@ -1678,9 +1682,15 @@ void asm_eol(void)
for (i = 0; i < instr->nbimplicit; i++) {
switch(instr->itypes[i]) {
case 0: /* type direct */
+ fprintf(stderr, "On cherche la variable %s\n", instr->istrings[i]);
t = (expression_t *) NomVarToVar(instr->istrings[i], it, &trouve);
if (!trouve) {
- exception(1, _("Syntax error in meta language"));
+ t = (expression_t *) Emalloc(sizeof(expression_t));
+ t->e_type = t->e_subtype = E_VALUE;
+ t->avalue = 0;
+ t->child = t->next = NULL;
+ t->pattern = NULL;
+ fprintf(stderr, "Insertion de la variable %s, de valeur %i.\n", instr->istrings[i], t->avalue);
}
InsererVarDansTab(&it, CreerElement(instr->implicits[i], t));
break;
diff --git a/lib/instructions.txt b/lib/instructions.txt
index 494ca47..becfc21 100644
--- a/lib/instructions.txt
+++ b/lib/instructions.txt
@@ -67,8 +67,8 @@ I:SHR c1=.Pr,c2=.Pr,.I=.C;op=0x7;e=0x1
I:MOV c1=.Pr,rm=.Pm;op=8;e=0;c2=.Fa;c3=regop
I:MOV c1=.Pr,c3=.Pr;op=8;e=0;c2=0
I:MOV c1=.Pr,.I=.C;op=8;e=1
-I:MOV c2=.Pm,rm=.Pr;op=8;e=2;c1=.Fa;c3=regop
-I:MOV c2=.Pm,.I=.C;op=8;e=3;c1=.Fa;c3=regop
+I:MOV rm=.Pm,c2=.Pr;op=8;e=2;c1=.Fa;c3=regop
+I:MOV rm=.Pm,.I=.C;op=8;e=3;c1=.Fa;c3=regop
p:MV=MOV
diff --git a/po/ProjetArchi.pot b/po/ProjetArchi.pot
index ce20811..04eac5d 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 19:31+0200\n"
+"POT-Creation-Date: 2001-04-15 20:17+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"
@@ -123,113 +123,109 @@ msgstr ""
msgid "Something wrong, should never got here..."
msgstr ""
-#: lib/assembler.c:1255
+#: lib/assembler.c:1259
msgid "Unknow predefined string into the meta language"
msgstr ""
-#: lib/assembler.c:1312
+#: lib/assembler.c:1316
msgid "Pattern not matching..."
msgstr ""
-#: lib/assembler.c:1325 lib/assembler.c:1358 lib/assembler.c:1619
-#: lib/assembler.c:1637 lib/assembler.c:1653 lib/assembler.c:1668
+#: lib/assembler.c:1329 lib/assembler.c:1362 lib/assembler.c:1623
+#: lib/assembler.c:1641 lib/assembler.c:1657 lib/assembler.c:1672
msgid "Unknow constant type in the meta language"
msgstr ""
-#: lib/assembler.c:1338 lib/assembler.c:1382 lib/assembler.c:1412
+#: lib/assembler.c:1342 lib/assembler.c:1386 lib/assembler.c:1416
msgid ""
"Error in the metalanguage (pattern should be here if not a constant type)"
msgstr ""
-#: lib/assembler.c:1370 lib/assembler.c:1398 lib/assembler.c:1406
-#: lib/assembler.c:1691
+#: lib/assembler.c:1374 lib/assembler.c:1402 lib/assembler.c:1410
+#: lib/assembler.c:1701
msgid "Logical error in meta language"
msgstr ""
-#: lib/assembler.c:1441
+#: lib/assembler.c:1445
msgid "Unknow field in metalanguage"
msgstr ""
-#: lib/assembler.c:1455
+#: lib/assembler.c:1459
msgid "Can't evaluate directly expression"
msgstr ""
-#: lib/assembler.c:1462
+#: lib/assembler.c:1466
msgid "Value too large for field"
msgstr ""
-#: lib/assembler.c:1516 lib/assembler.c:1717
+#: lib/assembler.c:1520 lib/assembler.c:1727
msgid "Unknow instruction"
msgstr ""
-#: lib/assembler.c:1541
+#: lib/assembler.c:1545
msgid "Unknow constant"
msgstr ""
-#: lib/assembler.c:1550
+#: lib/assembler.c:1554
msgid "Bad constant for an immediate value"
msgstr ""
-#: lib/assembler.c:1567
+#: lib/assembler.c:1571
msgid "Bad constant for a string"
msgstr ""
-#: lib/assembler.c:1584
+#: lib/assembler.c:1588
msgid "Bad array size"
msgstr ""
-#: lib/assembler.c:1593
+#: lib/assembler.c:1597
msgid "You can only have an instruction into a .text segment"
msgstr ""
-#: lib/assembler.c:1596
+#: lib/assembler.c:1600
msgid "Unmatched instruction"
msgstr ""
-#: lib/assembler.c:1645
+#: lib/assembler.c:1649
msgid "Can't have a direct value for a relative offset"
msgstr ""
-#: lib/assembler.c:1683
-msgid "Syntax error in meta language"
-msgstr ""
-
-#: lib/assembler.c:1756
+#: lib/assembler.c:1766
msgid "Loading file"
msgstr ""
-#: lib/assembler.c:1757 lib/meta.c:516
+#: lib/assembler.c:1767 lib/meta.c:516
#, c-format
msgid "Opening file '%s'"
msgstr ""
-#: lib/assembler.c:1765 lib/meta.c:524
+#: lib/assembler.c:1775 lib/meta.c:524
msgid "Reading file"
msgstr ""
-#: lib/assembler.c:1767 lib/meta.c:526
+#: lib/assembler.c:1777 lib/meta.c:526
#, c-format
msgid "Reading line %i"
msgstr ""
-#: lib/assembler.c:1776
+#: lib/assembler.c:1786
#, c-format
msgid "Summering line %s"
msgstr ""
-#: lib/assembler.c:1792
+#: lib/assembler.c:1802
msgid "Opening output file"
msgstr ""
-#: lib/assembler.c:1795
+#: lib/assembler.c:1805
msgid "Error writing output file"
msgstr ""
-#: lib/assembler.c:1799
+#: lib/assembler.c:1809
msgid "Error reading file"
msgstr ""
-#: lib/assembler.c:1801
+#: lib/assembler.c:1811
msgid "Writing output file"
msgstr ""
@@ -395,6 +391,7 @@ msgstr ""
msgid "Signal received: segfault"
msgstr ""
+#. signal(SIGSEGV, segfaulthand);
#: src/compilo.c:54
msgid ""
"\n"
diff --git a/po/cat-id-tbl.c b/po/cat-id-tbl.c
index 7188a69..e650a97 100644
--- a/po/cat-id-tbl.c
+++ b/po/cat-id-tbl.c
@@ -51,69 +51,68 @@ Error in the metalanguage (pattern should be here if not a constant type)", 31},
{"You can only have an instruction into a .text segment", 41},
{"Unmatched instruction", 42},
{"Can't have a direct value for a relative offset", 43},
- {"Syntax error in meta language", 44},
- {"Loading file", 45},
- {"Opening file '%s'", 46},
- {"Reading file", 47},
- {"Reading line %i", 48},
- {"Summering line %s", 49},
- {"Opening output file", 50},
- {"Error writing output file", 51},
- {"Error reading file", 52},
- {"Writing output file", 53},
- {"Internal error into hashing", 54},
- {"Read line '%s'", 55},
- {"Analysing word '%s'", 56},
- {"Missing operator ':'", 57},
- {"Invalid number.", 58},
- {"Expecting ';' for field separator.", 59},
- {"Expecting ',' for field separator.", 60},
- {"Identifier incorrect.", 61},
- {"Error: Expecting a . after a =", 62},
- {"Extra parameters for field 'p'.", 63},
- {"Unexpected char at end of line.", 64},
- {"Expecting operator '=' for field 'p'.", 65},
- {"Error: character . expected.", 66},
- {"= expected after an implicit name", 67},
- {"Identifier incorrect", 68},
- {"expecting ; as field separator", 69},
- {"Loading meta file", 70},
- {"Meta parser init failed.", 71},
- {"Too many nested operators in expression.\n", 72},
- {"Too many nested functions calls in expression.\n", 73},
- {"Invalid unary operator", 74},
- {"Invalid binary operator", 75},
- {"Parse error: too much left parenthesis", 76},
- {"Parse error: too much right parenthesis", 77},
- {"Parse error: enclosure mismatch", 78},
- {"Invalid character", 79},
- {"Out of memory.", 80},
- {"Too much error contexts during pushcontext().", 81},
- {"Error context empty, but popcontext() called.", 82},
- {"FPU not implemented", 83},
+ {"Loading file", 44},
+ {"Opening file '%s'", 45},
+ {"Reading file", 46},
+ {"Reading line %i", 47},
+ {"Summering line %s", 48},
+ {"Opening output file", 49},
+ {"Error writing output file", 50},
+ {"Error reading file", 51},
+ {"Writing output file", 52},
+ {"Internal error into hashing", 53},
+ {"Read line '%s'", 54},
+ {"Analysing word '%s'", 55},
+ {"Missing operator ':'", 56},
+ {"Invalid number.", 57},
+ {"Expecting ';' for field separator.", 58},
+ {"Expecting ',' for field separator.", 59},
+ {"Identifier incorrect.", 60},
+ {"Error: Expecting a . after a =", 61},
+ {"Extra parameters for field 'p'.", 62},
+ {"Unexpected char at end of line.", 63},
+ {"Expecting operator '=' for field 'p'.", 64},
+ {"Error: character . expected.", 65},
+ {"= expected after an implicit name", 66},
+ {"Identifier incorrect", 67},
+ {"expecting ; as field separator", 68},
+ {"Loading meta file", 69},
+ {"Meta parser init failed.", 70},
+ {"Too many nested operators in expression.\n", 71},
+ {"Too many nested functions calls in expression.\n", 72},
+ {"Invalid unary operator", 73},
+ {"Invalid binary operator", 74},
+ {"Parse error: too much left parenthesis", 75},
+ {"Parse error: too much right parenthesis", 76},
+ {"Parse error: enclosure mismatch", 77},
+ {"Invalid character", 78},
+ {"Out of memory.", 79},
+ {"Too much error contexts during pushcontext().", 80},
+ {"Error context empty, but popcontext() called.", 81},
+ {"FPU not implemented", 82},
{"\
Assembler\n\
-\n", 84},
- {" o Initialising the meta engine... ", 85},
+\n", 83},
+ {" o Initialising the meta engine... ", 84},
{"\
Done!\n\
- o Meta language loading... ", 86},
- {"Meta language loading failed.", 87},
+ o Meta language loading... ", 85},
+ {"Meta language loading failed.", 86},
{"\
Done!\n\
- o Initialising the assembler core...", 88},
- {"Assembler core init failed.", 89},
- {" Done!\n", 90},
- {"Signal received: segfault", 91},
+ o Initialising the assembler core...", 87},
+ {"Assembler core init failed.", 88},
+ {" Done!\n", 89},
+ {"Signal received: segfault", 90},
{"\
\n\
Performing initialisation...\n\
-\n", 92},
+\n", 91},
{"\
\n\
Performing shutdown...\n\
-\n", 93},
- {"Exitting, bye!\n", 94},
+\n", 92},
+ {"Exitting, bye!\n", 93},
};
-int _msg_tbl_length = 94;
+int _msg_tbl_length = 93;
diff --git a/src/compilo.c b/src/compilo.c
index 278f339..3f214a6 100644
--- a/src/compilo.c
+++ b/src/compilo.c
@@ -49,7 +49,7 @@ void segfaulthand(int i) {
int main(void) {
invite();
- signal(SIGSEGV, segfaulthand);
+/* signal(SIGSEGV, segfaulthand);*/
fprintf(stderr, _("\nPerforming initialisation...\n\n"));
init_all();