summaryrefslogtreecommitdiff
path: root/src/mcpp-lexer.h
diff options
context:
space:
mode:
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__ */