1
0
Fork 0
lesson-lisp/enums.h

36 lines
562 B
C

#ifndef __ENUMS_H__
#define __ENUMS_H__
#include <stdbool.h>
enum State {
STATE_INIT,
STATE_WHITESPACE,
STATE_OPEN,
STATE_CLOSE,
STATE_ATOM,
STATE_NUM,
};
enum TokenType {
TOKEN_OPEN,
TOKEN_CLOSE,
TOKEN_ATOM,
TOKEN_NUM,
};
enum Type {
TYPE_PAIR,
TYPE_ATOM,
TYPE_STRING,
TYPE_NUMBER,
};
const char *State_to_str(enum State state);
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);
#endif