1
0
Fork 0
lesson-lisp/enums.h

36 lines
558 B
C
Raw Normal View History

2023-05-03 17:28:58 -04:00
#ifndef __ENUMS_H__
#define __ENUMS_H__
2023-05-03 17:41:04 -04:00
#include <stdbool.h>
2023-05-03 17:28:58 -04:00
enum State {
STATE_INIT,
STATE_WHITESPACE,
STATE_OPEN,
STATE_CLOSE,
STATE_ID,
STATE_NUM,
};
2023-05-03 17:41:04 -04:00
enum TokenType {
TOKEN_OPEN,
TOKEN_CLOSE,
TOKEN_ID,
TOKEN_NUM,
};
2023-05-03 17:28:58 -04:00
enum Type {
TYPE_PAIR,
TYPE_ATOM,
TYPE_STRING,
TYPE_NUMBER,
};
const char *State_to_str(enum State state);
2023-05-03 17:41:04 -04: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 17:28:58 -04:00
#endif