-
Notifications
You must be signed in to change notification settings - Fork 0
/
thegerk_compoundpropositionalstatement.cpp
62 lines (50 loc) · 1.97 KB
/
thegerk_compoundpropositionalstatement.cpp
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
#include 'thegerk.h'
#include 'thegerk_expression.cpp'
#include <cstring>
#include <vector>
using namespace std;
class compoundPropositionalStatement
{
//private member vars
vector<variable> variables; //This is all the variables in the statement.
string statementString; //The statement saved as a nicely formated string ie: spaces.
expression expr; //the last expression to be evaluated in the statement.
//private member functions
//Benji - Complete
string getUsableString() const;
//returns a String. Using the statementString, replaces any variables with their location in variables written out as the characters of a number
//the output also has any constants labled in some way to be determined later, when setting them (constants) equal to something use FALSE_CHARACTER or TRUE_CHARACTER
//also no spaces in the rutrned
//Benji - Complete
void setup();
//sets up variables and expression expressions for statement
//not taken
void format();
//formats the statementString to look nice
//Benji - Complete
void setupVars();
//fills up the "variables" vector using the statementString
//Benji - Complete
int findvar(int locationInStatmentString) const;
//returns -1 if it is not found
//finds the specific variable in the vector and returns its location in said
//Benji
public:
//public member functions
//Benji - Complete
compoundPropositionalStatement(const string& input); //CONSTRUcTOR
//takes an input as a string and stores it nicely
//THESE NEXT THREE FUNCTIONS SHOULD ALL CALL ANOTHER FUNCTION AND THEY JUST SET UP THAT FUNCTION CORRECTLY
//not taken
void printTruthTableConsole() const;
//prints truth table to console
//not taken
void printTruthTableFile(stirng fileName) const;
//prints truth table to a file
//not taken
void appendTruthTableFile(string fileName) const;
//appends truth table to a file
//not taken
void save() const;
//prompts the user for the file it should be saved to and then appends string to that file
};