xo-reader2: handle parsed typedescr + use in DDefineSsm
This commit is contained in:
parent
7b62bd7f5c
commit
7d33440ecb
26 changed files with 231 additions and 37 deletions
|
|
@ -17,6 +17,7 @@
|
|||
#include "ParserStateMachine.hpp"
|
||||
#include "syntaxstatetype.hpp"
|
||||
#include <xo/tokenizer2/Token.hpp>
|
||||
#include <xo/reflect/TypeDescr.hpp>
|
||||
#include <xo/facet/obj.hpp>
|
||||
#include <xo/facet/facet_implementation.hpp>
|
||||
#include <xo/facet/typeseq.hpp>
|
||||
|
|
@ -41,6 +42,8 @@ public:
|
|||
using typeseq = xo::facet::typeseq;
|
||||
using Copaque = const void *;
|
||||
using Opaque = void *;
|
||||
/** reflected c++ type **/
|
||||
using TypeDescr = xo::reflect::TypeDescr;
|
||||
///@}
|
||||
|
||||
/** @defgroup scm-syntaxstatemachine-methods **/
|
||||
|
|
@ -64,6 +67,8 @@ public:
|
|||
virtual void on_colon_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) = 0;
|
||||
/** update stat machine for incoming parsed symbol @p sym **/
|
||||
virtual void on_parsed_symbol(Opaque data, std::string_view sym, ParserStateMachine * p_psm) = 0;
|
||||
/** operate state machine for incoming type description @p td **/
|
||||
virtual void on_parsed_typedescr(Opaque data, TypeDescr td, ParserStateMachine * p_psm) = 0;
|
||||
///@}
|
||||
}; /*ASyntaxStateMachine*/
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DExpectTypeSsm.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ namespace scm {
|
|||
|
||||
/** integer identifying a type **/
|
||||
using typeseq = xo::facet::typeseq;
|
||||
using TypeDescr = ASyntaxStateMachine::TypeDescr;
|
||||
|
||||
///@}
|
||||
/** @defgroup scm-syntaxstatemachine-any-methods **/
|
||||
|
|
@ -64,6 +65,7 @@ namespace scm {
|
|||
[[noreturn]] void on_if_token(Opaque, const Token &, ParserStateMachine *) override;
|
||||
[[noreturn]] void on_colon_token(Opaque, const Token &, ParserStateMachine *) override;
|
||||
[[noreturn]] void on_parsed_symbol(Opaque, std::string_view, ParserStateMachine *) override;
|
||||
[[noreturn]] void on_parsed_typedescr(Opaque, TypeDescr, ParserStateMachine *) override;
|
||||
|
||||
///@}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ namespace xo {
|
|||
public:
|
||||
/** @defgroup scm-syntaxstatemachine-ddefinessm-type-traits **/
|
||||
///@{
|
||||
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
|
||||
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
|
||||
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
|
||||
///@}
|
||||
|
|
@ -63,6 +64,8 @@ namespace xo {
|
|||
static void on_colon_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update stat machine for incoming parsed symbol @p sym **/
|
||||
static void on_parsed_symbol(DDefineSsm & self, std::string_view sym, ParserStateMachine * p_psm);
|
||||
/** operate state machine for incoming type description @p td **/
|
||||
static void on_parsed_typedescr(DDefineSsm & self, TypeDescr td, ParserStateMachine * p_psm);
|
||||
///@}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ namespace xo {
|
|||
public:
|
||||
/** @defgroup scm-syntaxstatemachine-dexpectsymbolssm-type-traits **/
|
||||
///@{
|
||||
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
|
||||
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
|
||||
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
|
||||
///@}
|
||||
|
|
@ -63,6 +64,8 @@ namespace xo {
|
|||
static void on_colon_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update stat machine for incoming parsed symbol @p sym **/
|
||||
static void on_parsed_symbol(DExpectSymbolSsm & self, std::string_view sym, ParserStateMachine * p_psm);
|
||||
/** operate state machine for incoming type description @p td **/
|
||||
static void on_parsed_typedescr(DExpectSymbolSsm & self, TypeDescr td, ParserStateMachine * p_psm);
|
||||
///@}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/ISyntaxStateMachine_DExpectTypeSsm.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
|
|
@ -41,6 +41,7 @@ namespace xo {
|
|||
public:
|
||||
/** @defgroup scm-syntaxstatemachine-dexpecttypessm-type-traits **/
|
||||
///@{
|
||||
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
|
||||
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
|
||||
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
|
||||
///@}
|
||||
|
|
@ -63,6 +64,8 @@ namespace xo {
|
|||
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);
|
||||
/** operate state machine for incoming type description @p td **/
|
||||
static void on_parsed_typedescr(DExpectTypeSsm & self, TypeDescr td, ParserStateMachine * p_psm);
|
||||
///@}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ namespace xo {
|
|||
public:
|
||||
/** @defgroup scm-syntaxstatemachine-dexprseqstate-type-traits **/
|
||||
///@{
|
||||
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
|
||||
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
|
||||
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
|
||||
///@}
|
||||
|
|
@ -63,6 +64,8 @@ namespace xo {
|
|||
static void on_colon_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update stat machine for incoming parsed symbol @p sym **/
|
||||
static void on_parsed_symbol(DExprSeqState & self, std::string_view sym, ParserStateMachine * p_psm);
|
||||
/** operate state machine for incoming type description @p td **/
|
||||
static void on_parsed_typedescr(DExprSeqState & self, TypeDescr td, ParserStateMachine * p_psm);
|
||||
///@}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
#include "ParserStateMachine.hpp"
|
||||
#include "syntaxstatetype.hpp"
|
||||
#include <xo/tokenizer2/Token.hpp>
|
||||
#include <xo/reflect/TypeDescr.hpp>
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
|
|
@ -30,6 +31,7 @@ namespace scm {
|
|||
using Impl = ISyntaxStateMachine_DRepr;
|
||||
/** integer identifying a type **/
|
||||
using typeseq = ASyntaxStateMachine::typeseq;
|
||||
using TypeDescr = ASyntaxStateMachine::TypeDescr;
|
||||
///@}
|
||||
|
||||
/** @defgroup scm-syntaxstatemachine-xfer-methods **/
|
||||
|
|
@ -65,6 +67,9 @@ namespace scm {
|
|||
void on_parsed_symbol(Opaque data, std::string_view sym, ParserStateMachine * p_psm) override {
|
||||
return I::on_parsed_symbol(_dcast(data), sym, p_psm);
|
||||
}
|
||||
void on_parsed_typedescr(Opaque data, TypeDescr td, ParserStateMachine * p_psm) override {
|
||||
return I::on_parsed_typedescr(_dcast(data), td, p_psm);
|
||||
}
|
||||
|
||||
///@}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ public:
|
|||
using ObjectType = Object;
|
||||
using DataPtr = Object::DataPtr;
|
||||
using typeseq = xo::reflect::typeseq;
|
||||
using TypeDescr = ASyntaxStateMachine::TypeDescr;
|
||||
///@}
|
||||
|
||||
/** @defgroup scm-syntaxstatemachine-router-ctors **/
|
||||
|
|
@ -70,6 +71,9 @@ public:
|
|||
void on_parsed_symbol(std::string_view sym, ParserStateMachine * p_psm) {
|
||||
return O::iface()->on_parsed_symbol(O::data(), sym, p_psm);
|
||||
}
|
||||
void on_parsed_typedescr(TypeDescr td, ParserStateMachine * p_psm) {
|
||||
return O::iface()->on_parsed_typedescr(O::data(), td, p_psm);
|
||||
}
|
||||
|
||||
///@}
|
||||
/** @defgroup scm-syntaxstatemachine-member-vars **/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue