xo-interpreter2 stack: define-expr's work at top-level
This commit is contained in:
parent
57f6f9073e
commit
6f3833d6fb
56 changed files with 1550 additions and 65 deletions
68
xo-interpreter2/src/interpreter2/DVsmDefContFrame.cpp
Normal file
68
xo-interpreter2/src/interpreter2/DVsmDefContFrame.cpp
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
/** @file DVsmDefContFrame.cpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#include "DVsmDefContFrame.hpp"
|
||||
#include <xo/expression2/DefineExpr.hpp>
|
||||
#include <xo/gc/Collector.hpp>
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
|
||||
DVsmDefContFrame::DVsmDefContFrame(obj<AGCObject> parent,
|
||||
VsmInstr cont,
|
||||
DDefineExpr * def_expr)
|
||||
: parent_{parent},
|
||||
cont_{cont},
|
||||
def_expr_{def_expr}
|
||||
{}
|
||||
|
||||
DVsmDefContFrame *
|
||||
DVsmDefContFrame::make(obj<AAllocator> mm,
|
||||
obj<AGCObject> parent,
|
||||
VsmInstr cont,
|
||||
DDefineExpr * def_expr)
|
||||
{
|
||||
void * mem = mm.alloc_for<DVsmDefContFrame>();
|
||||
|
||||
return new (mem) DVsmDefContFrame(parent, cont, def_expr);
|
||||
}
|
||||
|
||||
// gcobject facet
|
||||
|
||||
std::size_t
|
||||
DVsmDefContFrame::shallow_size() const noexcept
|
||||
{
|
||||
return sizeof(*this);
|
||||
}
|
||||
|
||||
DVsmDefContFrame *
|
||||
DVsmDefContFrame::shallow_copy(obj<AAllocator> mm) const noexcept
|
||||
{
|
||||
return mm.std_copy_for<DVsmDefContFrame>(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
DVsmDefContFrame::forward_children(obj<ACollector> gc) noexcept
|
||||
{
|
||||
gc.forward_inplace(&parent_);
|
||||
gc.forward_inplace(&def_expr_);
|
||||
|
||||
return this->shallow_size();
|
||||
}
|
||||
|
||||
// printable facet
|
||||
|
||||
bool
|
||||
DVsmDefContFrame::pretty(const ppindentinfo & ppii) const noexcept
|
||||
{
|
||||
return ppii.pps()->pretty_struct(ppii,
|
||||
"DVsmDefContFrame",
|
||||
refrtag("cont", cont_));
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end DVsmDefContFrame.cpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue