-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproc.hpp
138 lines (118 loc) · 6.21 KB
/
proc.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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// File: proc.hpp
// Author: Samuel McFalls
#include <vector>
#include "interpreter_semantic_error.hpp"
#include "atom.hpp"
// unary expression of Booleans
// @param args The arguments to the procedure. Required BOOL type
// @return The logical negation of the argument
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if arguments are of incorrect type
bool notProc(std::vector<Atom> args);
// m-ary expression of Booleans There is no short circuit.
// All expressions are evaluated.
// @param args The arguments to the procedure. Required BOOL type
// @return The logical conjunction of the arguments
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if arguments are of incorrect type
bool andProc(std::vector<Atom> args);
// m-ary expression of Booleans
// There is no short circuit. All expressions are evaluated.
// @param args The arguments to the procedure. Required BOOL type
// @return The logical disjunction of the arguments
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if arguments are of incorrect type
bool orProc(std::vector<Atom> args);
// binary expression of Numbers
// @param args The arguments to the procedure. Required NUMBER type
// @return True if the first argument is numerically less than the
// second, else False
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if arguments are of incorrect type
bool ltProc(std::vector<Atom> args);
// binary expression of Numbers
// @param args The arguments to the procedure. Required NUMBER type
// @return True if the first argument is numerically less than or equal
// to the second, else False
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if arguments are of incorrect type
bool lteProc(std::vector<Atom> args);
// binary expression of Numbers
// @param args The arguments to the procedure. Required NUMBER type
// @return True if the first argument is numerically greater than the second, else False
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if arguments are of incorrect type
bool gtProc(std::vector<Atom> args);
// binary expression of Numbers
// @param args The arguments to the procedure. Required NUMBER type
// @return True if the first argument is numerically greater than or equal to the second, else False
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if arguments are of incorrect type
bool gteProc(std::vector<Atom> args);
// binary expression of Numbers
// @param args The arguments to the procedure. Required NUMBER type
// @return True if the first argument is numerically equal to the second,, else False
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if arguments are of incorrect type
bool equalProc(std::vector<Atom> args);
// m-ary expression of Numbers
// @param args The arguments to the procedure. Required NUMBER type
// @return the sum of the arguments
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if arguments are of incorrect type
double sumProc(std::vector<Atom> args);
// unary/binary expression of Numbers
// @param args The arguments to the procedure. Required NUMBER type
// @return (if unary) the negative of the argument
// (if binary) the first argument minus the second
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if arguments are of incorrect type
double subProc(std::vector<Atom> args);
// m-ary expression of Number arguments
// @param args The arguments to the procedure. Required NUMBER type
// @return the product of the arguments
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if arguments are of incorrect type
double multProc(std::vector<Atom> args);
// binary expression of Numbers
// @param args The arguments to the procedure. Required NUMBER type
// @return the first argument divided by the second
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if arguments are of incorrect type
double divProc(std::vector<Atom> args);
// unary expression of Numbers
// @param args The arguments to the procedure. Required NUMBER type
// @return the sin of the argument
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if argumet is of incorrect type
double sinProc(std::vector<Atom> args);
// unary expression of Numbers
// @param args The arguments to the procedure. Required NUMBER type
// @return the cos of the argument
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if argumet is of incorrect type
double cosProc(std::vector<Atom> args);
// binary expression of Numbers
// @param args The arguments to the procedure. Required NUMBER type
// @return the arctan of the arguments, 1 - y, 2 - x
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if argumets are of incorrect type
double arctanProc(std::vector<Atom> args);
// binary expression of Numbers
// @param args The arguments to the procedure. Required NUMBER type
// @return a point from the given coordinates
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if argumets are of incorrect type
Point pointProc(std::vector<Atom> args);
// binary expression of Point
// @param args The arguments to the procedure. Required NUMBER type
// @return a line from the given points
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if argumets are of incorrect type
Line lineProc(std::vector<Atom> args);
// tertiary expression of Points and a Number
// @param args The arguments to the procedure. Required POINT POINT NUMBER
// @return an arc from the given points and number
// @throw InterpreterSemanticError if improper number of arguments
// @throw InterpreterSemanticError if argumets are of incorrect type
Arc arcProc(std::vector<Atom> args);