xo-reader2: refactor: make() + _make() pair for each ssm
This commit is contained in:
parent
da58e18779
commit
9a97bb2680
12 changed files with 92 additions and 59 deletions
|
|
@ -52,9 +52,9 @@ namespace xo {
|
|||
}
|
||||
|
||||
DExpectExprSsm *
|
||||
DExpectExprSsm::make(DArena & mm,
|
||||
bool allow_defs,
|
||||
bool cxl_on_rightbrace)
|
||||
DExpectExprSsm::_make(DArena & mm,
|
||||
bool allow_defs,
|
||||
bool cxl_on_rightbrace)
|
||||
{
|
||||
void * mem = mm.alloc(typeseq::id<DExpectExprSsm>(),
|
||||
sizeof(DExpectExprSsm));
|
||||
|
|
@ -63,6 +63,14 @@ namespace xo {
|
|||
cxl_on_rightbrace);
|
||||
}
|
||||
|
||||
obj<ASyntaxStateMachine,DExpectExprSsm>
|
||||
DExpectExprSsm::make(DArena & mm,
|
||||
bool allow_defs,
|
||||
bool cxl_on_rightbrace)
|
||||
{
|
||||
return obj<ASyntaxStateMachine,DExpectExprSsm>(_make(mm, allow_defs, cxl_on_rightbrace));
|
||||
}
|
||||
|
||||
void
|
||||
DExpectExprSsm::start(DArena & mm,
|
||||
bool allow_defs,
|
||||
|
|
@ -71,12 +79,7 @@ namespace xo {
|
|||
{
|
||||
DArena::Checkpoint ckp = mm.checkpoint();
|
||||
|
||||
DExpectExprSsm * exp_expr
|
||||
= DExpectExprSsm::make(mm,
|
||||
allow_defs,
|
||||
cxl_on_rightbrace);
|
||||
obj<ASyntaxStateMachine> ssm
|
||||
= with_facet<ASyntaxStateMachine>::mkobj(exp_expr);
|
||||
auto ssm = DExpectExprSsm::make(mm, allow_defs, cxl_on_rightbrace);
|
||||
|
||||
p_psm->push_ssm(ckp, ssm);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue