Merge remote-tracking branch 'tq/master' into LL such that it compiles
Conflicts: src/Makefile src/backends/packrat.c src/compile.c src/hammer.h src/internal.h src/parsers/action.c src/parsers/and.c src/parsers/attr_bool.c src/parsers/bits.c src/parsers/butnot.c src/parsers/ch.c src/parsers/charset.c src/parsers/choice.c src/parsers/difference.c src/parsers/end.c src/parsers/epsilon.c src/parsers/ignore.c src/parsers/ignoreseq.c src/parsers/indirect.c src/parsers/int_range.c src/parsers/many.c src/parsers/not.c src/parsers/nothing.c src/parsers/optional.c src/parsers/sequence.c src/parsers/token.c src/parsers/unimplemented.c src/parsers/whitespace.c src/parsers/xor.c
This commit is contained in:
commit
c64a4e435e
46 changed files with 1289 additions and 263 deletions
|
|
@ -48,7 +48,7 @@ static inline void h_generic_free(HAllocator *allocator, void* ptr) {
|
|||
allocator->free(allocator, ptr);
|
||||
}
|
||||
|
||||
HAllocator system_allocator;
|
||||
extern HAllocator system_allocator;
|
||||
|
||||
|
||||
typedef struct HInputStream_ {
|
||||
|
|
@ -131,7 +131,8 @@ struct HParseState_ {
|
|||
|
||||
typedef struct HParserBackendVTable_ {
|
||||
int (*compile)(HAllocator *mm__, HParser* parser, const void* params);
|
||||
HParseResult* (*parse)(HAllocator *mm__, const HParser* parser, HParseState* parse_state);
|
||||
HParseResult* (*parse)(HAllocator *mm__, const HParser* parser, HInputStream* parse_state);
|
||||
void (*free)(HParser* parser);
|
||||
} HParserBackendVTable;
|
||||
|
||||
|
||||
|
|
@ -213,9 +214,10 @@ struct HBitWriter_ {
|
|||
|
||||
// }}}
|
||||
|
||||
|
||||
// Backends {{{
|
||||
extern HParserBackendVTable h__packrat_backend_vtable;
|
||||
extern HParserBackendVTable h__ll_backend_vtable;
|
||||
extern HParserBackendVTable h__llk_backend_vtable;
|
||||
// }}}
|
||||
|
||||
// TODO(thequux): Set symbol visibility for these functions so that they aren't exported.
|
||||
|
|
@ -295,9 +297,14 @@ struct HParserVtable_ {
|
|||
HParseResult* (*parse)(void *env, HParseState *state);
|
||||
bool (*isValidRegular)(void *env);
|
||||
bool (*isValidCF)(void *env);
|
||||
bool (*compile_to_rvm)(HRVMProg *prog, void* env); // FIXME: forgot what the bool return value was supposed to mean.
|
||||
HCFChoice* (*desugar)(HAllocator *mm__, void *env);
|
||||
};
|
||||
|
||||
bool h_false(void*);
|
||||
bool h_true(void*);
|
||||
bool h_not_regular(HRVMProg*, void*);
|
||||
|
||||
#if 0
|
||||
#include <stdlib.h>
|
||||
#define h_arena_malloc(a, s) malloc(s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue