Implement add_branch_rule
This commit is contained in:
parent
07b94c996c
commit
1e045d9801
@ -66,6 +66,21 @@ weighted_group_id_t ruleset_t::add_weighted_group(const etl::ivector<etl::pair<g
|
||||
return m_weighted_groups.size() - 1;
|
||||
}
|
||||
|
||||
branch_rule_id_t ruleset_t::add_branch_rule(token_id_t match, group_id_t group) {
|
||||
if (!valid_token(match) || !valid_group_characteristic(group)) {
|
||||
throw mtl::invalid_argument();
|
||||
}
|
||||
|
||||
branch_rule_t rule {
|
||||
.m_match = match,
|
||||
.m_weighted = false,
|
||||
.m_group = { .basic = group }
|
||||
};
|
||||
|
||||
m_branch_rules.push_back(rule);
|
||||
return m_branch_rules.size() - 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
token_id_t generator_t::add_token(token_type_e type, mtl::fixed value) {
|
||||
log::debug << "Adding token with type " << (int)type << endl;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user