Expanded vtable for methods to determine whether a combinator is ok to use with regular or CF grammars.

This commit is contained in:
Meredith L. Patterson 2012-12-18 18:10:40 -05:00
parent 8163b3981d
commit 36e1f66de0
25 changed files with 200 additions and 4 deletions

View file

@ -35,8 +35,16 @@ static HParseResult* parse_butnot(void *env, HParseState *state) {
}
}
static bool bn_isValidCF(void *env) {
HTwoParsers *tp = (HTwoParsers*)env;
return (tp->p1->vtable->isValidCF(tp->p1->env) &&
tp->p2->vtable->isValidCF(tp->p2->env));
}
static const HParserVtable butnot_vt = {
.parse = parse_butnot,
.isValidRegular = h_false,
.isValidCF = bn_isValidCF,
};
const HParser* h_butnot(const HParser* p1, const HParser* p2) {