From 298e05dd06bcbec4f150ccd40861d1ff5f6ab443 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 29 Jan 2026 15:19:35 -0500 Subject: [PATCH] xo-object2: missed generated (Printable,Array) code + .json5 --- xo-object2/idl/IPrintable_DArray.json5 | 13 ++++ .../xo/object2/array/IPrintable_DArray.hpp | 62 +++++++++++++++++++ xo-object2/src/object2/IPrintable_DArray.cpp | 28 +++++++++ .../xo/reader2/DSyntaxStateMachine.hpp | 42 +++++++++++++ 4 files changed, 145 insertions(+) create mode 100644 xo-object2/idl/IPrintable_DArray.json5 create mode 100644 xo-object2/include/xo/object2/array/IPrintable_DArray.hpp create mode 100644 xo-object2/src/object2/IPrintable_DArray.cpp create mode 100644 xo-reader2/include/xo/reader2/DSyntaxStateMachine.hpp diff --git a/xo-object2/idl/IPrintable_DArray.json5 b/xo-object2/idl/IPrintable_DArray.json5 new file mode 100644 index 00000000..df0ef171 --- /dev/null +++ b/xo-object2/idl/IPrintable_DArray.json5 @@ -0,0 +1,13 @@ +{ + mode: "implementation", + includes: [ "", + "" ], + local_types: [ ], + namespace1: "xo", + namespace2: "scm", + facet_idl: "idl/Printable.json5", + brief: "provide APrintable interface for DArray", + using_doxygen: true, + repr: "DArray", + doc: [ "implement APrintable for DArray" ], +} diff --git a/xo-object2/include/xo/object2/array/IPrintable_DArray.hpp b/xo-object2/include/xo/object2/array/IPrintable_DArray.hpp new file mode 100644 index 00000000..1b3a4663 --- /dev/null +++ b/xo-object2/include/xo/object2/array/IPrintable_DArray.hpp @@ -0,0 +1,62 @@ +/** @file IPrintable_DArray.hpp + * + * Generated automagically from ingredients: + * 1. code generator: + * [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet] + * arguments: + * --input [idl/IPrintable_DArray.json5] + * 2. jinja2 template for abstract facet .hpp file: + * [iface_facet_repr.hpp.j2] + * 3. idl for facet methods + * [idl/IPrintable_DArray.json5] + **/ + +#pragma once + +#include "Printable.hpp" +#include +#include +#include "DArray.hpp" + +namespace xo { namespace scm { class IPrintable_DArray; } } + +namespace xo { + namespace facet { + template <> + struct FacetImplementation + { + using ImplType = xo::print::IPrintable_Xfer + ; + }; + } +} + +namespace xo { + namespace scm { + /** @class IPrintable_DArray + **/ + class IPrintable_DArray { + public: + /** @defgroup scm-printable-darray-type-traits **/ + ///@{ + using ppindentinfo = xo::print::APrintable::ppindentinfo; + using Copaque = xo::print::APrintable::Copaque; + using Opaque = xo::print::APrintable::Opaque; + ///@} + /** @defgroup scm-printable-darray-methods **/ + ///@{ + // const methods + /** Pretty-printing support for this object. +See [xo-indentlog/xo/indentlog/pretty.hpp] **/ + static bool pretty(const DArray & self, const ppindentinfo & ppii); + + // non-const methods + ///@} + }; + + } /*namespace scm*/ +} /*namespace xo*/ + +/* end */ \ No newline at end of file diff --git a/xo-object2/src/object2/IPrintable_DArray.cpp b/xo-object2/src/object2/IPrintable_DArray.cpp new file mode 100644 index 00000000..d444800b --- /dev/null +++ b/xo-object2/src/object2/IPrintable_DArray.cpp @@ -0,0 +1,28 @@ +/** @file IPrintable_DArray.cpp + * + * Generated automagically from ingredients: + * 1. code generator: + * [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet] + * arguments: + * --input [idl/IPrintable_DArray.json5] + * 2. jinja2 template for abstract facet .hpp file: + * [iface_facet_any.hpp.j2] + * 3. idl for facet methods + * [idl/IPrintable_DArray.json5] +**/ + +#include "array/IPrintable_DArray.hpp" + +namespace xo { + namespace scm { + auto + IPrintable_DArray::pretty(const DArray & self, const ppindentinfo & ppii) -> bool + { + return self.pretty(ppii); + } + + + } /*namespace scm*/ +} /*namespace xo*/ + +/* end IPrintable_DArray.cpp */ \ No newline at end of file diff --git a/xo-reader2/include/xo/reader2/DSyntaxStateMachine.hpp b/xo-reader2/include/xo/reader2/DSyntaxStateMachine.hpp new file mode 100644 index 00000000..4aa35f4d --- /dev/null +++ b/xo-reader2/include/xo/reader2/DSyntaxStateMachine.hpp @@ -0,0 +1,42 @@ +/** @file DSyntaxStateMachine.hpp + * + * @author Roland Conybeare, Jan 2026 + **/ + +#pragma once + +#include + +namespace xo { + namespace scm { + + /** @class DSyntaxStateMachine + * @brief static interface for implementing ASyntaxStateMachine + * + * Using CRTP to collect methods common to ASyntaxStateMachine + * implementations. + * + * Deliberately unusable through base class pointer. + * For runtime polymorphism use something like: + * @code + * Derived * d = ...; + * auto obj = with_facet::mkobj(d); + * // or + * obj(d) + * @endcode + **/ + template + class DSyntaxStateMachine { + friend Derived; + + /** arglist is DArray of obj **/ + void on_parsed_formal_arglist(this auto&& self, DArray * arglist, ParserStateMachine * p_psm) { + p_psm->illegal_parsed_formal_arglist( + + } + }; + + } /*namespace scm*/ +} /*namespace xo*/ + +/* end DSyntaxStateMachine.hpp */