Files
scc/libs/lex_parser/include/lex_parser.h

27 lines
1007 B
C

#ifndef __SMCC_LEX_PARSER_H__
#define __SMCC_LEX_PARSER_H__
#include <libcore.h>
static inline cbool lex_parse_is_endline(int ch) {
return ch == '\n' || ch == '\r';
}
static inline cbool lex_parse_is_whitespace(int ch) {
return ch == ' ' || ch == '\t';
}
int lex_parse_char(core_probe_stream_t *input, core_pos_t *pos);
cbool lex_parse_string(core_probe_stream_t *input, core_pos_t *pos,
cstring_t *output);
cbool lex_parse_number(core_probe_stream_t *input, core_pos_t *pos,
usize *output);
cbool lex_parse_identifier(core_probe_stream_t *input, core_pos_t *pos,
cstring_t *output);
void lex_parse_skip_endline(core_probe_stream_t *input, core_pos_t *pos);
void lex_parse_skip_block_comment(core_probe_stream_t *input, core_pos_t *pos);
void lex_parse_skip_line(core_probe_stream_t *input, core_pos_t *pos);
void lex_parse_skip_whitespace(core_probe_stream_t *input, core_pos_t *pos);
#endif /* __SMCC_LEX_PARSER_H__ */