-
Notifications
You must be signed in to change notification settings - Fork 0
/
getSource.h
33 lines (27 loc) · 626 Bytes
/
getSource.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
#include <stdio.h>
#ifndef TBL
#define TBL
#include "table.h"
#endif
#define MAXNAME 31
typedef enum keys {
Begin, End, If, Then, While, Do, Ret, Func,
Var, Const, Odd, Write, Writeln, end_of_KeyWd,
Plus, Minus, Mult, Div, Lparen, Rparen,
Equal, Lss, Gtr, NotEq, LssEq, GtrEq,
Comma, Period, Semicolon, Assign, end_of_KeySym,
Id, Num, nul, end_of_Token,
letter, digit, colon, others
} KeyId;
typedef struct token {
KeyId kind;
union {
char id[MAXNAME];
int value;
} u;
} Token;
Token nextToken();
Token checkGet(Token t, KeyId k);
void openSource(char fileName[]);
void closeSource();
void initSource();