Refactor ALL the things!

This commit is contained in:
Dan Hirsch 2012-05-26 16:00:43 +02:00
parent 6a2f10df0c
commit f2def8fa05
28 changed files with 930 additions and 855 deletions

20
src/parsers/epsilon.c Normal file
View file

@ -0,0 +1,20 @@
#include "parser_internal.h"
static HParseResult* parse_epsilon(void* env, HParseState* state) {
(void)env;
HParseResult* res = a_new(HParseResult, 1);
res->ast = NULL;
res->arena = state->arena;
return res;
}
static const HParserVtable epsilon_vt = {
.parse = parse_epsilon,
};
const HParser* h_epsilon_p() {
HParser *res = g_new(HParser, 1);
res->vtable = &epsilon_vt;
res->env = NULL;
return res;
}