xo-reader: simplify expect_type_xs.start() using psm
This commit is contained in:
parent
0b0c424b84
commit
e74e55832e
4 changed files with 5 additions and 9 deletions
|
|
@ -16,7 +16,7 @@ namespace xo {
|
|||
public:
|
||||
expect_type_xs();
|
||||
|
||||
static void start(exprstatestack * p_stack);
|
||||
static void start(parserstatemachine * p_stack);
|
||||
|
||||
virtual void on_symbol_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) override;
|
||||
|
|
|
|||
|
|
@ -112,12 +112,10 @@ namespace xo {
|
|||
|
||||
//constexpr const char * self_name = "define_xs::on_colon_token";
|
||||
|
||||
auto p_stack = p_psm->p_stack_;
|
||||
|
||||
if (this->defxs_type_ == defexprstatetype::def_2) {
|
||||
this->defxs_type_ = defexprstatetype::def_3;
|
||||
|
||||
expect_type_xs::start(p_stack);
|
||||
expect_type_xs::start(p_psm);
|
||||
} else {
|
||||
exprstate::on_colon_token(tk, p_psm);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,11 +64,9 @@ namespace xo {
|
|||
expect_formal_xs::on_colon_token(const token_type & tk,
|
||||
parserstatemachine * p_psm)
|
||||
{
|
||||
auto p_stack = p_psm->p_stack_;
|
||||
|
||||
if (this->formalxs_type_ == formalstatetype::formal_1) {
|
||||
this->formalxs_type_ = formalstatetype::formal_2;
|
||||
expect_type_xs::start(p_stack);
|
||||
expect_type_xs::start(p_psm);
|
||||
/* control reenters via expect_formal_xs::on_typedescr() */
|
||||
} else {
|
||||
exprstate::on_colon_token(tk,
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ namespace xo {
|
|||
}
|
||||
|
||||
void
|
||||
expect_type_xs::start(exprstatestack * p_stack) {
|
||||
p_stack->push_exprstate(expect_type_xs::make());
|
||||
expect_type_xs::start(parserstatemachine * p_psm) {
|
||||
p_psm->push_exprstate(expect_type_xs::make());
|
||||
}
|
||||
|
||||
expect_type_xs::expect_type_xs()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue