-
Notifications
You must be signed in to change notification settings - Fork 0
/
Eval.h
57 lines (45 loc) · 1.34 KB
/
Eval.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
#ifndef __EVAL_H__
#define __EVAL_H__
///////////////////////////////////////////////////////////////////////////////
/// @file Eval.h
/// @n Eval.h includes the blueprint of the class Eval which
/// evaluates functions in LISP interpreter.
///
/// @author Asvin Vaidyanath Ganesh
///
/// @version 001 - 19Oct2013 - Asvin Vaidyanath Ganesh //001
///
///////////////////////////////////////////////////////////////////////////////
#include "Tree.h"
class Eval
{
public:
int def;
SExp* cons(SExp* p1, SExp* p2);
SExp* car(SExp* s);
SExp* cdr(SExp* s);
SExp* atom(SExp* s);
SExp* Int(SExp* s);
SExp* eq(SExp* p1, SExp* p2);
SExp* isNull(SExp* s);
SExp* plus(SExp* p1, SExp* p2);
SExp* minus(SExp* p1, SExp* p2);
SExp* times(SExp* p1, SExp* p2);
SExp* remainder(SExp* p1, SExp* p2);
SExp* greater(SExp* p1, SExp* p2);
SExp* less(SExp* p1, SExp* p2);
SExp* quotient(SExp* p1, SExp* p2);
int isKeyword(SExp* s);
SExp* bound(SExp* p1, SExp* p2);
SExp* getVal(SExp* p1, SExp* p2);
SExp* getFunc(SExp* p1, Tree* p2);
SExp* addPairs(SExp* p, SExp* x,SExp* a);
SExp* eval_list(SExp* l, SExp* a,Tree* d);
SExp* eval_con(SExp* be, SExp* a,Tree* d);
SExp* eval(SExp* exp, SExp* a,Tree* d);
SExp* apply(SExp* f, SExp* x, SExp* a,Tree* d);
public:
Eval(){def = 0;}
~Eval(){}
};
#endif