xo-interpreter: handle assignment expressions

This commit is contained in:
Roland Conybeare 2025-11-25 14:31:05 -05:00
commit fc2c9a5629
4 changed files with 33 additions and 2 deletions

View file

@ -172,6 +172,9 @@ namespace xo {
/** handle incoming '=' token **/
virtual void on_singleassign_token(const token_type & tk,
parserstatemachine * p_psm);
/** handle incoming ':=' token **/
virtual void on_assign_token(const token_type & tk,
parserstatemachine * p_psm);
/** handle incoming '(' token **/
virtual void on_leftparen_token(const token_type & tk,
parserstatemachine * p_psm);

View file

@ -97,7 +97,7 @@ namespace xo {
bp<Expression> expr2,
parserstatemachine * p_psm) const;
virtual const char * get_expect_str() const override;
virtual const char * get_expect_str() const final override;
virtual void on_expr(bp<Expression> expr,
parserstatemachine * p_psm) override;
@ -116,6 +116,8 @@ namespace xo {
parserstatemachine * p_psm) override;
virtual void on_singleassign_token(const token_type & tk,
parserstatemachine * p_psm) override;
virtual void on_assign_token(const token_type & tk,
parserstatemachine * p_psm) final override;
virtual void on_leftparen_token(const token_type & tk,
parserstatemachine * p_psm) override;
virtual void on_rightparen_token(const token_type & tk,
@ -129,7 +131,7 @@ namespace xo {
/* entry point for an infix operator token */
virtual void on_operator_token(const token_type & tk,
parserstatemachine * p_psm) override;
parserstatemachine * p_psm) final override;
virtual void on_bool_token(const token_type & tk,
parserstatemachine * p_psm) override;