xo-reader2: + IPrintable+DExprSeqState

This commit is contained in:
Roland Conybeare 2026-01-20 00:57:34 -05:00
commit a836c72a72
7 changed files with 155 additions and 0 deletions

View file

@ -25,6 +25,13 @@ namespace xo {
N
};
const char * exprseqtype_descr(exprseqtype x);
inline std::ostream & operator<<(std::ostream & os, exprseqtype x) {
os << exprseqtype_descr(x);
return os;
}
/** @class DExprSeqState
* @brief state machine for parsing a sequence of expression
*
@ -33,6 +40,7 @@ namespace xo {
class DExprSeqState {
public:
using AAllocator = xo::mm::AAllocator;
using ppindentinfo = xo::print::ppindentinfo;
public:
explicit DExprSeqState(exprseqtype ty);
@ -78,6 +86,13 @@ namespace xo {
void on_parsed_symbol(std::string_view sym, ParserStateMachine * p_psm);
///@}
/** @defgroup scm-exprseq-printable-facet printable facet methods **/
///@{
/** pretty-printing driver; combine layout+printing **/
bool pretty(const ppindentinfo & ppii) const;
///@}
private:
/** sequence type. accept rvalue expressions when

View file

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