File: append.c

package info (click to toggle)
rscheme 0.7.2-1.1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 10,672 kB
  • ctags: 12,430
  • sloc: lisp: 37,104; ansic: 29,763; cpp: 2,630; sh: 1,677; makefile: 568; yacc: 202; lex: 175; perl: 33
file content (239 lines) | stat: -rw-r--r-- 5,381 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
/**********************************************
THIS FILE WAS AUTOMATICALLY GENERATED, AND MAY
BE AUTOMATICALLY RE-GENERATED WHEN THE COMPILER
OR SOURCE CHANGES.  DO NOT MODIFY THIS FILE BY HAND!
RScheme Build (v0.7.2, 97.12.21)
**********************************************/

/******************************** Preamble ********************************/

#define _MODULE_LOW_SCHEME
#define _SCM_APPEND
#define _C_APPEND
#include "low_sch1.h"
#include <rscheme/vinsns.h>
extern struct module_descr module_low_scheme;
extern struct part_descr low_scheme_part_append;
static char sccsid[] = "@(#)low-scheme modules/lowscm/append.scm[314366978] (RS v0.7.2, 97.12.21)";

/************************** Function Definitions **************************/


/************************** Function `append-2' **************************/
static char rsfn_append_2_name[] = "append-2";
#define FUNCTION rsfn_append_2_name

PROLOGUE(append_2)

BEGIN_FWD(append_2)
  FWD_MONOTONE(append_2_0)
  FWD_MONOTONE(append_2_1)
END_FWD(append_2)

#define FPLACE_CODE (1000+0)
MONOTONE(append_2_0)
{
    COUNT_ARGS(2);
    /* NOP: REG1 = REG1; */
    /* NOP: REG0 = REG0; */
    if (PAIR_P(REG0 /* lst1 */))
    {
	    REG2 = cons(checked_car(REG0 /* lst1 */),NIL_OBJ);
	    /* NOP: REG2 = REG2; */
	    REG3 = REG2 /* first */;
	    REG4 = checked_cdr(REG0 /* lst1 */);
	    /* NOP: REG3 = REG3; */
	    /* NOP: REG4 = REG4; */
	    JUMP(5,append_2_1);
    }
    else
    {
	    REG0 = REG1 /* lst2 */;
	    RETURN1();
    }
}
#undef FPLACE_CODE

#define FPLACE_CODE (1000+1)
MONOTONE(append_2_1)
{
    /* NOP: REG4 = REG4; */
    /* NOP: REG3 = REG3; */
    if (PAIR_P(REG4 /* src */))
    {
	    REG5 = REG4 /* src */;
	    REG6 = cons(checked_car(REG5 /* s */),NIL_OBJ);
	    /* NOP: REG6 = REG6; */
	    pair_set_cdr(REG3 /* prev */,REG6 /* c */);
	    REG7 = REG6 /* c */;
	    REG8 = checked_cdr(REG5 /* s */);
	    /* NOP: REG7 = REG7; */
	    /* NOP: REG8 = REG8; */
	    REG3 = REG7;
	    REG4 = REG8;
	    BJUMP(5,append_2_1);
    }
    else
    {
	    pair_set_cdr(REG3 /* prev */,REG1 /* lst2 */);
	    REG0 = REG2 /* first */;
	    RETURN1();
    }
}
#undef FPLACE_CODE

EPILOGUE(append_2)

BEGIN_BACK(append_2)
  BACK_MONOTONE(append_2_0)
  BACK_MONOTONE(append_2_1)
END_BACK(append_2)

static struct function_descr append_2_descr = {
	&low_scheme_part_append,
	JUMP_TABLE( append_2 ),
	rsfn_append_2_name };
#undef FUNCTION


/************************** Function `append-n' **************************/
static char rsfn_append_n_name[] = "append-n";
#define FUNCTION rsfn_append_n_name

PROLOGUE(append_n)

BEGIN_FWD(append_n)
  FWD_MONOTONE(append_n_0)
  FWD_MONOTONE(append_n_1)
END_FWD(append_n)

#define FPLACE_CODE (1000+0)
MONOTONE(append_n_0)
{
    COUNT_ARGS(2);
    /* NOP: REG1 = REG1; */
    /* NOP: REG0 = REG0; */
    if (NULL_P(REG1 /* more-lists */))
    {
	    /* NOP: REG0 = REG0; */
	    RETURN1();
    }
    else
    {
	    REG2 = REG0 /* list-1 */;
	    SAVE_CONT3(append_n_1);
	    REG3 = checked_car(REG1 /* more-lists */);
	    REG4 = checked_cdr(REG1 /* more-lists */);
	    REG0 = REG3;
	    REG1 = REG4;
	    APPLY(2,TLREF(0) /* append-n */);
    }
}
#undef FPLACE_CODE

#define FPLACE_CODE (1000+1)
MONOTONE(append_n_1)
{
    REG3 = REG0;
    RESTORE_CONT3();
    /* NOP: REG3 = REG3; */
    REG0 = REG2;
    REG1 = REG3;
    APPLYF(2,TLREF(1) /* append-2 */);
}
#undef FPLACE_CODE

EPILOGUE(append_n)

BEGIN_BACK(append_n)
  BACK_MONOTONE(append_n_0)
  BACK_MONOTONE(append_n_1)
END_BACK(append_n)

static struct function_descr append_n_descr = {
	&low_scheme_part_append,
	JUMP_TABLE( append_n ),
	rsfn_append_n_name };
#undef FUNCTION


/*************************** Function `append' ***************************/
static char rsfn_append_name[] = "append";
#define FUNCTION rsfn_append_name

PROLOGUE(append)

BEGIN_FWD(append)
  FWD_MONOTONE(append_0)
END_FWD(append)

#define FPLACE_CODE (1000+0)
MONOTONE(append_0)
{
    COLLECT0();
    /* NOP: REG0 = REG0; */
    if (PAIR_P(REG0 /* lists */))
    {
	    if (PAIR_P(checked_cdr(REG0 /* lists */)))
	    {
	    if (PAIR_P(checked_cdr(checked_cdr(REG0 /* lists */))))
	    {
		    REG1 = checked_car(REG0 /* lists */);
		    REG2 = checked_cdr(REG0 /* lists */);
		    REG0 = REG1;
		    REG1 = REG2;
		    APPLYF(2,TLREF(0) /* append-n */);
	    }
	    else
	    {
		    REG1 = checked_car(REG0 /* lists */);
		    REG2 = checked_car(checked_cdr(REG0 /* lists */));
		    REG0 = REG1;
		    REG1 = REG2;
		    APPLYF(2,TLREF(1) /* append-2 */);
	    }
	    }
	    else
	    {
	    REG0 = checked_car(REG0 /* lists */);
	    RETURN1();
	    }
    }
    else
    {
	    REG0 = NIL_OBJ;
	    RETURN1();
    }
}
#undef FPLACE_CODE

EPILOGUE(append)

BEGIN_BACK(append)
  BACK_MONOTONE(append_0)
END_BACK(append)

static struct function_descr append_descr = {
	&low_scheme_part_append,
	JUMP_TABLE( append ),
	rsfn_append_name };
#undef FUNCTION

/******************************* Postamble *******************************/
/**************************** Part Link Table ****************************/


static struct function_descr *(part_append_tab[]) = {
    &append_2_descr,
    &append_n_descr,
    &append_descr,
    NULL };
struct part_descr low_scheme_part_append = {
    314366978,
    &module_low_scheme,
    part_append_tab,
    "append",
    0 };
#undef _MODULE_LOW_SCHEME
#undef _SCM_APPEND
#undef _C_APPEND