diff --git a/CMakeLists.txt b/CMakeLists.txt index 7017425e..85dabbf3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/idl/IPrintable_DExpectSymbolSsm.json5 b/idl/IPrintable_DExpectSymbolSsm.json5 new file mode 100644 index 00000000..1d662986 --- /dev/null +++ b/idl/IPrintable_DExpectSymbolSsm.json5 @@ -0,0 +1,13 @@ +{ + mode: "implementation", + includes: [ "", + "" ], + 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" ], +} diff --git a/include/xo/reader2/DExpectSymbolSsm.hpp b/include/xo/reader2/DExpectSymbolSsm.hpp index dadd1300..2ecc556d 100644 --- a/include/xo/reader2/DExpectSymbolSsm.hpp +++ b/include/xo/reader2/DExpectSymbolSsm.hpp @@ -8,6 +8,7 @@ #include "ParserStateMachine.hpp" //#include "SyntaxStateMachine.hpp" #include "syntaxstatetype.hpp" +#include #include 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*/ diff --git a/include/xo/reader2/ssm/IPrintable_DExpectSymbolSsm.hpp b/include/xo/reader2/ssm/IPrintable_DExpectSymbolSsm.hpp new file mode 100644 index 00000000..6e63383b --- /dev/null +++ b/include/xo/reader2/ssm/IPrintable_DExpectSymbolSsm.hpp @@ -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 +#include +#include "DExpectSymbolSsm.hpp" + +namespace xo { namespace scm { class IPrintable_DExpectSymbolSsm; } } + +namespace xo { + namespace facet { + template <> + struct FacetImplementation + { + using ImplType = xo::print::IPrintable_Xfer + ; + }; + } +} + +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 */ \ No newline at end of file diff --git a/src/reader2/CMakeLists.txt b/src/reader2/CMakeLists.txt index 3a04f430..0ad81a49 100644 --- a/src/reader2/CMakeLists.txt +++ b/src/reader2/CMakeLists.txt @@ -20,6 +20,7 @@ set(SELF_SRCS DExpectSymbolSsm.cpp ISyntaxStateMachine_DExpectSymbolSsm.cpp + IPrintable_DExpectSymbolSsm.cpp reader2_register_facets.cpp reader2_register_types.cpp diff --git a/src/reader2/DExpectSymbolSsm.cpp b/src/reader2/DExpectSymbolSsm.cpp index 6afe337c..c859528f 100644 --- a/src/reader2/DExpectSymbolSsm.cpp +++ b/src/reader2/DExpectSymbolSsm.cpp @@ -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*/ diff --git a/src/reader2/IPrintable_DExpectSymbolSsm.cpp b/src/reader2/IPrintable_DExpectSymbolSsm.cpp new file mode 100644 index 00000000..2cef62a7 --- /dev/null +++ b/src/reader2/IPrintable_DExpectSymbolSsm.cpp @@ -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 */ \ No newline at end of file