ラベル追加で、プログラム名未設定時に初期化されないバグを修正
[YACASL2.git] / test / unit / addcerrlist / addcerrlist.c
1 #include <stdio.h>
2 #include "casl2.h"
3
4 CERRARRAY cerr_0[] = {
5     { 126, "source file is not specified" },
6 };
7
8 CERRARRAY cerr_1[] = {
9     { 101, "label already defined" },
10     { 102, "label table is full" },
11     { 103, "label not found" },
12     { 104, "label length is too long" },
13     { 105, "no command in the line" },
14     { 106, "operand mismatch in assemble command" },
15     { 107, "no label in START" },
16     { 108, "not command of operand \"r\"" },
17     { 109, "not command of operand \"r1,r2\"" },
18     { 110, "not command of operand \"r,adr[,x]\"" },
19     { 111, "not command of operand \"adr[,x]\"" },
20     { 112, "not command of no operand" },
21     { 113, "operand too many in COMET II command" },
22     { 117, "operand too many in DC" },
23     { 118, "operand length too long" },
24     { 119, "out of COMET II memory" },
25     { 120, "GR0 in operand x" },
26     { 121, "cannot get operand token" },
27     { 122, "cannot create hash table" },
28     { 123, "unclosed quote" },
29     { 124, "more than one character in literal" },
30     { 125, "not GR in operand x" },
31 };
32
33 CERRARRAY cerr_2[] = {
34     { 114, "not integer" },
35     { 115, "not hex" },
36     { 116, "out of hex range" },
37 };
38
39 CERRARRAY cerr_3[] = {
40     { 114, "not integer" },
41     { 115, "not hex" },
42     { 116, "out of hex range" },
43 };
44
45 CERRARRAY cerr_4[] = {
46     { 201, "Load object file - full of COMET II memory" },
47 };
48
49 CERRARRAY cerr_5[] = {
50     { 202, "SVC input - out of Input memory" },
51     { 203, "SVC output - out of COMET II memory" },
52     { 204, "Program Register (PR) - out of COMET II memory" },
53     { 205, "Stack Pointer (SP) - cannot allocate stack buffer" },
54     { 206, "Address - out of COMET II memory" },
55     { 207, "Stack Pointer (SP) - out of COMET II memory" },
56 };
57
58 int main(){
59     CERRLIST *p;
60     addcerrlist(ARRAYSIZE(cerr_0), cerr_0);
61     addcerrlist(ARRAYSIZE(cerr_1), cerr_1);
62     addcerrlist(ARRAYSIZE(cerr_2), cerr_2);
63     addcerrlist(ARRAYSIZE(cerr_3), cerr_3);
64     addcerrlist(ARRAYSIZE(cerr_4), cerr_4);
65     addcerrlist(ARRAYSIZE(cerr_5), cerr_5);
66     for(p = cerr; p != NULL; p = p->next) {
67         printf("%d: %s\n", p->err->num, p->err->msg);
68     }
69     return 0;
70 }