-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscanner.h
39 lines (35 loc) · 848 Bytes
/
scanner.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
#pragma once
//#include "lex.h"
//#include "type_of_lex.h"
#include "lex.h"
//#include "table_label.h"
//#include "table_ident.h"
#include "table_str.h"
using namespace std;
extern table_ident TID;
//extern const char * translator[];
extern table_str TSTR;
class Scanner
{
enum state {H, IDENT, NUMB, ALE, NEQ, EQEQ, QUOTE};
static const char * TW[];
static const type_of_lex words[];
static const char * TD[];
static const type_of_lex dlms[];
state CS;
FILE *fp;
char c;
int buf_top;
void clear();
void add();
int look(const char *buf, const char **list);
char gc();
public:
char buf[100];
int count_str = 1; // счётчик строк
int count_col = 0; // счётчик столбцов
bool err_scaner = false;
Lex get_lex();
char * g_label();
Scanner (const char* program);
};