29 |
29 |
30 #ifndef CODEGENS_H |
30 #ifndef CODEGENS_H |
31 #define CODEGENS_H |
31 #define CODEGENS_H |
32 |
32 |
33 #include <stdio.h> |
33 #include <stdio.h> |
|
34 #include "ucx/buffer.h" |
34 |
35 |
35 #ifdef __cplusplus |
36 #ifdef __cplusplus |
36 extern "C" { |
37 extern "C" { |
37 #endif |
38 #endif |
38 |
39 |
39 #define WORDBUF_SIZE 64 |
40 #define WORDBUF_SIZE 64 |
40 |
41 |
41 #define iswordcharacter(c) (isalnum(c) || c=='_' || c=='#' || c=='@') |
42 #define iswordcharacter(c) (isalnum(c) || c=='_' || c=='#' || c=='@') |
42 |
43 |
43 typedef struct _highlighter_t highlighter_t; |
44 typedef struct _highlighter_t highlighter_t; |
44 typedef void(*parser_fnc)(char*,char*,highlighter_t*); |
45 typedef void(*parser_fnc)(char*,UcxBuffer*,highlighter_t*); |
45 |
46 |
46 struct _highlighter_t { |
47 struct _highlighter_t { |
47 const char** keywords; |
48 const char** keywords; |
48 int(*istype)(char*,size_t); |
49 int(*istype)(char*,size_t); |
49 int(*isdirective)(char*); |
50 int(*isdirective)(char*); |