xo-reader: rename+: exprstate.on_def() -> on_def_token() + token arg

This commit is contained in:
Roland Conybeare 2024-08-09 13:42:50 -04:00
commit 60a7ec1cd0
6 changed files with 17 additions and 11 deletions

View file

@ -126,7 +126,9 @@ namespace xo {
// ----- input methods -----
virtual void on_def(exprstatestack * p_stack);
/** handle incoming 'def' token **/
virtual void on_def_token(const token_type & tk,
exprstatestack * p_stack);
/** handle incoming symbol token **/
virtual void on_symbol_token(const token_type & tk,
exprstatestack * p_stack,

View file

@ -40,9 +40,6 @@ namespace xo {
virtual bool admits_rightparen() const override;
virtual bool admits_f64() const override;
// virtual void on_f64(..) override
virtual void on_def(exprstatestack * p_stack) override;
virtual void on_expr(ref::brw<Expression> expr,
exprstatestack * p_stack,
rp<Expression> * p_emit_expr) override;
@ -53,6 +50,8 @@ namespace xo {
exprstatestack * /*p_stack*/,
rp<Expression> * /*p_emit_expr*/) override;
virtual void on_def_token(const token_type & tk,
exprstatestack * p_stack) override;
virtual void on_symbol_token(const token_type & tk,
exprstatestack * p_stack,
rp<Expression> * p_emit_expr) override;

View file

@ -31,9 +31,6 @@ namespace xo {
virtual bool admits_rightparen() const override;
virtual bool admits_f64() const override;
// virtual void on_f64(..) override
virtual void on_def(exprstatestack * p_stack) override;
virtual void on_expr(ref::brw<Expression> expr,
exprstatestack * p_stack,
rp<Expression> * p_emit_expr) override;
@ -43,6 +40,9 @@ namespace xo {
virtual void on_typedescr(TypeDescr td,
exprstatestack * /*p_stack*/,
rp<Expression> * /*p_emit_expr*/) override;
virtual void on_def_token(const token_type & tk,
exprstatestack * p_stack) override;
virtual void on_colon_token(const token_type & tk,
exprstatestack * p_stack) override;
virtual void on_semicolon_token(const token_type & tk,

View file

@ -320,7 +320,8 @@ namespace xo {
}
void
exprstate::on_def(exprstatestack * p_stack) {
exprstate::on_def_token(const token_type & /*tk*/,
exprstatestack * p_stack) {
constexpr bool c_debug_flag = true;
scope log(XO_DEBUG(c_debug_flag));
@ -652,7 +653,7 @@ namespace xo {
switch (tk.tk_type()) {
case tokentype::tk_def:
this->on_def(p_stack);
this->on_def_token(tk, p_stack);
return;
case tokentype::tk_i64:

View file

@ -73,7 +73,9 @@ namespace xo {
}
void
paren_xs::on_def(exprstatestack * /*p_stack*/) {
paren_xs::on_def_token(const token_type & /*tk*/,
exprstatestack * /*p_stack*/)
{
constexpr const char * c_self_name = "paren_xs::on_def";
throw std::runtime_error(tostr(c_self_name,

View file

@ -43,7 +43,9 @@ namespace xo {
progress_xs::admits_f64() const { return false; }
void
progress_xs::on_def(exprstatestack * /*p_stack*/) {
progress_xs::on_def_token(const token_type & /*tk*/,
exprstatestack * /*p_stack*/)
{
constexpr const char * self_name = "progress_xs::on_def";
/* nothing here - admits_definition unconditionally false */