-
Notifications
You must be signed in to change notification settings - Fork 4
/
SList.hpp
57 lines (43 loc) · 1.03 KB
/
SList.hpp
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
//
// SList.hpp
// Scheme++
//
// Created by Josh Sun on 2017-05-10.
// Copyright © 2017 Josh Sun. All rights reserved.
//
#ifndef SList_hpp
#define SList_hpp
#include <vector>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <iostream>
class SList {
public:
typedef SList (*proc)(const std::vector<SList>&);
enum sType {SYMBOL, NUMBER, LIST, PROC, LAMBDA};
void push(SList s);
std::string getPrintString() const;
size_t size() const;
sType getType() const;
void setType(sType t);
std::string val() const;
std::vector<SList> getList () const;
std::string listToString();
proc getProc() const;
void pushList(std::vector<SList> s);
std::string getTypeString() const;
SList();
SList(sType type);
SList(std::string s);
SList(double s);
SList(std::vector<SList> s);
SList(proc s);
private:
std::string value;
std::vector<SList> list;
proc p;
sType type;
};
typedef std::vector<SList> SLists;
#endif /* SList_hpp */