xo-reader2: + SyntaxStateMachine.forward_children method

Support gc traversal with goal of making ParserStateMachine a gc root
This commit is contained in:
Roland Conybeare 2026-03-24 17:43:45 -04:00
commit 3af72fec64
91 changed files with 626 additions and 39 deletions

View file

@ -55,6 +55,7 @@ namespace xo {
class DIfElseSsm : public DSyntaxStateMachine<DIfElseSsm> {
public:
using Super = DSyntaxStateMachine<DIfElseSsm>;
using ACollector = xo::mm::ACollector;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using TypeDescr = xo::reflect::TypeDescr;
@ -167,6 +168,13 @@ namespace xo {
parserstatemachine * p_psm) override;
#endif
/** @defgroup scm-ifelsessm-gc-support gc support methods **/
///@{
void forward_children(obj<ACollector> gc) noexcept;
///@}
private:
#ifdef NOT_YET
static std::unique_ptr<if_else_xs> make();

View file

@ -42,6 +42,7 @@ namespace xo {
/** @defgroup scm-syntaxstatemachine-difelsessm-type-traits **/
///@{
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using ACollector = xo::scm::ASyntaxStateMachine::ACollector;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
@ -75,6 +76,8 @@ namespace xo {
static void on_parsed_expression_with_token(DIfElseSsm & self, obj<AExpression> expr, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DIfElseSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: move immediate children to to-space and sub forwarding pointer **/
static void forward_children(DIfElseSsm & self, obj<ACollector> gc);
///@}
};