1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#ifndef UTILS_H
#define UTILS_H
#include <lexer/token.h>
struct reserved_word
{
const char *word;
enum token_type type;
};
static struct reserved_word reserved_words[] = {
{ "if", TOKEN_IF }, { "then", TOKEN_THEN },
{ "elif", TOKEN_ELIF }, { "else", TOKEN_ELSE },
{ "fi", TOKEN_FI }, { "while", TOKEN_WHILE },
{ "until", TOKEN_UNTIL }, { "do", TOKEN_DO },
{ "done", TOKEN_DONE }, { "for", TOKEN_FOR },
{ "in", TOKEN_IN }, { "!", TOKEN_NEG },
{ "}", TOKEN_CURLY_RIGHT }, { "{", TOKEN_CURLY_LEFT },
{ NULL, TOKEN_ERROR }
};
#endif /* ! UTILS_H */
|