1
0
Fork 0
lesson-lisp/enums.h

36 lines
562 B
C
Raw Normal View History

2023-05-03 21:28:58 +00:00
#ifndef __ENUMS_H__
#define __ENUMS_H__
2023-05-03 21:41:04 +00:00
#include <stdbool.h>
2023-05-03 21:28:58 +00:00
enum State {
STATE_INIT,
STATE_WHITESPACE,
STATE_OPEN,
STATE_CLOSE,
2023-05-03 22:31:11 +00:00
STATE_ATOM,
2023-05-03 21:28:58 +00:00
STATE_NUM,
};
2023-05-03 21:41:04 +00:00
enum TokenType {
TOKEN_OPEN,
TOKEN_CLOSE,
2023-05-03 22:31:11 +00:00
TOKEN_ATOM,
2023-05-03 21:41:04 +00:00
TOKEN_NUM,
};
2023-05-03 21:28:58 +00:00
enum Type {
TYPE_PAIR,
TYPE_ATOM,
TYPE_STRING,
TYPE_NUMBER,
};
const char *State_to_str(enum State state);
2023-05-03 21:41:04 +00:00
const char *TokenType_to_str(enum TokenType token_type);
const char *Type_to_str(enum Type type);
bool State_to_token_type(enum State state, enum TokenType *token_type);
2023-05-03 21:28:58 +00:00
#endif