xo-expression2: scaffold variable eval in VSM

This commit is contained in:
Roland Conybeare 2026-01-17 01:11:50 -05:00
commit 6cd861f47e
3 changed files with 19 additions and 0 deletions

View file

@ -31,8 +31,10 @@ namespace xo {
apply,
/** function definition **/
lambda,
#endif
/** variable reference **/
variable,
#ifdef NOT_YET
/** if-then-else **/
ifexpr,
/** sequence **/

View file

@ -45,6 +45,12 @@ namespace xo {
**/
void _do_eval_constant_op();
/** evaluate a variable expression
* Require:
* - expression in @ref expr_
**/
void _do_eval_variable_op();
private:
/*
* Some registers are preserved by evaluation:
@ -60,8 +66,10 @@ namespace xo {
/** program counter **/
VsmInstr pc_ = VsmInstr::halt();
#ifdef NOT_YET
/** stack pointer **/
Stack stack_;
#endif
/** expression register **/
obj<AExpression> expr_;

View file

@ -45,6 +45,9 @@ namespace xo {
case exprtype::constant:
_do_eval_constant_op();
break;
case exprtype::variable:
_do_eval_variable_op();
break;
}
}
@ -58,6 +61,12 @@ namespace xo {
this->pc_ = this->cont_;
}
void
VirtualSchematikaMachine::_do_eval_variable_op()
{
// not implemented
assert(false);
}
} /*namespace scm*/
} /*namespace xo*/