-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlexical.h
86 lines (46 loc) · 1.01 KB
/
lexical.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#pragma once
#ifndef LEXICAL_H
#define LEXICAL_H
enum typeId {
CONSTTK, INTTK, CHARTK, VOIDTK, MAINTK, IFTK, ELSETK, DOTK, WHILETK, FORTK, SCANFTK, PRINTFTK, RETURNTK, //保留字
IDENFR, INTCON, CHARCON, STRCON,
PLUS, MINU, MULT, DIV, LSS, LEQ, GRE, GEQ, EQL, NEQ, ASSIGN, SEMICN, COMMA, LPARENT, RPARENT, LBRACK, RBRACK, LBRACE, RBRACE
};
bool isSpace();
bool isNewline();
bool isBlank();
bool isLetter();
bool isDigit();
bool isPlus();
bool isMinu();
bool isMult();
bool isDiv();
bool isChar();
bool isLss();
bool isGre();
bool isExcla();
bool isAssign();
bool isSemicn();
bool isComma();
bool isLparent();
bool isRparent();
bool isLbrack();
bool isRbrack();
bool isLbrace();
bool isRbrace();
bool isSquo();
bool isDquo();
bool isEOF();
bool isStringChar();
bool isValid();
bool isFactorFellow();
void clearToken();
void catToken();
void get_ch();
void retract();
void retractString(int oldIndex);
int reserver();
int transNum();
int getsym(int out=1);
void doOutput();
#endif // !LEXICAL_H