xo-reader2: + DExpectTypeSsm + extend DDefineSsm [WIP]
This commit is contained in:
parent
c87975ab18
commit
7b62bd7f5c
13 changed files with 442 additions and 10 deletions
62
include/xo/reader2/ssm/IPrintable_DExpectTypeSsm.hpp
Normal file
62
include/xo/reader2/ssm/IPrintable_DExpectTypeSsm.hpp
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/** @file IPrintable_DExpectTypeSsm.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DExpectTypeSsm.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DExpectTypeSsm.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Printable.hpp"
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
|
||||
#include "DExpectTypeSsm.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IPrintable_DExpectTypeSsm; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::print::APrintable,
|
||||
xo::scm::DExpectTypeSsm>
|
||||
{
|
||||
using ImplType = xo::print::IPrintable_Xfer
|
||||
<xo::scm::DExpectTypeSsm,
|
||||
xo::scm::IPrintable_DExpectTypeSsm>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IPrintable_DExpectTypeSsm
|
||||
**/
|
||||
class IPrintable_DExpectTypeSsm {
|
||||
public:
|
||||
/** @defgroup scm-printable-dexpecttypessm-type-traits **/
|
||||
///@{
|
||||
using ppindentinfo = xo::print::APrintable::ppindentinfo;
|
||||
using Copaque = xo::print::APrintable::Copaque;
|
||||
using Opaque = xo::print::APrintable::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-printable-dexpecttypessm-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** Pretty-printing support for this object.
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
|
||||
static bool pretty(const DExpectTypeSsm & self, const ppindentinfo & ppii);
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
/** @file ISyntaxStateMachine_DExpectTypeSsm.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/ISyntaxStateMachine_DExpectTypeSsm.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/ISyntaxStateMachine_DExpectTypeSsm.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SyntaxStateMachine.hpp"
|
||||
#include "SyntaxStateMachine.hpp"
|
||||
#include "ssm/ISyntaxStateMachine_Xfer.hpp"
|
||||
#include "DExpectTypeSsm.hpp"
|
||||
|
||||
namespace xo { namespace scm { class ISyntaxStateMachine_DExpectTypeSsm; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::scm::ASyntaxStateMachine,
|
||||
xo::scm::DExpectTypeSsm>
|
||||
{
|
||||
using ImplType = xo::scm::ISyntaxStateMachine_Xfer
|
||||
<xo::scm::DExpectTypeSsm,
|
||||
xo::scm::ISyntaxStateMachine_DExpectTypeSsm>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class ISyntaxStateMachine_DExpectTypeSsm
|
||||
**/
|
||||
class ISyntaxStateMachine_DExpectTypeSsm {
|
||||
public:
|
||||
/** @defgroup scm-syntaxstatemachine-dexpecttypessm-type-traits **/
|
||||
///@{
|
||||
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
|
||||
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-syntaxstatemachine-dexpecttypessm-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** identify a type of syntax state machine **/
|
||||
static syntaxstatetype ssm_type(const DExpectTypeSsm & self) noexcept;
|
||||
/** text describing expected/allowed input to this ssm in current state **/
|
||||
static std::string_view get_expect_str(const DExpectTypeSsm & self) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** operate state machine for incoming symbol-token @p tk **/
|
||||
static void on_symbol_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming define-keyword-token @p tk **/
|
||||
static void on_def_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming if-keyword-token @p tk **/
|
||||
static void on_if_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming colon-token @p tk **/
|
||||
static void on_colon_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update stat machine for incoming parsed symbol @p sym **/
|
||||
static void on_parsed_symbol(DExpectTypeSsm & self, std::string_view sym, ParserStateMachine * p_psm);
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
Loading…
Add table
Add a link
Reference in a new issue