Ads by Google
新しい記事を書く事で広告が消せます。
私は知識に何ものかを付け加え,また他の人々がより多くのものを付け加える手助けをした --- G.H.ハーディ
enum ETC_DATA_TAG {
/* プログラム全体において,配列の 0 番目には,
配列の長さが入っている (Pascal 文字列) ので,絶対に使用されない
* (NULL ポインタ代わりとしても使用できる) */
NIL = 0,
INT,
REAL,
CHAR,
SYM,
PVAR,
IVAR,
ARRAY,
STR,
PTR,
CONS
};
$ ./etc "{?~(1 -2 3) {a r r a y} ?~(*x *y *z~(a b c))}"
----------------------------------------------------------
String : "{?~(1 -2 3) {a r r a y} ?~(*x *y *z~(a b c))}"
Array : {104, PTR, 21, STR, 1, '?', CONS, INT, 1, PTR, 11,
CONS, INT, -2, PTR, 16, CONS, INT, 3, NIL, 0, IVAR, 3, 6,
SYM, 26, STR, 1, 'a', SYM, 31, STR, 1, 'r', SYM, 31, SYM,
26, SYM, 40, STR, 1, 'y', ARRAY, 5, 24, 29, 34, 36, 38,
PTR, 97, CONS, PVAR, 57, PTR, 60, STR, 1, 'x', CONS,
PVAR, 40, PTR, 65, CONS, PTR, 94, NIL, 0, STR, 1, 'z',
CONS, SYM, 26, PTR, 78, CONS, SYM, 83, PTR, 86, STR, 1,
'b', CONS, SYM, 91, NIL, 0, STR, 1, 'c', IVAR, 70, 73,
IVAR, 3, 52, ARRAY, 3, 1, 43, 50}
Prity print : Array : {
length : 104
1 (p 21)
3 str
4 length : 1
5 ?
6 cons
7 (i 1)
9 (p 11)
11 cons
12 (i -2)
14 (p 16)
16 cons
17 (i 3)
19 ()
21 (ivar (p 3) ~ (p 6))
24 (sym (p 26))
26 str
27 length : 1
28 a
29 (sym (p 31))
31 str
32 length : 1
33 r
34 (sym (p 31))
36 (sym (p 26))
38 (sym (p 40))
40 str
41 length : 1
42 y
43 array
44 length : 5
45 (p 24)
46 (p 29)
47 (p 34)
48 (p 36)
49 (p 38)
50 (p 97)
52 cons
53 (pvar (p 57))
55 (p 60)
57 str
58 length : 1
59 x
60 cons
61 (pvar (p 40))
63 (p 65)
65 cons
66 (p 94)
68 ()
70 str
71 length : 1
72 z
73 cons
74 (sym (p 26))
76 (p 78)
78 cons
79 (sym (p 83))
81 (p 86)
83 str
84 length : 1
85 b
86 cons
87 (sym (p 91))
89 ()
91 str
92 length : 1
93 c
94 (ivar (p 70) ~ (p 73))
97 (ivar (p 3) ~ (p 52))
100 array
101 length : 3
102 (p 1)
103 (p 43)
104 (p 50)
}
Symbolic expression => { ?~(1 -2 3) { a r r a y } ?~(*x *y *z~(a b c)) }
----------------------------------------------------------
struct information_variable {
Word data_tag; // 全オブジェクト共通
Word index_to_str;
Word index_to_SExp;
};
struct information_variable {
Byte data_tag;
Byte index_to_str1;
Byte index_to_str2;
Byte index_to_str3;
Byte index_to_str4;
Byte index_to_SExp1;
Byte index_to_SExp2;
Byte index_to_SExp3;
Byte index_to_SExp4;
};