xo-reader2: + IPrintable+DExpectSymbolSsm

This commit is contained in:
Roland Conybeare 2026-01-20 01:07:21 -05:00
commit 1bca806bf3
7 changed files with 139 additions and 0 deletions

View file

@ -32,6 +32,8 @@ xo_add_genfacet(
OUTPUT_CPP_DIR src/reader2
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-exprseqstate
@ -56,6 +58,8 @@ xo_add_genfacetimpl(
OUTPUT_CPP_DIR src/reader2
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-definessm
@ -68,6 +72,8 @@ xo_add_genfacetimpl(
OUTPUT_CPP_DIR src/reader2
)
# ----------------------------------------------------------------
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-syntaxstatemachine-expectsymbolssm
@ -80,6 +86,18 @@ xo_add_genfacetimpl(
OUTPUT_CPP_DIR src/reader2
)
# note: manual target; generated code committed to git
xo_add_genfacetimpl(
TARGET xo-reader2-facetimpl-printable-expectsymbolssm
FACET_PKG xo_printable2
FACET Printable
REPR ExpectSymbolSsm
INPUT idl/IPrintable_DExpectSymbolSsm.json5
OUTPUT_HPP_DIR include/xo/reader2
OUTPUT_IMPL_SUBDIR ssm
OUTPUT_CPP_DIR src/reader2
)
# ----------------------------------------------------------------
# shared library

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 DExpectSymbolSsm",
using_doxygen: true,
repr: "DExpectSymbolSsm",
doc: [ "implement APrintable for DExpectSymbolSsm" ],
}

View file

@ -8,6 +8,7 @@
#include "ParserStateMachine.hpp"
//#include "SyntaxStateMachine.hpp"
#include "syntaxstatetype.hpp"
#include <xo/indentlog/print/ppindentinfo.hpp>
#include <xo/facet/obj.hpp>
namespace xo {
@ -21,6 +22,7 @@ namespace xo {
class DExpectSymbolSsm {
public:
using DArena = xo::mm::DArena;
using ppindentinfo = xo::print::ppindentinfo;
public:
DExpectSymbolSsm();
@ -83,7 +85,12 @@ namespace xo {
///@}
/** @defgroup scm-expectsymbol-printable-facet printable facet methods **/
///@{
bool pretty(const ppindentinfo & ppii) const;
///@}
};
} /*namespace scm*/
} /*namespace xo*/

View file

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

View file

@ -20,6 +20,7 @@ set(SELF_SRCS
DExpectSymbolSsm.cpp
ISyntaxStateMachine_DExpectSymbolSsm.cpp
IPrintable_DExpectSymbolSsm.cpp
reader2_register_facets.cpp
reader2_register_types.cpp

View file

@ -103,6 +103,16 @@ namespace xo {
sym,
this->get_expect_str());
}
bool
DExpectSymbolSsm::pretty(const ppindentinfo & ppii) const
{
return ppii.pps()->pretty_struct
(ppii,
"DExpectSymbolSsm"
//refrtag("member", member_)
);
}
} /*namespace scm*/
} /*namespace xo*/

View file

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