-
Notifications
You must be signed in to change notification settings - Fork 0
/
scanner.h
21 lines (17 loc) · 832 Bytes
/
scanner.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef SCANNER_H
#define SCANNER_H
#define norw 15 /* number of reserved words */
#define imax 32767 /* maximum integer value */
#define cmax 11 /* maximum number of chars for idents */
#define strmax 256 /* maximum length of strings */
typedef enum {
nullsym, skipsym, identsym, numbersym, plussym, minussym, multsym, slashsym, ifelsym, eqlsym,
neqsym, lessym, leqsym, gtrsym, geqsym, lparentsym, rparentsym, commasym, semicolonsym, periodsym,
becomessym, beginsym, endsym, ifsym, thensym, whilesym, dosym, callsym, constsym, varsym, procsym,
writesym, readsym, elsesym
} token_type;
int readSourceProgram(char *file_name, char **program_memory);
void printSourceProgram(char **program_memory, int num_inputs);
int checkTokenType(char *token, int isAllNumber);
void lexicalAnalyzer(char *file_name);
#endif