summaryrefslogtreecommitdiff
path: root/src/mcpp-lexer.h
diff options
context:
space:
mode:
authorkx <kx@radix-linux.su>2026-10-01 12:02:28 +0300
committerkx <kx@radix-linux.su>2026-10-01 12:02:28 +0300
commitba1b04d64bdfaf377915b22f77520216ebe47674 (patch)
tree044343035c28b2b04ca9725f26e9b7c39342d19c /src/mcpp-lexer.h
parent124b140798456778e2a96851cc7268aa9a726698 (diff)
downloadmcpu-cpp-ba1b04d64bdfaf377915b22f77520216ebe47674.tar.xz
Version 1.0.21.0.2
Diffstat (limited to 'src/mcpp-lexer.h')
-rw-r--r--src/mcpp-lexer.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/mcpp-lexer.h b/src/mcpp-lexer.h
new file mode 100644
index 0000000..cc18799
--- /dev/null
+++ b/src/mcpp-lexer.h
@@ -0,0 +1,38 @@
+#ifndef __MCPU_CPP_LEXER_H__
+#define __MCPU_CPP_LEXER_H__ 1
+
+#include <defs.h>
+#include <mcpp-language.h>
+#include <mcpp-text.h>
+
+typedef struct mcpp_options mcpp_options;
+typedef struct mcpu_pp_lexer_state mcpu_pp_lexer_state;
+struct mcpu_pp_lexer_state
+{
+ int in_block_comment;
+ const mcpp_options *options;
+ const char *filename;
+ unsigned line_number;
+ const size_t *splice_offsets;
+ size_t splice_count;
+};
+
+void mcpu_pp_lexer_init( mcpu_pp_lexer_state *state );
+void mcpu_pp_lexer_set_diagnostics( mcpu_pp_lexer_state *state,
+ const mcpp_options *options,
+ const char *filename,
+ unsigned line_number,
+ const size_t *splice_offsets,
+ size_t splice_count );
+int mcpu_pp_prepare_line( mcpu_pp_lexer_state *state,
+ const __mpu_char16_t *line,
+ size_t length,
+ enum mcpu_language language,
+ mcpu_text *prepared );
+int mcpu_pp_find_directive( const __mpu_char16_t *line,
+ size_t length,
+ size_t *hash_offset );
+int mcpu_pp_is_identifier_start( __mpu_char16_t c );
+int mcpu_pp_is_identifier_char( __mpu_char16_t c );
+
+#endif /* __MCPU_CPP_LEXER_H__ */