File: lists.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 (106 lines) | stat: -rw-r--r-- 2,518 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
/**********************************************
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_LISTS
#define _C_LISTS
#include "low_sch1.h"
#include <rscheme/vinsns.h>
extern struct module_descr module_low_scheme;
extern struct part_descr low_scheme_part_lists;
static char sccsid[] = "@(#)low-scheme modules/lowscm/lists.scm[13643776] (RS v0.7.2, 97.12.21)";

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


/*************************** Function `length' ***************************/
static char rsfn_length_name[] = "length";
#define FUNCTION rsfn_length_name

PROLOGUE(length)

BEGIN_FWD(length)
  FWD_MONOTONE(length_0)
  FWD_MONOTONE(length_1)
END_FWD(length)

#define FPLACE_CODE (1000+0)
MONOTONE(length_0)
{
    COUNT_ARGS(1);
    /* NOP: REG0 = REG0; */
    REG1 = int2fx(0);
    REG2 = REG0 /* lst */;
    JUMP(3,length_1);
}
#undef FPLACE_CODE

#define FPLACE_CODE (1000+1)
MONOTONE(length_1)
{
    /* NOP: REG2 = REG2; */
    /* NOP: REG1 = REG1; */
    if (PAIR_P(REG2 /* l */))
    {
	    REG3 = ADD1(REG1 /* i */);
	    REG4 = checked_cdr(REG2 /* l */);
	    /* NOP: REG3 = REG3; */
	    /* NOP: REG4 = REG4; */
	    REG1 = REG3;
	    REG2 = REG4;
	    BJUMP(3,length_1);
    }
    else
    {
	    if (NULL_P(REG2 /* l */))
	    {
	    REG0 = REG1 /* i */;
	    RETURN1();
	    }
	    else
	    {
	    REG2 = REG0 /* lst */;
	    REG0 = TLREF(0) /* length */;
	    REG1 = int2fx(0);
	    REG3 = LITERAL(1) /* "not a proper list" */;
	    APPLYF(4,TLREF(2) /* type-error */);
	    }
    }
}
#undef FPLACE_CODE

EPILOGUE(length)

BEGIN_BACK(length)
  BACK_MONOTONE(length_0)
  BACK_MONOTONE(length_1)
END_BACK(length)

static struct function_descr length_descr = {
	&low_scheme_part_lists,
	JUMP_TABLE( length ),
	rsfn_length_name };
#undef FUNCTION

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


static struct function_descr *(part_lists_tab[]) = {
    &length_descr,
    NULL };
struct part_descr low_scheme_part_lists = {
    13643776,
    &module_low_scheme,
    part_lists_tab,
    "lists",
    0 };
#undef _MODULE_LOW_SCHEME
#undef _SCM_LISTS
#undef _C_LISTS