-
Notifications
You must be signed in to change notification settings - Fork 0
/
thegerk.h
87 lines (69 loc) · 2.47 KB
/
thegerk.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
86
87
//Project: CSCI_3150_Propositional_Statements
//contributions by theGerk
#include 'notmin.h'
#include <iostream>
#include <cstring>
#include <vector>
#include <cmath>
using namespace std;
struct variable; //a variable with a name and value
class operand; //either a variable or an expression
class expression; //a simple propositinonal statment with 2 operands and 1 operator
class compoundPropositionalStatement(string intput); //an entire propositional statment
class operatorType; //class for operator NOT YET EXISTING DOES IT NEED TO?
//Defined Constants
//operators
char NOT();
char AND();
char OR();
char IMPLIES();
char IMPLIED_BY();
char BICONDITIONAL();
char XOR();
char START_PARA();
char END_PARA();
//constants
char S_TRUE();
char S_FALSE();
char TRUE_CHARACTER();
char FALSE_CHARACTER();
int getInt(const &string input, int start);
//uses cstring
//gets an interger out of a string starting from any position
int getInt(const &string input);
//uses cstring
//gets an interger out of a string starting from position 0.
int getLengthOfInt(const string& input, unsigned int start);
//uses cstring
//uses a string and finds the length of a number starting at location start
void pause();
//ueses iostream
//pauses program, useful for testing code
bool isUnary(const char& Operator);
//finds if the inputed Operator is unary and returns true if it is
//returns false if it is not
string convertToString(int input);
//uses cstring
//takes the interger input and outputs it as a string in base 10
char removeFirstDiget(int& input);
//uses cmath
//takes off first diget from input
//returns it as a character (one may add 48 to find the character value)
bool isLetter(const char& input);
//returns true if the character is a letter a-z or A-Z
bool isOperater(const char& input);
//returns true if the character is an operator (one of them used in the program)
bool isNumber(const char& input);
//returns true if the character is a number 0-9
bool isBlankSpace(const char& input);
//returns true if the character is a tab, space, or newline
void clean(string& input);
//uses cstring, iostream
//cleans up a string
//takes out loose parentheses
//takes out parantheses that are pointlessly surrounding the entire string
unsigned int locationofLastOperation(const string& statement);
//uses cstring, vector
//finds the place in the string of the last operator.
unsigned int orderOfOperation(const char& Operator);
//returns what level it is in order of operations