-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore.h
85 lines (60 loc) · 1.84 KB
/
core.h
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
/*
Copyright © 2008, 2009 Sam Chapin
This file is part of Gospel.
Gospel is free software: you can redistribute it and/or modify
it under the terms of version 3 of the GNU General Public License
as published by the Free Software Foundation.
Gospel is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Gospel. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CORE_H
#define CORE_H
// These need to be seen by both Flex and Bison.
#define YYSTYPE void *
#define YYLTYPE YYLTYPE
typedef struct YYLTYPE {
int first_line;
int first_column;
int last_line;
int last_column;
} YYLTYPE;
#include <stdio.h>
#define YY_DECL int yylex(YYSTYPE *value, YYLTYPE *location, int *nesting, yyscan_t yyscanner)
int yylex(YYSTYPE *, YYLTYPE *, int *, void *);
#include "gc.h"
obj integer(int);
int integerValue(obj);
obj symbol(const char *c);
obj intern(obj);
obj message(obj, obj, vector);
obj setMessageTarget(obj, obj);
obj blockLiteral(vector, vector);
obj block(obj, obj);
obj quote(obj);
obj call(obj, obj, vector);
vector emptyVector;
vector vectorAppend(vector, vector);
obj appendStrings(obj, obj);
obj expressionSequence(vector);
typedef vector pair;
#define emptyList 0
pair cons(void *, void *);
void *car(pair);
void *cdr(pair);
vector setcar(pair, void *);
vector setcdr(pair, void *);
pair list(void *);
int length(pair);
pair listToVector(pair);
pair map(void *, pair);
pair nreverse(pair);
int isEmpty(vector);
void dispatch(void);
obj callWithEnvironment(obj, obj, obj, vector);
void setupInterpreter(void);
void *loadFile(const char *, obj, obj);
#endif