Kestrel Interface
Loading...
Searching...
No Matches
kest_tokenizer.h
Go to the documentation of this file.
1#ifndef TOK_H_
2#define TOK_H_
3
4int char_is_letter(char c);
5
6#define TOKENIZER_STATE_IDLE 0
7#define TOKENIZER_STATE_NAME 1
8#define TOKENIZER_STATE_NUMBER 2
9#define TOKENIZER_STATE_NUMBER_HEX 3
10#define TOKENIZER_STATE_NUMBER_BIN 4
11#define TOKENIZER_STATE_STRING 5
12#define TOKENIZER_STATE_STRESC 6
13#define TOKENIZER_STATE_LEADING_ZERO 7
14#define TOKENIZER_STATE_DONE 8
15
16#define TOKENIZER_POLICY_DISCARD 0
17#define TOKENIZER_POLICY_ACCEPT 1
18#define TOKENIZER_POLICY_SINGULAR 2
19#define TOKENIZER_POLICY_BEGIN 3
20#define TOKENIZER_POLICY_END_ACCEPT 4
21#define TOKENIZER_POLICY_END_DISCARD 5
22#define TOKENIZER_POLICY_COMPLAIN 6
23
24typedef struct kest_token_ll {
25 char *data;
26 int line;
27 int index;
30
32
34
35int kest_token_ll_safe_aappend(kest_token_ll **list_ptr, char *x, int line, int index);
36
39
40int token_is_newline(char *str);
41int token_is_char(char *str, char c);
42
43int token_is_int(char *token);
44int token_is_number(char *token);
45int token_is_name(char *token);
46int token_is_dict_entry_seperator(char *token);
47
48float token_to_float(char *token);
49
51
52#endif
int kest_token_ll_safe_aappend(kest_token_ll **list_ptr, char *x, int line, int index)
int token_is_newline(char *str)
int token_is_int(char *token)
int kest_tokenize_content(struct kest_eff_parsing_state *ps)
float token_to_float(char *token)
int token_is_name(char *token)
int token_is_dict_entry_seperator(char *token)
int kest_token_ll_advance(kest_token_ll **list)
int token_is_char(char *str, char c)
int kest_token_ll_skip_ws(kest_token_ll **list)
kest_token_ll * kest_token_span_to_ll(kest_token_ll *start, kest_token_ll *end)
int char_is_letter(char c)
int token_is_number(char *token)
struct kest_token_ll * next