forked from blakemcbride/PSL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhd.l
98 lines (85 loc) · 2.16 KB
/
hd.l
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
FILE *inputf;
FILE *outputf;
char tx[TXSIZE];
char yytext[128];
int traceable = 0; /*trace apply */
unsigned currcol = 0;
unsigned lineln = 72;
unsigned currlin = 0;
unsigned pageln = 0;
unsigned delimflag;
unsigned digitcnt = 0; /* # of digits of parsed integer. */
long *arit1; /* pointer to arith array. used by big arith */
long *arit2; /* routines */
unsigned arit1sz = 100; /* sizes of these arrays */
unsigned arit2sz = 100;
unsigned gensymcounter = 0;
unsigned gcpage; /*used in gc. collection T.Y. */
unsigned chrcount = 0; /*counts # of characters in p-name space */
unsigned strcount = 0; /*counts # of characters in string space */
unsigned atompgc; /*GC on atom's print name space*/
unsigned strgc; /*GC on string space*/
#if DSTACK
int stacksize = STACKSIZE; /*local stack size*/
#endif
unsigned ALISTLENGTH = 8192; /*alist stack length*/
unsigned PNSLENGTH = 24000; /*atom's print name space*/
unsigned STRLENGTH = 8500; /*string space length*/
unsigned maxpair = 1440; /*max empty work space if possible*/
unsigned maxpage = 5; /*max pages allocated without GC */
PAIR dummypair = {
Tpair, NIL, NIL
};
BIG dummybig = {
Tbig, 0L, NIL
};
PSTRING dummystrptr;
INTEGER small_num[9] = {
{Tinteger, -1L},
{Tinteger, 0L}, /* frequently used numbers TY*/
{Tinteger, 1L},
{Tinteger, 2L},
{Tinteger, 3L},
{Tinteger, 4L},
{Tinteger, 5L},
{Tinteger, 6L},
{Tinteger, 7L}
};
ERRMSG forprog = {
Terrmsg, 0, NIL
};
PALISTENT alist;
PALISTENT alisttop, zalisttop;
PPAGE pages[NTYPES], cpages[NTYPES];
PPAGE freepages;
unsigned sz[NTYPES] = {
sizeof(PAIR),
sizeof(ID),
sizeof(STRING),
sizeof(INTEGER),
sizeof(BIG),
sizeof(FLOATING),
sizeof(VECTOR)
};
unsigned gcfree[NTYPES];
unsigned npages;
unsigned tnpages[NTYPES];
PCHAR pnmchp, strchp, startpns, startstr;
#if DSTACK
PPSEXP zstackp, zstackptr;
#else
PSEXP zstackp[STACKSIZE];
int zstackptr = -1;
#endif
#if SLOWSTACK
#if DSTACK
void kpops();
#endif
void ksets();
void kloads();
#endif
ERRORTRAP trap[30];
ERRORTRAP *curtrap = trap;
char *curpos;
PSEXP registers[16];
char *environment = NULL;