-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscan.h
60 lines (53 loc) · 1.1 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef _SCAN_H
#define _SCAN_H
typedef enum {
IDENT,
NUMBER,
ANDSYM, // and
ARRAYSYM, // array
BECOMES, // is
BEGINSYM, // begin
CALLSYM, // call
COLON, // :
COMMA, // ,
CONSTSYM, // const
DOSYM, // do
ELSESYM, // else
EMITSYM, // emit
ENDSYM, // end
EQL, // =
EXCLAMATION,// !
GEQ, // >=
GTR, // >
IFSYM, // if
LBRACKET, // [
LCURLY, // {
LEQ, // <=
LPAREN, // (
LSS, // <
MINUS, // -
NEQ, // #
ORSYM, // or
PERCENT, // %
PERIOD, // .
PLUS, // +
PRINTSYM, // print
PROCSYM, // proc
RBRACKET, // ]
RCURLY, // }
RETURNSYM, // return
RPAREN, // )
SEMICOLON, // ;
SLASH, // /
THENSYM, // then
TIMES, // *
VARSYM, // var
WHILESYM, // while
XORSYM, // xor
ENDOFFILE
} Symbol;
#define MAXSYMB 4096
extern char buf[MAXSYMB];
extern Symbol scan();
extern void printsymb(Symbol s);
#endif