xo-umbrella2/xo-interpreter2/include/xo/interpreter2/DVsmDefContFrame.hpp
Roland Conybeare 7f4b4e7cbd git subrepo clone (merge) git@github.com:Rconybea/xo-interpreter2.git xo-interpreter2
subrepo:
  subdir:   "xo-interpreter2"
  merged:   "e4c6ff57"
upstream:
  origin:   "git@github.com:Rconybea/xo-interpreter2.git"
  branch:   "main"
  commit:   "e4c6ff57"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
2026-06-06 22:13:05 -04:00

82 lines
2.7 KiB
C++

/** @file DVsmDefContFrame.hpp
*
* @author Roland Conybeare, Feb 2026
**/
#pragma once
#include "VsmInstr.hpp"
#include <xo/expression2/DefineExpr.hpp>
#include <xo/alloc2/GCObject.hpp>
namespace xo {
namespace scm {
/** @brief saved VSM state during evaluation of a SequenceExpr
**/
class DVsmDefContFrame {
public:
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using AGCObject = xo::mm::AGCObject;
using ppindentinfo = xo::print::ppindentinfo;
public:
/** @defgroup scm-vsmdefcontframe-ctors constructors **/
///@{
DVsmDefContFrame(obj<AGCObject> parent,
VsmInstr cont,
DDefineExpr * def_expr);
/** create instance using memory from allocator @p mm **/
static DVsmDefContFrame * make(obj<AAllocator> mm,
obj<AGCObject> parent_stack,
VsmInstr cont,
DDefineExpr * def_expr);
///@}
/** @defgroup scm-vsmdefcontframe-access-methods access methods **/
///@{
obj<AGCObject> parent() const noexcept { return parent_; }
VsmInstr cont() const noexcept { return cont_; }
DDefineExpr * def_expr() const noexcept { return def_expr_; }
///@}
/** @defgroup scm-vsmdefcontframe-general-methods general methods **/
///@{
///@}
/** @defgroup scm-vsmdefcontframe-gcobject-facet gcobject facet **/
///@{
DVsmDefContFrame * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
/** @defgrouop scm-vsmseqcontframe-printable-facet printable facet **/
///@{
bool pretty(const ppindentinfo & ppii) const noexcept;
///@}
private:
/** @defgroup scm-vsmdefcontframe-members member variables **/
///@{
/** saved VSM stack; restore when this frame consumed **/
obj<AGCObject> parent_;
/** saved continuation; restore when this frame consumed **/
VsmInstr cont_;
/** saved expr. evaluate elements of this sequence in order **/
DDefineExpr * def_expr_ = nullptr;
///@}
};
} /*namespace scm*/
} /*namespace xo*/
/* end DVsmDefContFrame.hpp */