Implemented a bunch more desugaring

This commit is contained in:
Dan Hirsch 2013-02-20 18:58:15 -05:00
parent 5ae267f3ed
commit 101e90ad9b
11 changed files with 51 additions and 35 deletions

View file

@ -34,20 +34,15 @@ static HParseResult* parse_difference(void *env, HParseState *state) {
}
}
static bool diff_isValidCF(void *env) {
HTwoParsers *tp = (HTwoParsers*)env;
return (tp->p1->vtable->isValidCF(tp->p1->env) &&
tp->p2->vtable->isValidCF(tp->p2->env));
}
static HCFChoice* desugar_difference(HAllocator *mm__, void *env) {
assert_message(0, "'h_difference' is not context-free, can't be desugared");
return NULL;
}
static HParserVtable difference_vt = {
.parse = parse_difference,
.isValidRegular = h_false,
.isValidCF = diff_isValidCF,
.isValidCF = h_false,
.desugar = desugar_difference,
};