add LL backend stub

This commit is contained in:
Sven M. Hallberg 2013-04-17 15:10:33 +02:00
parent e73377fbda
commit 1325ebcdd1
5 changed files with 22 additions and 1 deletions

View file

@ -26,7 +26,8 @@ PARSERS := \
indirect indirect
BACKENDS := \ BACKENDS := \
packrat packrat \
ll
HAMMER_PARTS := \ HAMMER_PARTS := \
bitreader.o \ bitreader.o \

17
src/backends/ll.c Normal file
View file

@ -0,0 +1,17 @@
#include <assert.h>
#include "../internal.h"
#include "../parsers/parser_internal.h"
int h_ll_compile(HAllocator* mm__, const HParser* parser, const void* params) {
return -1; // TODO
}
HParseResult *h_ll_parse(HAllocator* mm__, const HParser* parser, HParseState* parse_state) {
return NULL; // TODO
}
HParserBackendVTable h__ll_backend_vtable = {
.compile = h_ll_compile,
.parse = h_ll_parse
};

View file

@ -4,6 +4,7 @@
static HParserBackendVTable *backends[PB_MAX] = { static HParserBackendVTable *backends[PB_MAX] = {
&h__packrat_backend_vtable, &h__packrat_backend_vtable,
&h__ll_backend_vtable,
}; };
int h_compile(const HParser* parser, HParserBackend backend, const void* params) { int h_compile(const HParser* parser, HParserBackend backend, const void* params) {

View file

@ -34,6 +34,7 @@ typedef struct HParseState_ HParseState;
typedef enum HParserBackend_ { typedef enum HParserBackend_ {
PB_MIN = 0, PB_MIN = 0,
PB_PACKRAT = PB_MIN, // PB_MIN is always the default. PB_PACKRAT = PB_MIN, // PB_MIN is always the default.
PB_LL,
PB_MAX PB_MAX
} HParserBackend; } HParserBackend;

View file

@ -215,6 +215,7 @@ struct HBitWriter_ {
// Backends {{{ // Backends {{{
extern HParserBackendVTable h__packrat_backend_vtable; extern HParserBackendVTable h__packrat_backend_vtable;
extern HParserBackendVTable h__ll_backend_vtable;
// }}} // }}}
// TODO(thequux): Set symbol visibility for these functions so that they aren't exported. // TODO(thequux): Set symbol visibility for these functions so that they aren't exported.