Herb C Reference
Loading...
Searching...
No Matches
token.h
Go to the documentation of this file.
1#ifndef HERB_TOKEN_H
2#define HERB_TOKEN_H
3
4#include "lexer_struct.h"
5#include "position.h"
6#include "token_struct.h"
7#include "util/hb_string.h"
8
9#include <stdarg.h>
10
11token_T* token_init(hb_string_T value, token_type_T type, lexer_T* lexer);
12hb_string_T token_to_string(const token_T* token);
13const char* token_type_to_string(token_type_T type);
16char* token_types_to_friendly_string_valist(token_type_T first_token, va_list args);
17
18#define token_types_to_friendly_string(...) token_types_to_friendly_string_va(__VA_ARGS__, TOKEN_SENTINEL)
19
21
22void token_free(token_T* token);
23
24bool token_value_empty(const token_T* token);
25
26#endif
Definition lexer_struct.h:16
Definition token_struct.h:55
token_T * token_copy(token_T *token)
Definition token.c:197
void token_free(token_T *token)
Definition token.c:226
const char * token_type_to_string(token_type_T type)
Definition token.c:44
char * token_types_to_friendly_string_va(token_type_T first_token,...)
Definition token.c:153
token_T * token_init(hb_string_T value, token_type_T type, lexer_T *lexer)
Definition token.c:14
char * token_types_to_friendly_string_valist(token_type_T first_token, va_list args)
Definition token.c:126
bool token_value_empty(const token_T *token)
Definition token.c:222
const char * token_type_to_friendly_string(token_type_T type)
Definition token.c:85
hb_string_T token_to_string(const token_T *token)
Definition token.c:161
token_type_T
Definition token_struct.h:7