2012-05-26 16:00:43 +02:00
|
|
|
#include "parser_internal.h"
|
|
|
|
|
|
|
|
|
|
static HParseResult* parse_unimplemented(void* env, HParseState *state) {
|
|
|
|
|
(void) env;
|
|
|
|
|
(void) state;
|
|
|
|
|
static HParsedToken token = {
|
|
|
|
|
.token_type = TT_ERR
|
|
|
|
|
};
|
|
|
|
|
static HParseResult result = {
|
|
|
|
|
.ast = &token
|
|
|
|
|
};
|
|
|
|
|
return &result;
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-20 18:58:15 -05:00
|
|
|
static HCFChoice* desugar_unimplemented(HAllocator *mm__, void *env) {
|
|
|
|
|
assert_message(0, "'h_unimplemented' is not context-free, can't be desugared");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-26 16:00:43 +02:00
|
|
|
static const HParserVtable unimplemented_vt = {
|
|
|
|
|
.parse = parse_unimplemented,
|
2012-12-18 18:10:40 -05:00
|
|
|
.isValidRegular = h_false,
|
|
|
|
|
.isValidCF = h_false,
|
2013-02-20 18:58:15 -05:00
|
|
|
.desugar = desugar_unimplemented,
|
2013-04-22 18:06:17 -07:00
|
|
|
.compile_to_rvm = h_not_regular,
|
2012-05-26 16:00:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static HParser unimplemented = {
|
|
|
|
|
.vtable = &unimplemented_vt,
|
|
|
|
|
.env = NULL
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const HParser* h_unimplemented() {
|
|
|
|
|
return &unimplemented;
|
|
|
|
|
}
|
2012-10-10 15:58:03 +02:00
|
|
|
const HParser* h_unimplemented__m(HAllocator* mm__) {
|
|
|
|
|
return &unimplemented;
|
|
|
|
|
}
|