-
Notifications
You must be signed in to change notification settings - Fork 0
/
alphabet.h
54 lines (34 loc) · 1020 Bytes
/
alphabet.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
/*
*
* This is alphabet.h
*
*
*
*/
#ifndef ALPHABET_H
#define ALPHABET_H
#include <bitset>
#define ALPHABET_LIMIT = 128
using namespace std;
class alphabet{
private:
bitset<129> alphaSymbols; //there is some sort of an assumption that there will be 128 characters only
//the last bitset is reserved for epsilons
// this display for the bitset is as you would read a binay number. setting 128 will end up setting the msb and will be seen first in the array.
public:
alphabet();
alphabet (char * );
bool setAlphaSymbols (char * );
bool setAlphaSymbol (int );
alphabet operator + (alphabet );
alphabet operator * (alphabet );
alphabet operator - (alphabet );
bool isMember(int );
bool isMember(char );
void disp ();
friend ostream& operator << (ostream& , alphabet& );
friend istream& operator >> (istream& , alphabet& );
};
ostream& operator << (ostream& , alphabet& );
istream& operator >> (istream& , alphabet& );
#endif