xo-interpreter2 stack: define-expr's work at top-level

This commit is contained in:
Roland Conybeare 2026-02-17 14:42:17 -05:00
commit 6f3833d6fb
56 changed files with 1550 additions and 65 deletions

View file

@ -1,5 +1,5 @@
/** @file DDefineExpr.hpp
*
*
* @author Roland Conybeare, Jan 2026
**/
@ -23,6 +23,7 @@ namespace xo {
class DDefineExpr {
public:
using ppindentinfo = xo::print::ppindentinfo;
using ACollector = xo::mm::ACollector;
using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr;
@ -67,6 +68,14 @@ namespace xo {
TypeDescr valuetype() const noexcept { return lhs_var_->typeref().td(); }
void assign_valuetype(TypeDescr td) noexcept;
///@}
/** @defgroup scm-defineexpr-gcobject-facet **/
///@{
std::size_t shallow_size() const noexcept;
DDefineExpr * shallow_copy(obj<AAllocator> mm) const noexcept;
std::size_t forward_children(obj<ACollector> gc) noexcept;
///@}
/** @defgroup scm-defineexpr-printable-facet **/
///@{

View file

@ -32,6 +32,7 @@ namespace xo {
using AAllocator = xo::mm::AAllocator;
using MemorySizeVisitor = xo::mm::MemorySizeVisitor;
using ppindentinfo = xo::print::ppindentinfo;
using size_type = std::uint32_t;
public:
/** @defgroup scm-globalsymtab-ctors constructors **/
@ -55,6 +56,9 @@ namespace xo {
/** @defgroup scm-globalsymtab-access-methods access methods **/
///@{
size_type size() const noexcept { return map_->size(); }
size_type capacity() const noexcept { return map_->capacity(); }
/** visit symtab-owned memory pools; call visitor(info) for each **/
void visit_pools(const MemorySizeVisitor & visitor) const;

View file

@ -7,7 +7,7 @@
#include "DDefineExpr.hpp"
#include "detail/IExpression_DDefineExpr.hpp"
//#include "detail/IGCObject_DDefineExpr.hpp"
#include "define/IGCObject_DDefineExpr.hpp"
#include "detail/IPrintable_DDefineExpr.hpp"
/* end DefineExpr.hpp */

View file

@ -0,0 +1,67 @@
/** @file IGCObject_DDefineExpr.hpp
*
* Generated automagically from ingredients:
* 1. code generator:
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IGCObject_DDefineExpr.json5]
* 2. jinja2 template for abstract facet .hpp file:
* [iface_facet_repr.hpp.j2]
* 3. idl for facet methods
* [idl/IGCObject_DDefineExpr.json5]
**/
#pragma once
#include "GCObject.hpp"
#include <xo/gc/GCObject.hpp>
#include <xo/alloc2/Allocator.hpp>
#include "DDefineExpr.hpp"
namespace xo { namespace scm { class IGCObject_DDefineExpr; } }
namespace xo {
namespace facet {
template <>
struct FacetImplementation<xo::mm::AGCObject,
xo::scm::DDefineExpr>
{
using ImplType = xo::mm::IGCObject_Xfer
<xo::scm::DDefineExpr,
xo::scm::IGCObject_DDefineExpr>;
};
}
}
namespace xo {
namespace scm {
/** @class IGCObject_DDefineExpr
**/
class IGCObject_DDefineExpr {
public:
/** @defgroup scm-gcobject-ddefineexpr-type-traits **/
///@{
using size_type = xo::mm::AGCObject::size_type;
using AAllocator = xo::mm::AGCObject::AAllocator;
using ACollector = xo::mm::AGCObject::ACollector;
using Copaque = xo::mm::AGCObject::Copaque;
using Opaque = xo::mm::AGCObject::Opaque;
///@}
/** @defgroup scm-gcobject-ddefineexpr-methods **/
///@{
// const methods
/** memory consumption for this instance **/
static size_type shallow_size(const DDefineExpr & self) noexcept;
/** copy instance using allocator **/
static Opaque shallow_copy(const DDefineExpr & self, obj<AAllocator> mm) noexcept;
// non-const methods
/** during GC: forward immdiate children **/
static size_type forward_children(DDefineExpr & self, obj<ACollector> gc) noexcept;
///@}
};
} /*namespace scm*/
} /*namespace xo*/
/* end */