hydroforth/include/hydroforth/lexer.h
Dominic Grimm 03a9b46e33
All checks were successful
continuous-integration/drone/push Build is passing
Refactor stack to now use ints instead of long ints
2023-08-06 11:20:14 +02:00

31 lines
645 B
C

#ifndef __HF__LEXER_H__
#define __HF__LEXER_H__
#include "location.h"
#include "result.h"
enum hf__token_type {
HF__TOKEN_TYPE__NUMBER,
HF__TOKEN_TYPE__CHAR,
HF__TOKEN_TYPE__WORD,
HF__TOKEN_TYPE__PERIOD_STRING,
HF__TOKEN_TYPE__COLON,
HF__TOKEN_TYPE__SEMICOLON,
HF__TOKEN_TYPE__DASH_COMMENT,
HF__TOKEN_TYPE__BACKSLASH_COMMENT,
HF__TOKEN_TYPE__PAREN_COMMENT,
};
struct hf__token {
enum hf__token_type type;
struct hf__location location;
};
extern void hf__lex(const char *const src, const size_t src_len,
struct hf__token **tokens, size_t *const len,
size_t *const cap);
#endif