#ifndef AMALGAM_PARSER_H #define AMALGAM_PARSER_H #include "buffer.h" #include "buffer_view.h" #include "tokenizer.h" #include "scoped_allocator.h" #define PARSER_OK 0 /* General error */ #define PARSER_ERR -1 #define PARSER_UNEXPECTED_TOKEN -2 typedef struct { Tokenizer tokenizer; ScopedAllocator allocator; Buffer ast_objects; } Parser; CHECK_RESULT int parser_init(Parser *self); void parser_deinit(Parser *self); CHECK_RESULT int parser_parse_buffer(Parser *self, BufferView code_buffer); #endif