-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlexical.h
More file actions
39 lines (34 loc) · 780 Bytes
/
lexical.h
File metadata and controls
39 lines (34 loc) · 780 Bytes
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
#ifndef LEXICAL_H
#define LEXICAL_H
#include <vector>
#include <QTextStream>
#include <QFile>
#include <stdio.h>
using namespace std;
#define ERRORMAX 100
struct Word {
int code;
char value[50];
};
class Lexical
{
public:
Lexical();
void clearmid();
int IsNum(char c);
int IsChar(char c);
int IsOperator(char c);
int IsLimiter(char c);
int IsKeyWord(char *mid);
void printf(int a);
Word Result(FILE* fp);
vector <pair <QString,const char *>> getRESULT();
private:
vector<pair<int,const char *> > keyword;
vector<pair<int,const char *> > opera;
char mid[50];
char errormid[ERRORMAX];
vector <pair< QString,const char *>>RESULT;
int WordType;
};
#endif // LEXICAL_H