-
Notifications
You must be signed in to change notification settings - Fork 0
/
TurningMachineTransition.h
34 lines (33 loc) · 1.18 KB
/
TurningMachineTransition.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
#ifndef TURNINGMACHINETRANSITIONS_H
#define TURNINGMACHINETRANSITIONS_H
#include <string>
using namespace std;
class TurningMachineTransition
{
public:
TurningMachineTransition(string startstate, char token, char write, char mDirection, string endState);
~TurningMachineTransition();
// the same as toString function
string toString();
// get functions
string getStartState();
string getEndState();
char getToken();
char getWrite();
char getMoveDirection();
friend ostream &operator << (ostream &strm, const TurningMachineTransition &obj);
private:
string StartState; // the start state of this transition
char Token; // the letter that is being taken from state to another
char MoveDirection; // R: right, L: left, S: stay
char Write; // the letter that is being written on the tabe
string EndState; // the end state of this transition
// the set function are also private because we don't want to change any of them
// except inside the class functions
void setStartState(string);
void setEndState(string);
void setToken(char);
void setWrite(char);
void setMoveDirection(char);
};
#endif // !TURNINGMACHINETRANSITIONS_H