diff --git a/CMakeLists.txt b/CMakeLists.txt index 85dabbf3..e2ee946b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,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-definessm + FACET_PKG xo_printable2 + FACET Printable + REPR DefineSsm + INPUT idl/IPrintable_DDefineSsm.json5 + OUTPUT_HPP_DIR include/xo/reader2 + OUTPUT_IMPL_SUBDIR ssm + OUTPUT_CPP_DIR src/reader2 +) + # ---------------------------------------------------------------- # note: manual target; generated code committed to git diff --git a/idl/IPrintable_DDefineSsm.json5 b/idl/IPrintable_DDefineSsm.json5 new file mode 100644 index 00000000..e79017f8 --- /dev/null +++ b/idl/IPrintable_DDefineSsm.json5 @@ -0,0 +1,13 @@ +{ + mode: "implementation", + includes: [ "", + "" ], + local_types: [], + namespace1: "xo", + namespace2: "scm", + facet_idl: "idl/Printable.json5", + brief: "provide APrintable interface for DDefineSsm", + using_doxygen: true, + repr: "DDefineSsm", + doc: [ "implement APrintable for DDefineSsm" ], +} diff --git a/include/xo/reader2/DDefineSsm.hpp b/include/xo/reader2/DDefineSsm.hpp index 3bc042c1..b8444cbe 100644 --- a/include/xo/reader2/DDefineSsm.hpp +++ b/include/xo/reader2/DDefineSsm.hpp @@ -73,6 +73,7 @@ namespace xo { public: using AAllocator = xo::mm::AAllocator; using DArena = xo::mm::DArena; + using ppindentinfo = xo::print::ppindentinfo; public: /** @defgroup scm-define-ssm-facet constructors **/ @@ -133,6 +134,12 @@ namespace xo { ParserStateMachine * p_psm); ///@} + /** @defgroup scm-define-printable-facet printable facet methods **/ + ///@{ + + bool pretty(const ppindentinfo & ppii) const; + + ///@} private: /** identify define-expression state **/ diff --git a/include/xo/reader2/ssm/IPrintable_DDefineSsm.hpp b/include/xo/reader2/ssm/IPrintable_DDefineSsm.hpp new file mode 100644 index 00000000..dd80b443 --- /dev/null +++ b/include/xo/reader2/ssm/IPrintable_DDefineSsm.hpp @@ -0,0 +1,62 @@ +/** @file IPrintable_DDefineSsm.hpp + * + * Generated automagically from ingredients: + * 1. code generator: + * [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet] + * arguments: + * --input [idl/IPrintable_DDefineSsm.json5] + * 2. jinja2 template for abstract facet .hpp file: + * [iface_facet_repr.hpp.j2] + * 3. idl for facet methods + * [idl/IPrintable_DDefineSsm.json5] + **/ + +#pragma once + +#include "Printable.hpp" +#include +#include +#include "DDefineSsm.hpp" + +namespace xo { namespace scm { class IPrintable_DDefineSsm; } } + +namespace xo { + namespace facet { + template <> + struct FacetImplementation + { + using ImplType = xo::print::IPrintable_Xfer + ; + }; + } +} + +namespace xo { + namespace scm { + /** @class IPrintable_DDefineSsm + **/ + class IPrintable_DDefineSsm { + public: + /** @defgroup scm-printable-ddefinessm-type-traits **/ + ///@{ + using ppindentinfo = xo::print::APrintable::ppindentinfo; + using Copaque = xo::print::APrintable::Copaque; + using Opaque = xo::print::APrintable::Opaque; + ///@} + /** @defgroup scm-printable-ddefinessm-methods **/ + ///@{ + // const methods + /** Pretty-printing support for this object. +See [xo-indentlog/xo/indentlog/pretty.hpp] **/ + static bool pretty(const DDefineSsm & self, const ppindentinfo & ppii); + + // non-const methods + ///@} + }; + + } /*namespace scm*/ +} /*namespace xo*/ + +/* end */ \ No newline at end of file diff --git a/src/reader2/CMakeLists.txt b/src/reader2/CMakeLists.txt index 0ad81a49..6b17e3d3 100644 --- a/src/reader2/CMakeLists.txt +++ b/src/reader2/CMakeLists.txt @@ -17,6 +17,7 @@ set(SELF_SRCS DDefineSsm.cpp ISyntaxStateMachine_DDefineSsm.cpp + IPrintable_DDefineSsm.cpp DExpectSymbolSsm.cpp ISyntaxStateMachine_DExpectSymbolSsm.cpp diff --git a/src/reader2/DDefineSsm.cpp b/src/reader2/DDefineSsm.cpp index eabc1868..3ae20286 100644 --- a/src/reader2/DDefineSsm.cpp +++ b/src/reader2/DDefineSsm.cpp @@ -494,6 +494,14 @@ namespace xo { this->get_expect_str()); } + bool + DDefineSsm::pretty(const ppindentinfo & ppii) const + { + return ppii.pps()->pretty_struct + (ppii, + "DDefineSsm", + refrtag("defstate", defstate_)); + } } /*namespace scm*/ } /*namespace xo*/ diff --git a/src/reader2/IPrintable_DDefineSsm.cpp b/src/reader2/IPrintable_DDefineSsm.cpp new file mode 100644 index 00000000..c3aa2edd --- /dev/null +++ b/src/reader2/IPrintable_DDefineSsm.cpp @@ -0,0 +1,28 @@ +/** @file IPrintable_DDefineSsm.cpp + * + * Generated automagically from ingredients: + * 1. code generator: + * [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet] + * arguments: + * --input [idl/IPrintable_DDefineSsm.json5] + * 2. jinja2 template for abstract facet .hpp file: + * [iface_facet_any.hpp.j2] + * 3. idl for facet methods + * [idl/IPrintable_DDefineSsm.json5] +**/ + +#include "ssm/IPrintable_DDefineSsm.hpp" + +namespace xo { + namespace scm { + auto + IPrintable_DDefineSsm::pretty(const DDefineSsm & self, const ppindentinfo & ppii) -> bool + { + return self.pretty(ppii); + } + + + } /*namespace scm*/ +} /*namespace xo*/ + +/* end IPrintable_DDefineSsm.cpp */ \ No newline at end of file diff --git a/src/reader2/reader2_register_facets.cpp b/src/reader2/reader2_register_facets.cpp index 67754bb6..ee838864 100644 --- a/src/reader2/reader2_register_facets.cpp +++ b/src/reader2/reader2_register_facets.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -33,6 +34,7 @@ namespace xo { FacetRegistry::register_impl(); FacetRegistry::register_impl(); + FacetRegistry::register_impl(); FacetRegistry::register_impl(); FacetRegistry::register_impl();