xo-interpreter2 stack: + reason arg to visit_gco_children()

Helps streamline DX1Collector in xo-gc/.
Want both forward and verify entry points for the same
representation.
This commit is contained in:
Roland Conybeare 2026-04-10 01:10:03 -04:00
commit d14f119a37
102 changed files with 258 additions and 167 deletions

View file

@ -29,7 +29,7 @@
{ name: "TypeDescr", doc: [ "reflected c++ type" ], definition: "xo::reflect::TypeDescr" },
{ name: "AGCObjectVisitor", doc: [ "gc visitor interface" ], definition: "xo::mm::AGCObjectVisitor" },
{ name: "AGCObject", doc: [ "gc-aware object" ], definition: "xo::mm::AGCObject" },
// { name: string, doc: [ string ], definition: string },
{ name: "VisitReason", doc: [ "hint when traversing gco graph" ], definition: "xo::mm::VisitReason" },
],
const_methods: [
{
@ -151,6 +151,7 @@
doc: ["gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each"],
return_type: "void",
args: [
{type: "VisitReason", name: "reason"},
{type: "obj<AGCObjectVisitor>", name: "gc"},
],
}

View file

@ -74,6 +74,7 @@ namespace xo {
using Super = DSyntaxStateMachine<DDefineSsm>;
using TypeDescr = xo::reflect::TypeDescr;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
@ -200,7 +201,8 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -18,6 +18,7 @@ namespace xo {
using Super = DSyntaxStateMachine<DExpectExprSsm>;
using TypeDescr = xo::reflect::TypeDescr;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
@ -194,7 +195,7 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -56,6 +56,7 @@ namespace xo {
public:
using Super = DSyntaxStateMachine<DExpectFormalArglistSsm>;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using TypeDescr = xo::reflect::TypeDescr;
@ -130,7 +131,8 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -58,6 +58,7 @@ namespace xo {
public:
using Super = DSyntaxStateMachine<DExpectQArraySsm>;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using TypeDescr = xo::reflect::TypeDescr;
@ -123,7 +124,8 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -59,6 +59,7 @@ namespace xo {
public:
using Super = DSyntaxStateMachine<DExpectQListSsm>;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using TypeDescr = xo::reflect::TypeDescr;
@ -124,7 +125,7 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -16,6 +16,7 @@ namespace xo {
public:
using Super = DSyntaxStateMachine<DExpectQLiteralSsm>;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using TypeDescr = xo::reflect::TypeDescr;
@ -129,7 +130,7 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -22,6 +22,7 @@ namespace xo {
public:
using Super = DSyntaxStateMachine<DExpectSymbolSsm>;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using DArena = xo::mm::DArena;
using TypeDescr = xo::reflect::TypeDescr;
using ppindentinfo = xo::print::ppindentinfo;
@ -80,7 +81,7 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
};

View file

@ -29,6 +29,7 @@ namespace xo {
using Super = DSyntaxStateMachine<DExpectTypeSsm>;
using TypeDescr = xo::reflect::TypeDescr;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
@ -87,7 +88,8 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -27,9 +27,9 @@ namespace xo {
class DGlobalEnv {
public:
using TypeDescr = xo::reflect::TypeDescr;
//using ACollector = xo::mm::ACollector;
using AGCObject = xo::mm::AGCObject;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using MemorySizeVisitor = xo::mm::MemorySizeVisitor;
using ppindentinfo = xo::print::ppindentinfo;
@ -73,7 +73,7 @@ namespace xo {
///@{
DGlobalEnv * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
/** @defgroup scm-globalenv-printable-facet **/

View file

@ -90,6 +90,7 @@ namespace xo {
using Super = DSyntaxStateMachine<DProgressSsm>;
using TypeDescr = xo::reflect::TypeDescr;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
@ -217,7 +218,8 @@ namespace xo {
/** @defgroup scm-progressssm-gc-support gc support methods **/
///@{
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -66,6 +66,7 @@ namespace xo {
using Super = DSyntaxStateMachine<DQuoteSsm>;
using TypeDescr = xo::reflect::TypeDescr;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
@ -150,7 +151,7 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
private:

View file

@ -30,6 +30,7 @@ namespace xo {
public:
using Super = DSyntaxStateMachine<DSequenceSsm>;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
@ -97,7 +98,8 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -41,6 +41,7 @@ namespace xo {
using Super = DSyntaxStateMachine<DToplevelSeqSsm>;
using TypeDescr = xo::reflect::TypeDescr;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
@ -161,7 +162,7 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -33,6 +33,7 @@ namespace xo {
class ParserResult {
public:
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using ppindentinfo = xo::print::ppindentinfo;
public:
@ -69,7 +70,7 @@ namespace xo {
bool pretty(const ppindentinfo & ppii) const;
/** gc support: forward gc-eligible children **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
public:
/** none|expression|error_description

View file

@ -24,6 +24,7 @@ namespace xo {
public:
//using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
@ -56,7 +57,8 @@ namespace xo {
/** pretty-printer support **/
bool pretty(const ppindentinfo & ppii) const;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
private:
/** stack pointer: top of stack just before this instance created **/

View file

@ -40,10 +40,11 @@ namespace xo {
public:
using TypeDescr = xo::reflect::TypeDescr;
using ACollector = xo::mm::ACollector;
using AGCObject = xo::mm::AGCObject;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using ArenaConfig = xo::mm::ArenaConfig;
using AGCObject = xo::mm::AGCObject;
using DArena = xo::mm::DArena;
using MemorySizeVisitor = xo::mm::MemorySizeVisitor;
using ArenaHashMapConfig = xo::map::ArenaHashMapConfig;
@ -354,7 +355,8 @@ namespace xo {
///@{
/** update gc-aware exit pointers from this ParserStateMachine **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -15,12 +15,14 @@ namespace xo {
struct ReaderResult {
using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using span_type = xo::mm::span<const char>;
bool is_tk_error() const { return tk_error_.is_error(); }
/** forward gc-aware pointers (called during gc cycle) **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
/** schematika expression parsed from input **/
obj<AExpression> expr_;
@ -43,6 +45,7 @@ namespace xo {
public:
using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using MemorySizeVisitor = xo::mm::MemorySizeVisitor;
using span_type = xo::mm::span<const char>;
@ -110,7 +113,8 @@ namespace xo {
void reset_to_idle_toplevel();
/** update gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
private:
/** tokenizer converts a stream of chars

View file

@ -8,7 +8,6 @@
#include "DSyntaxStateMachine.hpp"
#include "syntaxstatetype.hpp"
#include <xo/expression2/ApplyExpr.hpp>
//#include <xo/facet/obj.hpp>
#include <string_view>
@ -66,12 +65,11 @@ namespace xo {
using Super = DSyntaxStateMachine<DApplySsm>;
using TypeDescr = xo::reflect::TypeDescr;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
//using Apply = xo::scm::Apply;
public:
/** @defgroup scm-applyssm-ctors constructors **/
///@{
@ -190,7 +188,8 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DApplySsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DApplySsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DApplySsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DDefineSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DDefineSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DDefineSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -67,6 +67,7 @@ namespace xo {
using Super = DSyntaxStateMachine<DDeftypeSsm>;
using TypeDescr = xo::reflect::TypeDescr;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
@ -172,7 +173,7 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DDeftypeSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DDeftypeSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DDeftypeSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -45,6 +45,7 @@ namespace xo {
using AAllocator = xo::mm::AGCObject::AAllocator;
using ACollector = xo::mm::AGCObject::ACollector;
using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor;
using VisitReason = xo::mm::AGCObject::VisitReason;
using Copaque = xo::mm::AGCObject::Copaque;
using Opaque = xo::mm::AGCObject::Opaque;
///@}
@ -59,7 +60,7 @@ Arguably abusing the word 'visitor' here **/
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/
static void visit_gco_children(DGlobalEnv & self, obj<AGCObjectVisitor> fn) noexcept;
static void visit_gco_children(DGlobalEnv & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept;
///@}
};

View file

@ -49,6 +49,7 @@ namespace xo {
using Super = DSyntaxStateMachine<DExpectFormalArgSsm>;
using TypeDescr = xo::reflect::TypeDescr;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
@ -126,7 +127,8 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DExpectFormalArgSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DExpectFormalArgSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DExpectFormalArgSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -63,6 +63,7 @@ namespace xo {
using Super = DSyntaxStateMachine<DExpectListTypeSsm>;
using TypeDescr = xo::reflect::TypeDescr;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
@ -135,7 +136,8 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
///@}
private:

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DExpectListTypeSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DExpectListTypeSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DExpectListTypeSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -64,6 +64,7 @@ namespace xo {
public:
using Super = DSyntaxStateMachine<DExpectQDictSsm>;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
@ -159,7 +160,8 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DExpectQDictSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DExpectQDictSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DExpectQDictSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -56,6 +56,7 @@ namespace xo {
public:
using Super = DSyntaxStateMachine<DIfElseSsm>;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using TypeDescr = xo::reflect::TypeDescr;
@ -171,7 +172,8 @@ namespace xo {
/** @defgroup scm-ifelsessm-gc-support gc support methods **/
///@{
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DIfElseSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DIfElseSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DIfElseSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -60,6 +60,7 @@ namespace xo {
using Super = DSyntaxStateMachine<DLambdaSsm>;
using DLocalSymtab = xo::scm::DLocalSymtab;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using TypeDescr = xo::reflect::TypeDescr;
@ -189,7 +190,8 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DLambdaSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DLambdaSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DLambdaSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -51,6 +51,7 @@ namespace xo {
using Super = DSyntaxStateMachine<DParenSsm>;
using TypeDescr = xo::reflect::TypeDescr;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
@ -136,7 +137,8 @@ namespace xo {
///@{
/** gc support: visit immediate gc-aware children **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DParenSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DParenSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DParenSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -164,9 +164,9 @@ namespace xo {
using token_type = Token;
using ArenaHashMapConfig = xo::map::ArenaHashMapConfig;
using ArenaConfig = xo::mm::ArenaConfig;
//using ACollector = xo::mm::ACollector;
using AGCObject = xo::mm::AGCObject;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using VisitReason = xo::mm::VisitReason;
using AAllocator = xo::mm::AAllocator;
using MemorySizeVisitor = xo::mm::MemorySizeVisitor;
using ppindentinfo = xo::print::ppindentinfo;
@ -297,7 +297,7 @@ namespace xo {
/** not implemented (SchematikaParser not designed to be copyable) **/
DSchematikaParser * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
/** forward gc-aware children **/
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
///@}
private:

View file

@ -45,6 +45,7 @@ namespace xo {
using AAllocator = xo::mm::AGCObject::AAllocator;
using ACollector = xo::mm::AGCObject::ACollector;
using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor;
using VisitReason = xo::mm::AGCObject::VisitReason;
using Copaque = xo::mm::AGCObject::Copaque;
using Opaque = xo::mm::AGCObject::Opaque;
///@}
@ -59,7 +60,7 @@ Arguably abusing the word 'visitor' here **/
/** Invoke fn.visit_child(iface,data) for each child GCObject pointer.
Context: provides address of data pointer so it can be updated in place
when @p fn invokes garbage collector reentry point **/
static void visit_gco_children(DSchematikaParser & self, obj<AGCObjectVisitor> fn) noexcept;
static void visit_gco_children(DSchematikaParser & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept;
///@}
};

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DQuoteSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DQuoteSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DQuoteSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -50,6 +50,8 @@ public:
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
/** gc-aware object **/
using AGCObject = xo::mm::AGCObject;
/** hint when traversing gco graph **/
using VisitReason = xo::mm::VisitReason;
///@}
/** @defgroup scm-syntaxstatemachine-methods **/
@ -91,7 +93,7 @@ public:
/** update state machine for nested quoted literal @p lit **/
virtual void on_quoted_literal(Opaque data, obj<AGCObject> lit, ParserStateMachine * p_psm) = 0;
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
virtual void visit_gco_children(Opaque data, obj<AGCObjectVisitor> gc) = 0;
virtual void visit_gco_children(Opaque data, VisitReason reason, obj<AGCObjectVisitor> gc) = 0;
///@}
}; /*ASyntaxStateMachine*/

View file

@ -47,6 +47,7 @@ namespace scm {
using TypeDescr = ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = ASyntaxStateMachine::AGCObject;
using VisitReason = ASyntaxStateMachine::VisitReason;
///@}
/** @defgroup scm-syntaxstatemachine-any-methods **/
@ -75,7 +76,7 @@ namespace scm {
[[noreturn]] void on_parsed_expression(Opaque, obj<AExpression>, ParserStateMachine *) override;
[[noreturn]] void on_parsed_expression_with_token(Opaque, obj<AExpression>, const Token &, ParserStateMachine *) override;
[[noreturn]] void on_quoted_literal(Opaque, obj<AGCObject>, ParserStateMachine *) override;
[[noreturn]] void visit_gco_children(Opaque, obj<AGCObjectVisitor>) override;
[[noreturn]] void visit_gco_children(Opaque, VisitReason, obj<AGCObjectVisitor>) override;
///@}

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DExpectExprSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DExpectExprSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DExpectExprSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DExpectFormalArglistSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DExpectFormalArglistSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DExpectFormalArglistSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DExpectQArraySsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DExpectQArraySsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DExpectQArraySsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DExpectQListSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DExpectQListSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DExpectQListSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DExpectQLiteralSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DExpectQLiteralSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DExpectQLiteralSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DExpectSymbolSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DExpectSymbolSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DExpectSymbolSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DExpectTypeSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DExpectTypeSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DExpectTypeSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DProgressSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DProgressSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DProgressSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DSequenceSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DSequenceSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DSequenceSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -44,6 +44,7 @@ namespace xo {
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using VisitReason = xo::scm::ASyntaxStateMachine::VisitReason;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
@ -77,7 +78,7 @@ namespace xo {
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DToplevelSeqSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DToplevelSeqSsm & self, obj<AGCObjectVisitor> gc);
static void visit_gco_children(DToplevelSeqSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc);
///@}
};

View file

@ -36,6 +36,7 @@ namespace scm {
using TypeDescr = ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = ASyntaxStateMachine::AGCObject;
using VisitReason = ASyntaxStateMachine::VisitReason;
///@}
/** @defgroup scm-syntaxstatemachine-xfer-methods **/
@ -89,8 +90,8 @@ namespace scm {
void on_quoted_literal(Opaque data, obj<AGCObject> lit, ParserStateMachine * p_psm) override {
return I::on_quoted_literal(_dcast(data), lit, p_psm);
}
void visit_gco_children(Opaque data, obj<AGCObjectVisitor> gc) override {
return I::visit_gco_children(_dcast(data), gc);
void visit_gco_children(Opaque data, VisitReason reason, obj<AGCObjectVisitor> gc) override {
return I::visit_gco_children(_dcast(data), reason, gc);
}
///@}

View file

@ -34,6 +34,7 @@ public:
using TypeDescr = ASyntaxStateMachine::TypeDescr;
using AGCObjectVisitor = ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = ASyntaxStateMachine::AGCObject;
using VisitReason = ASyntaxStateMachine::VisitReason;
///@}
/** @defgroup scm-syntaxstatemachine-router-ctors **/
@ -93,8 +94,8 @@ public:
void on_quoted_literal(obj<AGCObject> lit, ParserStateMachine * p_psm) {
return O::iface()->on_quoted_literal(O::data(), lit, p_psm);
}
void visit_gco_children(obj<AGCObjectVisitor> gc) {
return O::iface()->visit_gco_children(O::data(), gc);
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) {
return O::iface()->visit_gco_children(O::data(), reason, gc);
}
///@}

View file

@ -397,10 +397,11 @@ namespace xo {
}
void
DApplySsm::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DApplySsm::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_poly_child(&fn_expr_);
gc.visit_child(&args_expr_v_);
gc.visit_poly_child(reason, &fn_expr_);
gc.visit_child(reason, &args_expr_v_);
}
} /*namespace scm*/

View file

@ -692,9 +692,10 @@ namespace xo {
// ----- gc support -----
void
DDefineSsm::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DDefineSsm::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_child(&def_expr_.data_);
gc.visit_child(reason, &def_expr_.data_);
}
} /*namespace scm*/
} /*namespace xo*/

View file

@ -271,7 +271,7 @@ namespace xo {
refrtag("expect", this->get_expect_str()));
}
void
DDeftypeSsm::visit_gco_children(obj<AGCObjectVisitor>) noexcept
DDeftypeSsm::visit_gco_children(VisitReason, obj<AGCObjectVisitor>) noexcept
{
static_assert(!DUniqueString::is_gc_eligible());
}

View file

@ -625,7 +625,8 @@ namespace xo {
#endif
void
DExpectExprSsm::visit_gco_children(obj<AGCObjectVisitor>) noexcept
DExpectExprSsm::visit_gco_children(VisitReason,
obj<AGCObjectVisitor>) noexcept
{
// all members POD, skip
}

View file

@ -265,7 +265,8 @@ namespace xo {
}
void
DExpectFormalArgSsm::visit_gco_children(obj<AGCObjectVisitor>) noexcept
DExpectFormalArgSsm::visit_gco_children(VisitReason,
obj<AGCObjectVisitor>) noexcept
{
static_assert(!DUniqueString::is_gc_eligible());
}

View file

@ -358,9 +358,10 @@ namespace xo {
}
void
DExpectFormalArglistSsm::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DExpectFormalArglistSsm::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_child(&argl_);
gc.visit_child(reason, &argl_);
}
} /*namespace scm*/

View file

@ -204,9 +204,10 @@ namespace xo {
}
void
DExpectListTypeSsm::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DExpectListTypeSsm::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_poly_child(&elt_type_);
gc.visit_poly_child(reason, &elt_type_);
}
} /*namespace scm*/

View file

@ -220,9 +220,10 @@ namespace xo {
refrtag("array", array_pr));
}
void
DExpectQArraySsm::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DExpectQArraySsm::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_child(&array_);
gc.visit_child(reason, &array_);
}
}

View file

@ -267,10 +267,11 @@ namespace xo {
void
DExpectQDictSsm::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DExpectQDictSsm::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_child(&key_);
gc.visit_child(&dict_);
gc.visit_child(reason, &key_);
gc.visit_child(reason, &dict_);
}
} /*namespace scm*/

View file

@ -215,10 +215,11 @@ namespace xo {
refrtag("list", list_pr));
}
void
DExpectQListSsm::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DExpectQListSsm::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_child(&start_);
gc.visit_child(&end_);
gc.visit_child(reason, &start_);
gc.visit_child(reason, &end_);
}
}

View file

@ -256,7 +256,7 @@ namespace xo {
refrtag("expect", this->get_expect_str()));
}
void
DExpectQLiteralSsm::visit_gco_children(obj<AGCObjectVisitor>) noexcept
DExpectQLiteralSsm::visit_gco_children(VisitReason, obj<AGCObjectVisitor>) noexcept
{
// cxl_on_rightparen_, cxl_on_rightbracket_: POD, skip
}

View file

@ -146,7 +146,8 @@ namespace xo {
);
}
void
DExpectSymbolSsm::visit_gco_children(obj<AGCObjectVisitor>) noexcept
DExpectSymbolSsm::visit_gco_children(VisitReason,
obj<AGCObjectVisitor>) noexcept
{
// no gc-aware members
}

View file

@ -198,7 +198,8 @@ namespace xo {
}
void
DExpectTypeSsm::visit_gco_children(obj<AGCObjectVisitor>) noexcept
DExpectTypeSsm::visit_gco_children(VisitReason,
obj<AGCObjectVisitor>) noexcept
{
// corrected_: POD, skip
}

View file

@ -114,10 +114,11 @@ namespace xo {
}
void
DGlobalEnv::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DGlobalEnv::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_child(&symtab_);
gc.visit_child(&values_);
gc.visit_child(reason, &symtab_);
gc.visit_child(reason, &values_);
}
// ----- APrintable facet -----

View file

@ -510,9 +510,10 @@ namespace xo {
}
void
DIfElseSsm::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DIfElseSsm::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_poly_child(&if_expr_);
gc.visit_poly_child(reason, &if_expr_);
}
} /*namespace scm*/
} /*namespace xo*/

View file

@ -471,15 +471,16 @@ namespace xo {
}
void
DLambdaSsm::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DLambdaSsm::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_child(&local_symtab_);
gc.visit_child(reason, &local_symtab_);
// explicit_return_td not gcobject
// lambda_td not gcobject
gc.visit_poly_child(&body_);
gc.visit_poly_child(&parent_symtab_);
gc.visit_poly_child(reason, &body_);
gc.visit_poly_child(reason, &parent_symtab_);
}
} /*namespace scm*/

View file

@ -459,9 +459,10 @@ namespace xo {
}
void
DParenSsm::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DParenSsm::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_poly_child(&expr_);
gc.visit_poly_child(reason, &expr_);
}
} /*namespace scm*/
} /*namespace xo*/

View file

@ -1244,10 +1244,11 @@ case optype::op_assign:
}
void
DProgressSsm::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DProgressSsm::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_poly_child(&lhs_);
gc.visit_poly_child(&rhs_);
gc.visit_poly_child(reason, &lhs_);
gc.visit_poly_child(reason, &rhs_);
}
} /*namespace scm*/

View file

@ -212,9 +212,10 @@ namespace xo {
}
void
DQuoteSsm::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DQuoteSsm::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_poly_child(&expr_);
gc.visit_poly_child(reason, &expr_);
}
} /*namespace scm*/

View file

@ -197,9 +197,10 @@ namespace xo {
}
void
DSchematikaParser::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DSchematikaParser::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
psm_.visit_gco_children(gc);
psm_.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -258,9 +258,10 @@ namespace xo {
}
void
DSequenceSsm::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DSequenceSsm::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_child(&seq_expr_);
gc.visit_child(reason, &seq_expr_);
}
} /*namespace scm*/

View file

@ -518,7 +518,7 @@ namespace xo {
refrtag("seqtype", seqtype_));
}
void
DToplevelSeqSsm::visit_gco_children(obj<AGCObjectVisitor>) noexcept
DToplevelSeqSsm::visit_gco_children(VisitReason, obj<AGCObjectVisitor>) noexcept
{
// seqtype_: POD, skip
}

View file

@ -96,7 +96,7 @@ ISyntaxStateMachine_Any::on_quoted_literal(Opaque, obj<AGCObject>, ParserStateMa
}
auto
ISyntaxStateMachine_Any::visit_gco_children(Opaque, obj<AGCObjectVisitor>) -> void
ISyntaxStateMachine_Any::visit_gco_children(Opaque, VisitReason, obj<AGCObjectVisitor>) -> void
{
_fatal();
}

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DExpectExprSsm::visit_gco_children(DExpectExprSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DExpectExprSsm::visit_gco_children(DExpectExprSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DExpectFormalArglistSsm::visit_gco_children(DExpectFormalArglistSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DExpectFormalArglistSsm::visit_gco_children(DExpectFormalArglistSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DExpectQArraySsm::visit_gco_children(DExpectQArraySsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DExpectQArraySsm::visit_gco_children(DExpectQArraySsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DExpectQListSsm::visit_gco_children(DExpectQListSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DExpectQListSsm::visit_gco_children(DExpectQListSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DExpectQLiteralSsm::visit_gco_children(DExpectQLiteralSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DExpectQLiteralSsm::visit_gco_children(DExpectQLiteralSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DExpectSymbolSsm::visit_gco_children(DExpectSymbolSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DExpectSymbolSsm::visit_gco_children(DExpectSymbolSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DExpectTypeSsm::visit_gco_children(DExpectTypeSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DExpectTypeSsm::visit_gco_children(DExpectTypeSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DParenSsm::visit_gco_children(DParenSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DParenSsm::visit_gco_children(DParenSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DProgressSsm::visit_gco_children(DProgressSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DProgressSsm::visit_gco_children(DProgressSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DSequenceSsm::visit_gco_children(DSequenceSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DSequenceSsm::visit_gco_children(DSequenceSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DToplevelSeqSsm::visit_gco_children(DToplevelSeqSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DToplevelSeqSsm::visit_gco_children(DToplevelSeqSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -106,12 +106,13 @@ namespace xo {
}
void
ParserResult::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
ParserResult::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
// {result_type_, error_src_fn_}: pod, ignore
gc.visit_poly_child(&result_expr_);
gc.visit_child(&error_description_);
gc.visit_poly_child(reason, &result_expr_);
gc.visit_child(reason, &error_description_);
}
} /*namespace scm*/
} /*namespace xo*/

View file

@ -90,14 +90,15 @@ namespace xo {
}
void
ParserStack::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
ParserStack::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
for (ParserStack * target = this; target; target = target->parent_) {
// ParserStack::ckp: skip, POD
if (target->ssm_)
target->ssm_.visit_gco_children(gc);
target->ssm_.visit_gco_children(reason, gc);
}
}

View file

@ -907,7 +907,8 @@ namespace xo {
#endif
void
ParserStateMachine::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
ParserStateMachine::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
//scope log(XO_DEBUG(true));
@ -916,23 +917,23 @@ namespace xo {
//log && log("forward stack_", xtag("addr", stack_));
if (stack_) {
stack_->visit_gco_children(gc);
stack_->visit_gco_children(reason, gc);
}
// static_assert(!expr_alloc_.is_gc_eligible());
// static_assert(!aux_alloc_.is_gc_eligible());
//log && log("global_symtab_", xtag("addr", global_symtab_.data()));
gc.visit_child(&global_symtab_);
gc.visit_child(reason, &global_symtab_);
//log && log("local_symtab_", xtag("addr", local_symtab_.data()));
gc.visit_child(&local_symtab_);
gc.visit_child(reason, &local_symtab_);
//log && log("global_env_", xtag("addr", global_env_.data()));
gc.visit_child(&global_env_);
gc.visit_child(reason, &global_env_);
//log && log("result_");
result_.visit_gco_children(gc);
result_.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -10,9 +10,10 @@ namespace xo {
namespace scm {
void
ReaderResult::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
ReaderResult::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_poly_child(&expr_);
gc.visit_poly_child(reason, &expr_);
}
// ----- SchematikaReader -----
@ -208,12 +209,13 @@ namespace xo {
}
void
SchematikaReader::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
SchematikaReader::visit_gco_children(VisitReason reason,
obj<AGCObjectVisitor> gc) noexcept
{
// tokenizer doesn't contain any gc-aware pointers.
parser_.visit_gco_children(gc);
result_.visit_gco_children(gc);
parser_.visit_gco_children(reason, gc);
result_.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -21,9 +21,9 @@ namespace xo {
return self.gco_shallow_move(gc);
}
auto
IGCObject_DGlobalEnv::visit_gco_children(DGlobalEnv & self, obj<AGCObjectVisitor> fn) noexcept -> void
IGCObject_DGlobalEnv::visit_gco_children(DGlobalEnv & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept -> void
{
self.visit_gco_children(fn);
self.visit_gco_children(reason, fn);
}
} /*namespace scm*/

View file

@ -21,9 +21,9 @@ namespace xo {
return self.gco_shallow_move(gc);
}
auto
IGCObject_DSchematikaParser::visit_gco_children(DSchematikaParser & self, obj<AGCObjectVisitor> fn) noexcept -> void
IGCObject_DSchematikaParser::visit_gco_children(DSchematikaParser & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept -> void
{
self.visit_gco_children(fn);
self.visit_gco_children(reason, fn);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DApplySsm::visit_gco_children(DApplySsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DApplySsm::visit_gco_children(DApplySsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DDefineSsm::visit_gco_children(DDefineSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DDefineSsm::visit_gco_children(DDefineSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DDeftypeSsm::visit_gco_children(DDeftypeSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DDeftypeSsm::visit_gco_children(DDeftypeSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DExpectFormalArgSsm::visit_gco_children(DExpectFormalArgSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DExpectFormalArgSsm::visit_gco_children(DExpectFormalArgSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DExpectListTypeSsm::visit_gco_children(DExpectListTypeSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DExpectListTypeSsm::visit_gco_children(DExpectListTypeSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DExpectQDictSsm::visit_gco_children(DExpectQDictSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DExpectQDictSsm::visit_gco_children(DExpectQDictSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

View file

@ -78,9 +78,9 @@ namespace xo {
self.on_quoted_literal(lit, p_psm);
}
auto
ISyntaxStateMachine_DIfElseSsm::visit_gco_children(DIfElseSsm & self, obj<AGCObjectVisitor> gc) -> void
ISyntaxStateMachine_DIfElseSsm::visit_gco_children(DIfElseSsm & self, VisitReason reason, obj<AGCObjectVisitor> gc) -> void
{
self.visit_gco_children(gc);
self.visit_gco_children(reason, gc);
}
} /*namespace scm*/

Some files were not shown because too many files have changed in this diff Show more