-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscan.h
40 lines (37 loc) · 774 Bytes
/
scan.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
typedef enum {
NOP,
IDENT,
NUMBER,
LPAREN, // (
RPAREN, // )
TIMES, // *
SLASH, // /
PLUS, // +
MINUS, // -
EQL, // =
NEQ, // #
LSS, // <
LEQ, // <=
GTR, // >
GEQ, // >=
CALLSYM, // call
BEGINSYM, // begin
SEMICOLON, // ;
ENDSYM, // end
IFSYM, // if
WHILESYM, // while
BECOMES, // :=
THENSYM, // then
DOSYM, // do
CONSTSYM, // const
COMMA, // ,
VARSYM, // var
PROCSYM, // proc
PERIOD, // .
ODDSYM, // odd
ENDOFFILE
} Symbol;
#define MAXSYMB 100
extern char buf[MAXSYMB];
extern Symbol scan();
extern void printsymb(Symbol s);