xo-reader2 xo-expression2: + DSequenceSsm ++ utest

This commit is contained in:
Roland Conybeare 2026-01-31 18:28:25 -05:00
commit cd369cf2e8
78 changed files with 898 additions and 158 deletions

View file

@ -82,6 +82,18 @@ xo_add_genfacetimpl(
OUTPUT_CPP_DIR src/expression2
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-gcobject-constant
FACET_PKG xo_gc
FACET GCObject
REPR Constant
INPUT idl/IGCObject_DConstant.json5
OUTPUT_HPP_DIR include/xo/expression2
OUTPUT_IMPL_SUBDIR detail
OUTPUT_CPP_DIR src/expression2
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-printable-constant
@ -224,6 +236,18 @@ xo_add_genfacetimpl(
OUTPUT_CPP_DIR src/expression2
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-gcobject-ifelseexpr
FACET_PKG xo_gc
FACET GCObject
REPR IfElseExpr
INPUT idl/IGCObject_DIfElseExpr.json5
OUTPUT_HPP_DIR include/xo/expression2
OUTPUT_IMPL_SUBDIR detail
OUTPUT_CPP_DIR src/expression2
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-expression2-facetimpl-printable-ifelseexpr

View file

@ -0,0 +1,15 @@
{
mode: "implementation",
includes: [
"<xo/gc/GCObject.hpp>",
"<xo/alloc2/Allocator.hpp>"
],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/GCObject.json5",
brief: "provide AGCObject interface for DConstant",
using_doxygen: true,
repr: "DConstant",
doc: [ "implement AGCObject for DConstant" ],
}

View file

@ -0,0 +1,15 @@
{
mode: "implementation",
includes: [
"<xo/gc/GCObject.hpp>",
"<xo/alloc2/Allocator.hpp>"
],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/GCObject.json5",
brief: "provide AGCObject interface for DIfElseExpr",
using_doxygen: true,
repr: "DIfElseExpr",
doc: [ "implement AGCObject for DIfElseExpr" ],
}

View file

@ -8,8 +8,9 @@
#include "Expression.hpp"
#include "TypeRef.hpp"
#include "exprtype.hpp"
#include <xo/reflect/TaggedPtr.hpp>
#include <xo/gc/Collector.hpp>
#include <xo/gc/GCObject.hpp>
#include <xo/reflect/TaggedPtr.hpp>
namespace xo {
namespace scm {
@ -20,6 +21,7 @@ namespace xo {
public:
using TaggedPtr = xo::reflect::TaggedPtr;
using TypeDescr = xo::reflect::TypeDescr;
using ACollector = xo::mm::ACollector;
using AAllocator = xo::mm::AAllocator;
using AGCObject = xo::mm::AGCObject;
using typeseq = xo::reflect::typeseq;
@ -56,6 +58,14 @@ namespace xo {
TypeDescr valuetype() const noexcept { return typeref_.td(); }
void assign_valuetype(TypeDescr td) noexcept { typeref_.resolve(td); }
///@}
/** @defgroup scm-constant-gcobject-facet **/
///@{
size_t shallow_size() const noexcept;
DConstant * shallow_copy(obj<AAllocator> mm) const noexcept;
size_t forward_children(obj<ACollector> gc) noexcept;
///@}
/** @defgroup scm-constant-printable-facet **/
///@{

View file

@ -8,6 +8,7 @@
#include "Expression.hpp"
#include "TypeRef.hpp"
#include "exprtype.hpp"
#include <xo/gc/Collector.hpp>
#include <xo/alloc2/Allocator.hpp>
//#include <vector>
#include <string>
@ -21,6 +22,7 @@ namespace xo {
**/
class DIfElseExpr {
public:
using ACollector = xo::mm::ACollector;
using AAllocator = xo::mm::AAllocator;
using TypeDescr = xo::reflect::TypeDescr;
using ppindentinfo = xo::print::ppindentinfo;
@ -93,6 +95,14 @@ namespace xo {
bool pretty(const ppindentinfo & ppii) const;
///@}
/** @defgroup scm-ifelseexpr-gcobject-facet **/
///@{
std::size_t shallow_size() const noexcept;
DIfElseExpr * shallow_copy(obj<AAllocator> mm) const noexcept;
std::size_t forward_children(obj<ACollector> gc) noexcept;
///@}
#ifdef NOT_YET
virtual std::set<std::string> get_free_variables() const override {

View file

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

View file

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

View file

@ -17,6 +17,7 @@ set(SELF_SRCS
IExpression_Any.cpp
IExpression_DConstant.cpp
IGCObject_DConstant.cpp
IPrintable_DConstant.cpp
IExpression_DVariable.cpp
@ -33,6 +34,7 @@ set(SELF_SRCS
IPrintable_DLambdaExpr.cpp
IExpression_DIfElseExpr.cpp
IGCObject_DIfElseExpr.cpp
IPrintable_DIfElseExpr.cpp
IExpression_DSequenceExpr.cpp

View file

@ -71,6 +71,31 @@ namespace xo {
return nullptr;
}
std::size_t
DConstant::shallow_size() const noexcept
{
return sizeof(DConstant);
}
DConstant *
DConstant::shallow_copy(obj<AAllocator> mm) const noexcept
{
DConstant * copy = (DConstant *)mm.alloc_copy((std::byte *)this);
if (copy)
*copy = *this;
return copy;
}
std::size_t
DConstant::forward_children(obj<ACollector> gc) noexcept
{
gc.forward_inplace(value_.iface(), (void **)&(value_.data_));
return shallow_size();
}
bool
DConstant::pretty(const ppindentinfo & ppii) const
{

View file

@ -5,11 +5,13 @@
#include "DIfElseExpr.hpp"
#include "detail/IExpression_DIfElseExpr.hpp"
#include <xo/gc/GCObject.hpp>
#include <xo/printable2/Printable.hpp>
#include <xo/facet/FacetRegistry.hpp>
#include <xo/reflectutil/typeseq.hpp>
namespace xo {
using xo::mm::AGCObject;
using xo::print::APrintable;
using xo::reflect::typeseq;
using xo::facet::FacetRegistry;
@ -120,6 +122,45 @@ namespace xo {
}
}
// GCObject facet
std::size_t
DIfElseExpr::shallow_size() const noexcept
{
return sizeof(DIfElseExpr);
}
DIfElseExpr *
DIfElseExpr::shallow_copy(obj<AAllocator> mm) const noexcept
{
DIfElseExpr * copy = (DIfElseExpr *)mm.alloc_copy((std::byte *)this);
if (copy)
*copy = *this;
return copy;
}
std::size_t
DIfElseExpr::forward_children(obj<ACollector> gc) noexcept
{
// GC needs to locate AGCObject iface for each member.
{
auto gco = FacetRegistry::instance().variant<AGCObject,AExpression>(test_);
gc.forward_inplace(gco.iface(), (void **)&(test_.data_));
}
{
auto gco = FacetRegistry::instance().variant<AGCObject,AExpression>(when_true_);
gc.forward_inplace(gco.iface(), (void **)&(when_true_.data_));
}
{
auto gco = FacetRegistry::instance().variant<AGCObject,AExpression>(when_false_);
gc.forward_inplace(gco.iface(), (void **)&(when_false_.data_));
}
return shallow_size();
}
// ----------------------------------------------------------------
#ifdef NOPE

View file

@ -0,0 +1,39 @@
/** @file IGCObject_DConstant.cpp
*
* Generated automagically from ingredients:
* 1. code generator:
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IGCObject_DConstant.json5]
* 2. jinja2 template for abstract facet .hpp file:
* [iface_facet_any.hpp.j2]
* 3. idl for facet methods
* [idl/IGCObject_DConstant.json5]
**/
#include "detail/IGCObject_DConstant.hpp"
namespace xo {
namespace scm {
auto
IGCObject_DConstant::shallow_size(const DConstant & self) noexcept -> size_type
{
return self.shallow_size();
}
auto
IGCObject_DConstant::shallow_copy(const DConstant & self, obj<AAllocator> mm) noexcept -> Opaque
{
return self.shallow_copy(mm);
}
auto
IGCObject_DConstant::forward_children(DConstant & self, obj<ACollector> gc) noexcept -> size_type
{
return self.forward_children(gc);
}
} /*namespace scm*/
} /*namespace xo*/
/* end IGCObject_DConstant.cpp */

View file

@ -0,0 +1,39 @@
/** @file IGCObject_DIfElseExpr.cpp
*
* Generated automagically from ingredients:
* 1. code generator:
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IGCObject_DIfElseExpr.json5]
* 2. jinja2 template for abstract facet .hpp file:
* [iface_facet_any.hpp.j2]
* 3. idl for facet methods
* [idl/IGCObject_DIfElseExpr.json5]
**/
#include "detail/IGCObject_DIfElseExpr.hpp"
namespace xo {
namespace scm {
auto
IGCObject_DIfElseExpr::shallow_size(const DIfElseExpr & self) noexcept -> size_type
{
return self.shallow_size();
}
auto
IGCObject_DIfElseExpr::shallow_copy(const DIfElseExpr & self, obj<AAllocator> mm) noexcept -> Opaque
{
return self.shallow_copy(mm);
}
auto
IGCObject_DIfElseExpr::forward_children(DIfElseExpr & self, obj<ACollector> gc) noexcept -> size_type
{
return self.forward_children(gc);
}
} /*namespace scm*/
} /*namespace xo*/
/* end IGCObject_DIfElseExpr.cpp */

View file

@ -9,6 +9,7 @@
#include <xo/expression2/detail/IPrintable_DUniqueString.hpp>
#include <xo/expression2/detail/IExpression_DDefineExpr.hpp>
//#include <xo/expression2/detail/IGCObject_DDefineExpr.hpp>
#include <xo/expression2/detail/IPrintable_DDefineExpr.hpp>
#include <xo/expression2/detail/IExpression_DVariable.hpp>
@ -16,15 +17,19 @@
#include <xo/expression2/detail/IPrintable_DVariable.hpp>
#include <xo/expression2/detail/IExpression_DConstant.hpp>
#include <xo/expression2/detail/IGCObject_DConstant.hpp>
#include <xo/expression2/detail/IPrintable_DConstant.hpp>
#include <xo/expression2/detail/IExpression_DApplyExpr.hpp>
//#include <xo/expression2/detail/IGCObject_DApplyExpr.hpp>
#include <xo/expression2/detail/IPrintable_DApplyExpr.hpp>
#include <xo/expression2/detail/IExpression_DLambdaExpr.hpp>
//#include <xo/expression2/detail/IGCObject_DLambdaExpr.hpp>
#include <xo/expression2/detail/IPrintable_DLambdaExpr.hpp>
#include <xo/expression2/detail/IExpression_DIfElseExpr.hpp>
#include <xo/expression2/detail/IGCObject_DIfElseExpr.hpp>
#include <xo/expression2/detail/IPrintable_DIfElseExpr.hpp>
#include <xo/expression2/detail/IExpression_DSequenceExpr.hpp>
@ -32,6 +37,7 @@
#include <xo/expression2/detail/IPrintable_DSequenceExpr.hpp>
#include <xo/expression2/symtab/ISymbolTable_DLocalSymtab.hpp>
//#include <xo/expression2/detail/IGCObject_DLocalSymtab.hpp>
#include <xo/expression2/symtab/IPrintable_DLocalSymtab.hpp>
#include <xo/gc/detail/AGCObject.hpp>
@ -60,9 +66,11 @@ namespace xo {
// +- DefineExpr
// +- ApplyExpr
// +- LambdaExpr
// \- IfElseExpr
// +- IfElseExpr
// \- SequenceExpr
FacetRegistry::register_impl<AExpression, DConstant>();
FacetRegistry::register_impl<AGCObject, DConstant>();
FacetRegistry::register_impl<APrintable, DConstant>();
FacetRegistry::register_impl<AExpression, DVariable>();
@ -79,6 +87,7 @@ namespace xo {
FacetRegistry::register_impl<APrintable, DLambdaExpr>();
FacetRegistry::register_impl<AExpression, DIfElseExpr>();
FacetRegistry::register_impl<AGCObject, DIfElseExpr>();
FacetRegistry::register_impl<APrintable, DIfElseExpr>();
FacetRegistry::register_impl<AExpression, DSequenceExpr>();

View file

@ -5,11 +5,18 @@
#include "expression2_register_types.hpp"
#include "detail/IGCObject_DConstant.hpp"
#include "detail/IGCObject_DVariable.hpp"
//#include "detail/IGCObject_DDefineExpr.hpp" // when avail
//#include "detail/IGCObject_DApplyExpr.hpp" // when avail
//#include "detail/IGCObject_DLambdaExpr.hpp" // when avail
#include "detail/IGCObject_DIfElseExpr.hpp"
#include "detail/IGCObject_DSequenceExpr.hpp"
//#include "detail/IGCObject_DLocalSymtab.hpp" // when avail
#include "detail/IGCObject_DUniqueString.hpp"
//#include "detail/IPrintable_DUniqueString.hpp"
//#include "detail/IPrintable_DUniqueString.hpp" // when avail
//#include <xo/facet/FacetRegistry.hpp>
#include <xo/indentlog/scope.hpp>
namespace xo {
@ -27,6 +34,16 @@ namespace xo {
bool ok = true;
ok &= gc.install_type(impl_for<AGCObject, DConstant>());
ok &= gc.install_type(impl_for<AGCObject, DVariable>());
//ok &= gc.install_type(impl_for<AGCObject, DDefineExpr>()); // when avail
//ok &= gc.install_type(impl_for<AGCObject, DApplyExpr>()); // when avail
//ok &= gc.install_type(impl_for<AGCObject, DLambdaExpr>()); // when avail
ok &= gc.install_type(impl_for<AGCObject, DIfElseExpr>());
ok &= gc.install_type(impl_for<AGCObject, DSequenceExpr>());
//ok &= gc.install_type(impl_for<AGCObject, DLocalSymtab>()); // when avail
ok &= gc.install_type(impl_for<AGCObject, DUniqueString>());
return ok;

View file

@ -183,7 +183,7 @@ xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-ifelsessm
FACET_PKG xo_printable2
FACET Printable
REPR Ifelsessm
REPR IfElseSsm
INPUT idl/IPrintable_DIfElseSsm.json5
OUTPUT_HPP_DIR include/xo/reader2
OUTPUT_IMPL_SUBDIR ssm
@ -192,6 +192,32 @@ xo_add_genfacetimpl(
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-sequencessm
FACET_PKG xo_reader2
FACET SyntaxStateMachine
REPR SequenceSsm
INPUT idl/ISyntaxStateMachine_DSequenceSsm.json5
OUTPUT_HPP_DIR include/xo/reader2
OUTPUT_IMPL_SUBDIR ssm
OUTPUT_CPP_DIR src/reader2
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-sequencessm
FACET_PKG xo_printable2
FACET Printable
REPR SequenceSsm
INPUT idl/IPrintable_DSequenceSsm.json5
OUTPUT_HPP_DIR include/xo/reader2
OUTPUT_IMPL_SUBDIR ssm
OUTPUT_CPP_DIR src/reader2
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-expectsymbolssm

View file

@ -0,0 +1,13 @@
{
mode: "implementation",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DSequenceSsm",
using_doxygen: true,
repr: "DSequenceSsm",
doc: [ "implement APrintable for DSequenceSsm" ],
}

View file

@ -0,0 +1,13 @@
{
mode: "implementation",
includes: [ "\"SyntaxStateMachine.hpp\"",
"\"ssm/ISyntaxStateMachine_Xfer.hpp\"" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/SyntaxStateMachine.json5",
brief: "provide ASyntaxStateMachine interface for DSequenceSsm",
using_doxygen: true,
repr: "DSequenceSsm",
doc: [ "implement ASyntaxStateMachine for DSequenceSsm" ],
}

View file

@ -46,6 +46,12 @@ namespace xo {
/** @defgroup scm-expectexpr-methods general methods **/
///@{
/** update state for this syntax on incoming leftbrace token @p tk,
* with overall parser state in @p p_psm
**/
void on_leftbrace_token(const Token & tk,
ParserStateMachine * p_psm);
/** step state machine for this syntax on incoming boolean literal token @p tkk
* with overall parser state in @p p_psm
**/

View file

@ -166,27 +166,8 @@ namespace xo {
///@}
#ifdef NOT_YET
// ----- inherited from exprstate -----
virtual const char * get_expect_str() const override;
virtual void on_if_token(const token_type & tk,
parserstatemachine * p_psm) override;
virtual void on_then_token(const token_type & tk,
parserstatemachine * p_psm) override;
virtual void on_else_token(const token_type & tk,
parserstatemachine * p_psm) override;
virtual void on_semicolon_token(const token_type & tk,
parserstatemachine * p_psm) override;
virtual void on_rightbrace_token(const token_type & tk,
parserstatemachine * p_psm) override;
virtual void on_expr(bp<Expression> expr,
parserstatemachine * p_psm) override;
virtual void on_expr_with_semicolon(bp<Expression> expr,
parserstatemachine * p_psm) override;
virtual void print(std::ostream & os) const override;
#endif
private:
@ -203,6 +184,8 @@ namespace xo {
ifexprstatetype ifstate_ = ifexprstatetype::invalid;
/** scaffold ifelse-expression here.
* This will eventually be the output of this ssm
*
* TODO: can use DIfElseExpr* here. See xo-object2//DList
**/
obj<AExpression,DIfElseExpr> if_expr_;

View file

@ -6,7 +6,7 @@
#pragma once
#include "DSyntaxStateMachine.hpp"
//#include "exprstate.hpp"
#include <xo/expression2/DSequenceExpr.hpp>
namespace xo {
namespace scm { class Sequence; }
@ -15,21 +15,29 @@ namespace xo {
namespace scm {
class DSequenceSsm : public DSyntaxStateMachine<DSequenceSsm> {
public:
using Sequence = xo::scm::Sequence;
using Lambda = xo::scm::Lambda;
//using Sequence = xo::scm::Sequence;
//using Lambda = xo::scm::Lambda;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
public:
const char * ssm_classname() const noexcept { return "DSequenceSsm"; }
static const char * ssm_classname() { return "DSequenceSsm"; }
#ifdef NOT_YET
/** start parsing a sequence-expr.
* input begins with first expression in the sequence.
**/
static void start(parserstatemachine * p_psm);
static void start(ParserStateMachine * p_psm);
/** named ctor idiom **/
static std::unique_ptr<sequence_xs> make();
/** create instance using memory from @p parser_mm **/
static obj<ASyntaxStateMachine,DSequenceSsm> make(DArena & parser_mm,
obj<AAllocator> expr_mm);
/** create instance using memory from @p parser_mm **/
static DSequenceSsm * _make(DArena & parser_mm,
obj<AAllocator> expr_mm);
#ifdef NOT_YET
virtual void on_expr(bp<Expression> expr,
parserstatemachine * p_psm) override;
virtual void on_expr_with_semicolon(bp<Expression> expr,
@ -37,18 +45,34 @@ namespace xo {
virtual void on_rightbrace_token(const token_type & tk,
parserstatemachine * p_psm) override;
virtual void print(std::ostream & os) const override;
virtual bool pretty_print(const xo::print::ppindentinfo & ppii) const override;
#endif
private:
DSequenceSsm();
/** @defgroup scm-sequencessm-syntaxstatemachine-facet ssm facet **/
///@{
/** indentifies this state machine **/
syntaxstatetype ssm_type() const noexcept;
/** mnemonic for syntax sequence ssm expects given current state **/
std::string_view get_expect_str() const noexcept;
///@}
/** @defgroup scm-sequencessm-printable-facet printable facet **/
///@{
/** pretty printing support **/
bool pretty(const ppindentinfo & ppii) const;
///@}
private:
/** will build SequenceExpr from in-order contents of this array **/
DArray * expr_v_;
//std::vector<rp<Expression>> expr_v_;
explicit DSequenceSsm(DSequenceExpr * seq_expr);
private:
/** scaffold sequence-expression here.
* This will eventually be the output of this ssm
**/
DSequenceExpr * seq_expr_ = nullptr;
};
} /*namespace scm*/
} /*namespace xo*/

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/SyntaxStateMachine.json5]
* 2. jinja2 template for facet .hpp file:
@ -19,4 +19,4 @@
#include "ssm/RSyntaxStateMachine.hpp"
/* end SyntaxStateMachine.hpp */
/* end SyntaxStateMachine.hpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/SyntaxStateMachine.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -90,4 +90,4 @@ using ISyntaxStateMachine_ImplType = xo::facet::FacetImplType<ASyntaxStateMachin
} /*namespace scm*/
} /*namespace xo*/
/* ASyntaxStateMachine.hpp */
/* ASyntaxStateMachine.hpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DDefineSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DExpectExprSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DExpectFormalArgSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DExpectFormalArglistSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DExpectSymbolSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DExpectTypeSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DExprSeqState.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DIfElseSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DLambdaSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DProgressSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -0,0 +1,62 @@
/** @file IPrintable_DSequenceSsm.hpp
*
* Generated automagically from ingredients:
* 1. code generator:
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DSequenceSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
* [iface_facet_repr.hpp.j2]
* 3. idl for facet methods
* [idl/IPrintable_DSequenceSsm.json5]
**/
#pragma once
#include "Printable.hpp"
#include <xo/printable2/Printable.hpp>
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
#include "DSequenceSsm.hpp"
namespace xo { namespace scm { class IPrintable_DSequenceSsm; } }
namespace xo {
namespace facet {
template <>
struct FacetImplementation<xo::print::APrintable,
xo::scm::DSequenceSsm>
{
using ImplType = xo::print::IPrintable_Xfer
<xo::scm::DSequenceSsm,
xo::scm::IPrintable_DSequenceSsm>;
};
}
}
namespace xo {
namespace scm {
/** @class IPrintable_DSequenceSsm
**/
class IPrintable_DSequenceSsm {
public:
/** @defgroup scm-printable-dsequencessm-type-traits **/
///@{
using ppindentinfo = xo::print::APrintable::ppindentinfo;
using Copaque = xo::print::APrintable::Copaque;
using Opaque = xo::print::APrintable::Opaque;
///@}
/** @defgroup scm-printable-dsequencessm-methods **/
///@{
// const methods
/** Pretty-printing support for this object.
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
static bool pretty(const DSequenceSsm & self, const ppindentinfo & ppii);
// non-const methods
///@}
};
} /*namespace scm*/
} /*namespace xo*/
/* end */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/SyntaxStateMachine.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -91,4 +91,4 @@ namespace scm {
} /*namespace scm */
} /*namespace xo */
/* ISyntaxStateMachine_Any.hpp */
/* ISyntaxStateMachine_Any.hpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DDefineSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DExpectExprSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DExpectFormalArgSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DExpectFormalArglistSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DExpectSymbolSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DExpectTypeSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DExprSeqState.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DIfElseSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DLambdaSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DProgressSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:

View file

@ -0,0 +1,77 @@
/** @file ISyntaxStateMachine_DSequenceSsm.hpp
*
* Generated automagically from ingredients:
* 1. code generator:
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DSequenceSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
* [iface_facet_repr.hpp.j2]
* 3. idl for facet methods
* [idl/ISyntaxStateMachine_DSequenceSsm.json5]
**/
#pragma once
#include "SyntaxStateMachine.hpp"
#include "SyntaxStateMachine.hpp"
#include "ssm/ISyntaxStateMachine_Xfer.hpp"
#include "DSequenceSsm.hpp"
namespace xo { namespace scm { class ISyntaxStateMachine_DSequenceSsm; } }
namespace xo {
namespace facet {
template <>
struct FacetImplementation<xo::scm::ASyntaxStateMachine,
xo::scm::DSequenceSsm>
{
using ImplType = xo::scm::ISyntaxStateMachine_Xfer
<xo::scm::DSequenceSsm,
xo::scm::ISyntaxStateMachine_DSequenceSsm>;
};
}
}
namespace xo {
namespace scm {
/** @class ISyntaxStateMachine_DSequenceSsm
**/
class ISyntaxStateMachine_DSequenceSsm {
public:
/** @defgroup scm-syntaxstatemachine-dsequencessm-type-traits **/
///@{
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
///@}
/** @defgroup scm-syntaxstatemachine-dsequencessm-methods **/
///@{
// const methods
/** identify a type of syntax state machine **/
static syntaxstatetype ssm_type(const DSequenceSsm & self) noexcept;
/** text describing expected/allowed input to this ssm in current state **/
static std::string_view get_expect_str(const DSequenceSsm & self) noexcept;
// non-const methods
/** operate state machine for incoming token @p tk **/
static void on_token(DSequenceSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update stat machine for incoming parsed symbol @p sym **/
static void on_parsed_symbol(DSequenceSsm & self, std::string_view sym, ParserStateMachine * p_psm);
/** operate state machine for incoming type description @p td **/
static void on_parsed_typedescr(DSequenceSsm & self, TypeDescr td, ParserStateMachine * p_psm);
/** operate state machine for formal emitted by nested ssm **/
static void on_parsed_formal(DSequenceSsm & self, const DUniqueString * param_name, TypeDescr param_type, ParserStateMachine * p_psm);
/** consume formal arglist emitted by nested ssm **/
static void on_parsed_formal_arglist(DSequenceSsm & self, DArray * arglist, ParserStateMachine * p_psm);
/** update state machine for incoming parsed expression @p expr **/
static void on_parsed_expression(DSequenceSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm);
/** update state machine for incoming parsed expression @p expr followed by semicolon **/
static void on_parsed_expression_with_semicolon(DSequenceSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm);
///@}
};
} /*namespace scm*/
} /*namespace xo*/
/* end */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/SyntaxStateMachine.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -105,4 +105,4 @@ namespace scm {
} /*namespace scm */
} /*namespace xo*/
/* end ISyntaxStateMachine_Xfer.hpp */
/* end ISyntaxStateMachine_Xfer.hpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/SyntaxStateMachine.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -101,4 +101,4 @@ namespace xo { namespace facet {
};
} }
/* end RSyntaxStateMachine.hpp */
/* end RSyntaxStateMachine.hpp */

View file

@ -18,6 +18,21 @@ namespace xo {
enum class syntaxstatetype {
invalid = -1,
/** handle define-expression. See @ref DDefineSsm **/
defexpr,
/** handle lambda-expression. See @ref DLambdaSsm **/
lambdaexpr,
/** handle ifelse-expression. See @ref DIfElseSsm **/
ifelseexpr,
/** handle sequence-expression. See @ref DSequenceSsm **/
sequence,
/** rhs expression. state exists to achieve 1-token lookahead **/
progress,
/** toplevel of some translation unit. See @ref DExprSeqState **/
expect_toplevel_expression_sequence,
@ -36,18 +51,6 @@ namespace xo {
/** expecting a rhs expression. See @ref DExpectExprSsm **/
expect_rhs_expression,
/** handle define-expression. See @ref DDefineSsm **/
defexpr,
/** handle lambda-expression. See @ref DLambdaSsm **/
lambdaexpr,
/** handle ifelse-expression. See @ref DIfElseSsm **/
ifelseexpr,
/** rhs expression. state exists to achieve 1-token lookahead **/
progress,
/** comes lasts, counts number of valid enums **/
N
};

View file

@ -29,6 +29,10 @@ set(SELF_SRCS
ISyntaxStateMachine_DIfElseSsm.cpp
IPrintable_DIfElseSsm.cpp
DSequenceSsm.cpp
ISyntaxStateMachine_DSequenceSsm.cpp
IPrintable_DSequenceSsm.cpp
DLambdaSsm.cpp
ISyntaxStateMachine_DLambdaSsm.cpp
IPrintable_DLambdaSsm.cpp

View file

@ -8,6 +8,7 @@
#include "SyntaxStateMachine.hpp"
#include "ssm/ISyntaxStateMachine_DExpectExprSsm.hpp"
#include "ssm/ISyntaxStateMachine_DProgressSsm.hpp"
#include "DSequenceSsm.hpp"
#include "syntaxstatetype.hpp"
#include <xo/expression2/DConstant.hpp>
#include <xo/expression2/detail/IExpression_DConstant.hpp>
@ -114,6 +115,10 @@ namespace xo {
scope log(XO_DEBUG(p_psm->debug_flag()), xtag("tk", tk));
switch (tk.tk_type()) {
case tokentype::tk_leftbrace:
this->on_leftbrace_token(tk, p_psm);
return;
case tokentype::tk_symbol:
this->on_symbol_token(tk, p_psm);
return;
@ -148,7 +153,6 @@ namespace xo {
case tokentype::tk_rightparen:
case tokentype::tk_leftbracket:
case tokentype::tk_rightbracket:
case tokentype::tk_leftbrace:
case tokentype::tk_rightbrace:
case tokentype::tk_leftangle:
case tokentype::tk_rightangle:
@ -179,6 +183,15 @@ namespace xo {
Super::on_token(tk, p_psm);
}
void
DExpectExprSsm::on_leftbrace_token(const Token & tk,
ParserStateMachine * p_psm)
{
(void)tk;
DSequenceSsm::start(p_psm);
}
void
DExpectExprSsm::on_symbol_token(const Token & tk,
ParserStateMachine * p_psm)
@ -377,7 +390,8 @@ namespace xo {
(ppii,
"DExpectExprSsm",
refrtag("allow_defs", allow_defs_),
refrtag("cxl_on_rightbrace", cxl_on_rightbrace_)
refrtag("cxl_on_rightbrace", cxl_on_rightbrace_),
refrtag("expect", this->get_expect_str())
);
}
@ -412,16 +426,6 @@ namespace xo {
paren_xs::start(p_psm);
}
void
expect_expr_xs::on_leftbrace_token(const token_type & /*tk*/,
parserstatemachine * p_psm)
{
scope log(XO_DEBUG(p_psm->debug_flag()));
/* push lparen_0 to remember to look for subsequent rightparen. */
sequence_xs::start(p_psm);
}
void
expect_expr_xs::on_rightbrace_token(const token_type & tk,
parserstatemachine * p_psm)

View file

@ -1,4 +1,4 @@
/** @file lambda_xs.cpp
/** @file DLambdaSsm.cpp
*
* @author Roland Conybeare, Jan 2026
**/

View file

@ -1,6 +1,8 @@
/* @file DSequenceSsm.cpp */
#include "DSequenceSsm.hpp"
#include "ssm/ISyntaxStateMachine_DSequenceSsm.hpp"
#include "DExpectExprSsm.hpp"
#ifdef NOT_YET
#include "expect_expr_xs.hpp"
@ -11,31 +13,67 @@
#endif
namespace xo {
using xo::scm::DefineExpr;
#ifdef NOT_YET
using xo::scm::DDefineExpr;
#endif
using xo::facet::typeseq;
namespace scm {
#ifdef NOT_YET
std::unique_ptr<sequence_xs>
sequence_xs::make() {
return std::make_unique<sequence_xs>(sequence_xs());
}
#endif
void
sequence_xs::start(parserstatemachine * p_psm) {
p_psm->push_exprstate(sequence_xs::make());
DSequenceSsm::start(ParserStateMachine * p_psm)
{
p_psm->push_ssm(DSequenceSsm::make(p_psm->parser_alloc(),
p_psm->expr_alloc()));
/* want to accept anything that starts an expression,
* except that } ends it
* except that rightbrace '}' ends it
*/
expect_expr_xs::start(true /*allow_defs*/,
DExpectExprSsm::start(p_psm->parser_alloc(),
true /*allow_defs*/,
true /*cxl_on_rightbrace*/,
p_psm);
}
obj<ASyntaxStateMachine,DSequenceSsm>
DSequenceSsm::make(DArena & mm,
obj<AAllocator> expr_mm)
{
return obj<ASyntaxStateMachine,DSequenceSsm>(_make(mm, expr_mm));
}
DSequenceSsm *
DSequenceSsm::_make(DArena & mm,
obj<AAllocator> expr_mm)
{
void * mem = mm.alloc(typeseq::id<DSequenceSsm>(),
sizeof(DSequenceSsm));
DSequenceExpr * seq_expr = DSequenceExpr::_make_empty(expr_mm);
return new (mem) DSequenceSsm(seq_expr);
}
DSequenceSsm::DSequenceSsm(DSequenceExpr * seq_expr) : seq_expr_{seq_expr}
{}
#ifdef NOT_YET
sequence_xs::sequence_xs()
: exprstate(exprstatetype::sequenceexpr)
{}
#endif
syntaxstatetype
DSequenceSsm::ssm_type() const noexcept
{
return syntaxstatetype::sequence;
}
std::string_view
DSequenceSsm::get_expect_str() const noexcept
{
return "expr|semicolon|rightbrace";
}
#ifdef NOT_YET
void
sequence_xs::on_expr(bp<Expression> expr,
parserstatemachine * p_psm)
@ -122,12 +160,16 @@ namespace xo {
sequence_xs::print(std::ostream & os) const {
os << "<sequence_xs" << xtag("expr_v.size", expr_v_.size()) << ">";
}
#endif
bool
sequence_xs::pretty_print(const xo::print::ppindentinfo & ppii) const
DSequenceSsm::pretty(const xo::print::ppindentinfo & ppii) const
{
return ppii.pps()->pretty_struct(ppii, "sequence_xs",
xrefrtag("expr_v.size", expr_v_.size()));
return ppii.pps()->pretty_struct
(ppii,
"SequenceSsm",
xrefrtag("seq_expr.size", seq_expr_->size()),
xrefrtag("expect", this->get_expect_str()));
}
} /*namespace scm*/

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DDefineSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -25,4 +25,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end IPrintable_DDefineSsm.cpp */
/* end IPrintable_DDefineSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DExpectExprSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -25,4 +25,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end IPrintable_DExpectExprSsm.cpp */
/* end IPrintable_DExpectExprSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DExpectFormalArgSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -25,4 +25,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end IPrintable_DExpectFormalArgSsm.cpp */
/* end IPrintable_DExpectFormalArgSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DExpectFormalArglistSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -25,4 +25,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end IPrintable_DExpectFormalArglistSsm.cpp */
/* end IPrintable_DExpectFormalArglistSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DExpectSymbolSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -25,4 +25,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end IPrintable_DExpectSymbolSsm.cpp */
/* end IPrintable_DExpectSymbolSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DExpectTypeSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -25,4 +25,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end IPrintable_DExpectTypeSsm.cpp */
/* end IPrintable_DExpectTypeSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DExprSeqState.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -25,4 +25,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end IPrintable_DExprSeqState.cpp */
/* end IPrintable_DExprSeqState.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DIfElseSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -25,4 +25,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end IPrintable_DIfElseSsm.cpp */
/* end IPrintable_DIfElseSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DLambdaSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -25,4 +25,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end IPrintable_DLambdaSsm.cpp */
/* end IPrintable_DLambdaSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DProgressSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -25,4 +25,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end IPrintable_DProgressSsm.cpp */
/* end IPrintable_DProgressSsm.cpp */

View file

@ -0,0 +1,28 @@
/** @file IPrintable_DSequenceSsm.cpp
*
* Generated automagically from ingredients:
* 1. code generator:
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DSequenceSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
* [iface_facet_any.hpp.j2]
* 3. idl for facet methods
* [idl/IPrintable_DSequenceSsm.json5]
**/
#include "ssm/IPrintable_DSequenceSsm.hpp"
namespace xo {
namespace scm {
auto
IPrintable_DSequenceSsm::pretty(const DSequenceSsm & self, const ppindentinfo & ppii) -> bool
{
return self.pretty(ppii);
}
} /*namespace scm*/
} /*namespace xo*/
/* end IPrintable_DSequenceSsm.cpp */

View file

@ -80,4 +80,4 @@ ISyntaxStateMachine_Any::on_parsed_expression_with_semicolon(Opaque, obj<AExpres
} /*namespace scm*/
} /*namespace xo*/
/* end ISyntaxStateMachine_Any.cpp */
/* end ISyntaxStateMachine_Any.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DDefineSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -66,4 +66,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end ISyntaxStateMachine_DDefineSsm.cpp */
/* end ISyntaxStateMachine_DDefineSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DExpectExprSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -66,4 +66,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end ISyntaxStateMachine_DExpectExprSsm.cpp */
/* end ISyntaxStateMachine_DExpectExprSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DExpectFormalArgSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -66,4 +66,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end ISyntaxStateMachine_DExpectFormalArgSsm.cpp */
/* end ISyntaxStateMachine_DExpectFormalArgSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DExpectFormalArglistSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -66,4 +66,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end ISyntaxStateMachine_DExpectFormalArglistSsm.cpp */
/* end ISyntaxStateMachine_DExpectFormalArglistSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DExpectSymbolSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -66,4 +66,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end ISyntaxStateMachine_DExpectSymbolSsm.cpp */
/* end ISyntaxStateMachine_DExpectSymbolSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DExpectTypeSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -66,4 +66,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end ISyntaxStateMachine_DExpectTypeSsm.cpp */
/* end ISyntaxStateMachine_DExpectTypeSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DExprSeqState.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -66,4 +66,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end ISyntaxStateMachine_DExprSeqState.cpp */
/* end ISyntaxStateMachine_DExprSeqState.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DIfElseSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -66,4 +66,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end ISyntaxStateMachine_DIfElseSsm.cpp */
/* end ISyntaxStateMachine_DIfElseSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DLambdaSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -66,4 +66,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end ISyntaxStateMachine_DLambdaSsm.cpp */
/* end ISyntaxStateMachine_DLambdaSsm.cpp */

View file

@ -2,7 +2,7 @@
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DProgressSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
@ -66,4 +66,4 @@ namespace xo {
} /*namespace scm*/
} /*namespace xo*/
/* end ISyntaxStateMachine_DProgressSsm.cpp */
/* end ISyntaxStateMachine_DProgressSsm.cpp */

View file

@ -0,0 +1,69 @@
/** @file ISyntaxStateMachine_DSequenceSsm.cpp
*
* Generated automagically from ingredients:
* 1. code generator:
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/ISyntaxStateMachine_DSequenceSsm.json5]
* 2. jinja2 template for abstract facet .hpp file:
* [iface_facet_any.hpp.j2]
* 3. idl for facet methods
* [idl/ISyntaxStateMachine_DSequenceSsm.json5]
**/
#include "ssm/ISyntaxStateMachine_DSequenceSsm.hpp"
namespace xo {
namespace scm {
auto
ISyntaxStateMachine_DSequenceSsm::ssm_type(const DSequenceSsm & self) noexcept -> syntaxstatetype
{
return self.ssm_type();
}
auto
ISyntaxStateMachine_DSequenceSsm::get_expect_str(const DSequenceSsm & self) noexcept -> std::string_view
{
return self.get_expect_str();
}
auto
ISyntaxStateMachine_DSequenceSsm::on_token(DSequenceSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DSequenceSsm::on_parsed_symbol(DSequenceSsm & self, std::string_view sym, ParserStateMachine * p_psm) -> void
{
self.on_parsed_symbol(sym, p_psm);
}
auto
ISyntaxStateMachine_DSequenceSsm::on_parsed_typedescr(DSequenceSsm & self, TypeDescr td, ParserStateMachine * p_psm) -> void
{
self.on_parsed_typedescr(td, p_psm);
}
auto
ISyntaxStateMachine_DSequenceSsm::on_parsed_formal(DSequenceSsm & self, const DUniqueString * param_name, TypeDescr param_type, ParserStateMachine * p_psm) -> void
{
self.on_parsed_formal(param_name, param_type, p_psm);
}
auto
ISyntaxStateMachine_DSequenceSsm::on_parsed_formal_arglist(DSequenceSsm & self, DArray * arglist, ParserStateMachine * p_psm) -> void
{
self.on_parsed_formal_arglist(arglist, p_psm);
}
auto
ISyntaxStateMachine_DSequenceSsm::on_parsed_expression(DSequenceSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm) -> void
{
self.on_parsed_expression(expr, p_psm);
}
auto
ISyntaxStateMachine_DSequenceSsm::on_parsed_expression_with_semicolon(DSequenceSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm) -> void
{
self.on_parsed_expression_with_semicolon(expr, p_psm);
}
} /*namespace scm*/
} /*namespace xo*/
/* end ISyntaxStateMachine_DSequenceSsm.cpp */

View file

@ -17,6 +17,8 @@
#include <xo/reader2/ssm/ISyntaxStateMachine_DIfElseSsm.hpp>
#include <xo/reader2/ssm/IPrintable_DIfElseSsm.hpp>
#include <xo/reader2/ssm/IPrintable_DSequenceSsm.hpp>
#include <xo/reader2/ssm/ISyntaxStateMachine_DExpectFormalArglistSsm.hpp>
#include <xo/reader2/ssm/IPrintable_DExpectFormalArglistSsm.hpp>
@ -63,6 +65,8 @@ namespace xo {
FacetRegistry::register_impl<ASyntaxStateMachine, DIfElseSsm>();
FacetRegistry::register_impl<APrintable, DIfElseSsm>();
FacetRegistry::register_impl<APrintable, DSequenceSsm>();
FacetRegistry::register_impl<ASyntaxStateMachine, DExpectFormalArglistSsm>();
FacetRegistry::register_impl<APrintable, DExpectFormalArglistSsm>();

View file

@ -13,6 +13,16 @@ namespace xo {
switch (x) {
case syntaxstatetype::invalid:
break;
case syntaxstatetype::defexpr:
return "defexpr";
case syntaxstatetype::lambdaexpr:
return "lambdaexpr";
case syntaxstatetype::ifelseexpr:
return "ifelseexpr";
case syntaxstatetype::sequence:
return "sequence";
case syntaxstatetype::progress:
return "progress";
case syntaxstatetype::expect_toplevel_expression_sequence:
return "expect-toplevel-expression-sequence";
case syntaxstatetype::expect_formal_arglist:
@ -25,14 +35,6 @@ namespace xo {
return "expect-type";
case syntaxstatetype::expect_rhs_expression:
return "expect-rhs-expression";
case syntaxstatetype::defexpr:
return "defexpr";
case syntaxstatetype::lambdaexpr:
return "lambdaexpr";
case syntaxstatetype::ifelseexpr:
return "ifelseexpr";
case syntaxstatetype::progress:
return "progress";
case syntaxstatetype::N:
break;
}

View file

@ -363,7 +363,6 @@ namespace xo {
REQUIRE(result.is_incomplete());
}
#ifdef NOT_YET
{
auto & result = parser.on_token(Token::leftbrace_token());
@ -376,6 +375,7 @@ namespace xo {
REQUIRE(result.is_incomplete());
}
#ifdef NOT_YET
{
auto & result = parser.on_token(Token::string_token("fooey"));