xo-reader2: rename DExprSeqState -> DToplevelSeqSsm
This commit is contained in:
parent
5224799479
commit
da58e18779
17 changed files with 180 additions and 180 deletions
|
|
@ -38,11 +38,11 @@ xo_add_genfacet(
|
|||
|
||||
# note: manual target; generated code committed to git
|
||||
xo_add_genfacetimpl(
|
||||
TARGET xo-reader2-facetimpl-syntaxstatemachine-exprseqstate
|
||||
TARGET xo-reader2-facetimpl-syntaxstatemachine-toplevelseqssm
|
||||
FACET_PKG xo_reader2
|
||||
FACET SyntaxStateMachine
|
||||
REPR ExprSeqState
|
||||
INPUT idl/ISyntaxStateMachine_DExprSeqState.json5
|
||||
REPR ToplevelSeqSsm
|
||||
INPUT idl/ISyntaxStateMachine_DToplevelSeqSsm.json5
|
||||
OUTPUT_HPP_DIR include/xo/reader2
|
||||
OUTPUT_IMPL_SUBDIR ssm
|
||||
OUTPUT_CPP_DIR src/reader2
|
||||
|
|
@ -50,11 +50,11 @@ xo_add_genfacetimpl(
|
|||
|
||||
# note: manual target; generated code committed to git
|
||||
xo_add_genfacetimpl(
|
||||
TARGET xo-reader2-facetimpl-printable-exprseqstate
|
||||
TARGET xo-reader2-facetimpl-printable-toplevelseqssm
|
||||
FACET_PKG xo_printable2
|
||||
FACET Printable
|
||||
REPR ExprSeqState
|
||||
INPUT idl/IPrintable_DExprSeqState.json5
|
||||
REPR ToplevelSeqSsm
|
||||
INPUT idl/IPrintable_DToplevelSeqSsm.json5
|
||||
OUTPUT_HPP_DIR include/xo/reader2
|
||||
OUTPUT_IMPL_SUBDIR ssm
|
||||
OUTPUT_CPP_DIR src/reader2
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@ Composition of nested state machines.
|
|||
a state machine dedicated to some particular Schematika syntax.
|
||||
Examples: if-expression, type declaration, function call
|
||||
|
||||
## DExprSeqState
|
||||
## DToplevelSeqSsm
|
||||
|
||||
top-level expression sequence
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
namespace1: "xo",
|
||||
namespace2: "scm",
|
||||
facet_idl: "idl/Printable.json5",
|
||||
brief: "provide APrintable interface for DExprSeqState",
|
||||
brief: "provide APrintable interface for DToplevelSeqSsm",
|
||||
using_doxygen: true,
|
||||
repr: "DExprSeqState",
|
||||
doc: [ "implement APrintable for DExprSeqState" ],
|
||||
repr: "DToplevelSeqSsm",
|
||||
doc: [ "implement APrintable for DToplevelSeqSsm" ],
|
||||
}
|
||||
|
|
@ -6,8 +6,8 @@
|
|||
namespace1: "xo",
|
||||
namespace2: "scm",
|
||||
facet_idl: "idl/SyntaxStateMachine.json5",
|
||||
brief: "provide ASyntaxStateMachine interface for DExprSeqState",
|
||||
brief: "provide ASyntaxStateMachine interface for DToplevelSeqSsm",
|
||||
using_doxygen: true,
|
||||
repr: "DExprSeqState",
|
||||
doc: [ "implement ASyntaxStateMachine for DExprSeqState" ],
|
||||
repr: "DToplevelSeqSsm",
|
||||
doc: [ "implement ASyntaxStateMachine for DToplevelSeqSsm" ],
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/** @file DExprSeqState.hpp
|
||||
/** @file DToplevelSeqSsm.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Jan 2026
|
||||
**/
|
||||
|
|
@ -31,21 +31,21 @@ namespace xo {
|
|||
return os;
|
||||
}
|
||||
|
||||
/** @class DExprSeqState
|
||||
/** @class DToplevelSeqSsm
|
||||
* @brief state machine for parsing a sequence of expression
|
||||
*
|
||||
* Similar to exprseq_xs in xo-expresion
|
||||
**/
|
||||
class DExprSeqState : public DSyntaxStateMachine<DExprSeqState> {
|
||||
class DToplevelSeqSsm : public DSyntaxStateMachine<DToplevelSeqSsm> {
|
||||
public:
|
||||
using Super = DSyntaxStateMachine<DExprSeqState>;
|
||||
using Super = DSyntaxStateMachine<DToplevelSeqSsm>;
|
||||
using TypeDescr = xo::reflect::TypeDescr;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using DArena = xo::mm::DArena;
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
|
||||
public:
|
||||
explicit DExprSeqState(exprseqtype ty);
|
||||
explicit DToplevelSeqSsm(exprseqtype ty);
|
||||
|
||||
/** start interactive top-level session **/
|
||||
static void establish_interactive(DArena & mm,
|
||||
|
|
@ -55,7 +55,7 @@ namespace xo {
|
|||
ParserStateMachine * p_psm);
|
||||
|
||||
public:
|
||||
static const char * ssm_classname() { return "DExprSeqState"; }
|
||||
static const char * ssm_classname() { return "DToplevelSeqSsm"; }
|
||||
|
||||
/** @defgroup scm-exprseq-ssm-facet syntaxstatemachine facet methods **/
|
||||
///@{
|
||||
|
|
@ -152,4 +152,4 @@ namespace xo {
|
|||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end DExprSeqState.hpp */
|
||||
/* end DToplevelSeqSsm.hpp */
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
/** @file ExprSeqState.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DExprSeqState.hpp"
|
||||
#include "ssm/ISyntaxStateMachine_DExprSeqState.hpp"
|
||||
#include "ssm/IPrintable_DExprSeqState.hpp"
|
||||
|
||||
/* end ExprSeqState.hpp */
|
||||
12
include/xo/reader2/ToplevelSeqSsm.hpp
Normal file
12
include/xo/reader2/ToplevelSeqSsm.hpp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/** @file ToplevelSeqSsm.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DToplevelSeqSsm.hpp"
|
||||
#include "ssm/ISyntaxStateMachine_DToplevelSeqSsm.hpp"
|
||||
#include "ssm/IPrintable_DToplevelSeqSsm.hpp"
|
||||
|
||||
/* end ToplevelSeqSsm.hpp */
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
/** @file IPrintable_DExprSeqState.hpp
|
||||
/** @file IPrintable_DToplevelSeqSsm.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DExprSeqState.json5]
|
||||
* --input [idl/IPrintable_DToplevelSeqSsm.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DExprSeqState.json5]
|
||||
* [idl/IPrintable_DToplevelSeqSsm.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
|
@ -16,28 +16,28 @@
|
|||
#include "Printable.hpp"
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
|
||||
#include "DExprSeqState.hpp"
|
||||
#include "DToplevelSeqSsm.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IPrintable_DExprSeqState; } }
|
||||
namespace xo { namespace scm { class IPrintable_DToplevelSeqSsm; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::print::APrintable,
|
||||
xo::scm::DExprSeqState>
|
||||
xo::scm::DToplevelSeqSsm>
|
||||
{
|
||||
using ImplType = xo::print::IPrintable_Xfer
|
||||
<xo::scm::DExprSeqState,
|
||||
xo::scm::IPrintable_DExprSeqState>;
|
||||
<xo::scm::DToplevelSeqSsm,
|
||||
xo::scm::IPrintable_DToplevelSeqSsm>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IPrintable_DExprSeqState
|
||||
/** @class IPrintable_DToplevelSeqSsm
|
||||
**/
|
||||
class IPrintable_DExprSeqState {
|
||||
class IPrintable_DToplevelSeqSsm {
|
||||
public:
|
||||
/** @defgroup scm-printable-dexprseqstate-type-traits **/
|
||||
///@{
|
||||
|
|
@ -50,7 +50,7 @@ namespace xo {
|
|||
// const methods
|
||||
/** Pretty-printing support for this object.
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
|
||||
static bool pretty(const DExprSeqState & self, const ppindentinfo & ppii);
|
||||
static bool pretty(const DToplevelSeqSsm & self, const ppindentinfo & ppii);
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
/** @file ISyntaxStateMachine_DExprSeqState.hpp
|
||||
/** @file ISyntaxStateMachine_DToplevelSeqSsm.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/ISyntaxStateMachine_DExprSeqState.json5]
|
||||
* --input [idl/ISyntaxStateMachine_DToplevelSeqSsm.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/ISyntaxStateMachine_DExprSeqState.json5]
|
||||
* [idl/ISyntaxStateMachine_DToplevelSeqSsm.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
|
@ -16,28 +16,28 @@
|
|||
#include "SyntaxStateMachine.hpp"
|
||||
#include "SyntaxStateMachine.hpp"
|
||||
#include "ssm/ISyntaxStateMachine_Xfer.hpp"
|
||||
#include "DExprSeqState.hpp"
|
||||
#include "DToplevelSeqSsm.hpp"
|
||||
|
||||
namespace xo { namespace scm { class ISyntaxStateMachine_DExprSeqState; } }
|
||||
namespace xo { namespace scm { class ISyntaxStateMachine_DToplevelSeqSsm; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::scm::ASyntaxStateMachine,
|
||||
xo::scm::DExprSeqState>
|
||||
xo::scm::DToplevelSeqSsm>
|
||||
{
|
||||
using ImplType = xo::scm::ISyntaxStateMachine_Xfer
|
||||
<xo::scm::DExprSeqState,
|
||||
xo::scm::ISyntaxStateMachine_DExprSeqState>;
|
||||
<xo::scm::DToplevelSeqSsm,
|
||||
xo::scm::ISyntaxStateMachine_DToplevelSeqSsm>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class ISyntaxStateMachine_DExprSeqState
|
||||
/** @class ISyntaxStateMachine_DToplevelSeqSsm
|
||||
**/
|
||||
class ISyntaxStateMachine_DExprSeqState {
|
||||
class ISyntaxStateMachine_DToplevelSeqSsm {
|
||||
public:
|
||||
/** @defgroup scm-syntaxstatemachine-dexprseqstate-type-traits **/
|
||||
///@{
|
||||
|
|
@ -49,25 +49,25 @@ namespace xo {
|
|||
///@{
|
||||
// const methods
|
||||
/** identify a type of syntax state machine **/
|
||||
static syntaxstatetype ssm_type(const DExprSeqState & self) noexcept;
|
||||
static syntaxstatetype ssm_type(const DToplevelSeqSsm & self) noexcept;
|
||||
/** text describing expected/allowed input to this ssm in current state **/
|
||||
static std::string_view get_expect_str(const DExprSeqState & self) noexcept;
|
||||
static std::string_view get_expect_str(const DToplevelSeqSsm & self) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** operate state machine for incoming token @p tk **/
|
||||
static void on_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
static void on_token(DToplevelSeqSsm & 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);
|
||||
static void on_parsed_symbol(DToplevelSeqSsm & 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);
|
||||
static void on_parsed_typedescr(DToplevelSeqSsm & self, TypeDescr td, ParserStateMachine * p_psm);
|
||||
/** operate state machine for formal emitted by nested ssm **/
|
||||
static void on_parsed_formal(DExprSeqState & self, const DUniqueString * param_name, TypeDescr param_type, ParserStateMachine * p_psm);
|
||||
static void on_parsed_formal(DToplevelSeqSsm & self, const DUniqueString * param_name, TypeDescr param_type, ParserStateMachine * p_psm);
|
||||
/** consume formal arglist emitted by nested ssm **/
|
||||
static void on_parsed_formal_arglist(DExprSeqState & self, DArray * arglist, ParserStateMachine * p_psm);
|
||||
static void on_parsed_formal_arglist(DToplevelSeqSsm & self, DArray * arglist, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming parsed expression @p expr **/
|
||||
static void on_parsed_expression(DExprSeqState & self, obj<AExpression> expr, ParserStateMachine * p_psm);
|
||||
static void on_parsed_expression(DToplevelSeqSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm);
|
||||
/** update state machine @p p_psm for incoming parsed expression @p expr followed by token @p tk **/
|
||||
static void on_parsed_expression_with_token(DExprSeqState & self, obj<AExpression> expr, const Token & tk, ParserStateMachine * p_psm);
|
||||
static void on_parsed_expression_with_token(DToplevelSeqSsm & self, obj<AExpression> expr, const Token & tk, ParserStateMachine * p_psm);
|
||||
///@}
|
||||
};
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ namespace xo {
|
|||
/** expression enclosed in parentheses. See @ref DParenSsm **/
|
||||
paren,
|
||||
|
||||
/** toplevel of some translation unit. See @ref DExprSeqState **/
|
||||
/** toplevel of some translation unit. See @ref DToplevelSeqSsm **/
|
||||
expect_toplevel_expression_sequence,
|
||||
|
||||
/** expecting a formal argument list (sub-syntax within lambda-expression) **/
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ set(SELF_SRCS
|
|||
syntaxstatetype.cpp
|
||||
ISyntaxStateMachine_Any.cpp
|
||||
|
||||
DExprSeqState.cpp
|
||||
ISyntaxStateMachine_DExprSeqState.cpp
|
||||
IPrintable_DExprSeqState.cpp
|
||||
DToplevelSeqSsm.cpp
|
||||
ISyntaxStateMachine_DToplevelSeqSsm.cpp
|
||||
IPrintable_DToplevelSeqSsm.cpp
|
||||
|
||||
DDefineSsm.cpp
|
||||
ISyntaxStateMachine_DDefineSsm.cpp
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
/** @file DExprSeqState.cpp
|
||||
/** @file DToplevelSeqSsm.cpp
|
||||
*
|
||||
* @author Roland Conybeare, Jan 2026
|
||||
**/
|
||||
|
||||
#include "DExprSeqState.hpp"
|
||||
#include "ssm/ISyntaxStateMachine_DExprSeqState.hpp"
|
||||
#include "DToplevelSeqSsm.hpp"
|
||||
#include "ssm/ISyntaxStateMachine_DToplevelSeqSsm.hpp"
|
||||
#include "DDefineSsm.hpp"
|
||||
#include "DLambdaSsm.hpp"
|
||||
#include "ProgressSsm.hpp"
|
||||
|
|
@ -55,7 +55,7 @@ namespace xo {
|
|||
return "exprseqtype?";
|
||||
}
|
||||
|
||||
DExprSeqState::DExprSeqState(exprseqtype ty) : seqtype_{ty}
|
||||
DToplevelSeqSsm::DToplevelSeqSsm(exprseqtype ty) : seqtype_{ty}
|
||||
{}
|
||||
|
||||
namespace {
|
||||
|
|
@ -63,17 +63,17 @@ namespace xo {
|
|||
make_exprseq_ssm(DArena & mm,
|
||||
exprseqtype seqtype)
|
||||
{
|
||||
void * mem = mm.alloc(typeseq::id<DExprSeqState>(),
|
||||
sizeof(DExprSeqState));
|
||||
void * mem = mm.alloc(typeseq::id<DToplevelSeqSsm>(),
|
||||
sizeof(DToplevelSeqSsm));
|
||||
|
||||
DExprSeqState * ssm = new (mem) DExprSeqState(seqtype);
|
||||
DToplevelSeqSsm * ssm = new (mem) DToplevelSeqSsm(seqtype);
|
||||
|
||||
return obj<ASyntaxStateMachine,DExprSeqState>(ssm);
|
||||
return obj<ASyntaxStateMachine,DToplevelSeqSsm>(ssm);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DExprSeqState::establish_interactive(DArena & mm,
|
||||
DToplevelSeqSsm::establish_interactive(DArena & mm,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
p_psm->establish_toplevel_ssm(make_exprseq_ssm
|
||||
|
|
@ -82,7 +82,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
void
|
||||
DExprSeqState::establish_batch(DArena & mm,
|
||||
DToplevelSeqSsm::establish_batch(DArena & mm,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
p_psm->establish_toplevel_ssm(make_exprseq_ssm
|
||||
|
|
@ -93,13 +93,13 @@ namespace xo {
|
|||
// SyntaxStateMachine facet methods
|
||||
|
||||
syntaxstatetype
|
||||
DExprSeqState::ssm_type() const noexcept
|
||||
DToplevelSeqSsm::ssm_type() const noexcept
|
||||
{
|
||||
return syntaxstatetype::expect_toplevel_expression_sequence;
|
||||
}
|
||||
|
||||
std::string_view
|
||||
DExprSeqState::get_expect_str() const noexcept
|
||||
DToplevelSeqSsm::get_expect_str() const noexcept
|
||||
{
|
||||
// TODO: provisional. Will expand as more syntax implemented
|
||||
|
||||
|
|
@ -113,11 +113,11 @@ namespace xo {
|
|||
}
|
||||
|
||||
assert(false);
|
||||
return "impossible-DExprSeqState::get_expr_str";
|
||||
return "impossible-DToplevelSeqSsm::get_expr_str";
|
||||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_token(const Token & tk,
|
||||
DToplevelSeqSsm::on_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
scope log(XO_DEBUG(p_psm->debug_flag()), xtag("tk", tk));
|
||||
|
|
@ -197,13 +197,13 @@ namespace xo {
|
|||
break;
|
||||
}
|
||||
|
||||
p_psm->illegal_input_on_token("DExprSeqState::on_token",
|
||||
p_psm->illegal_input_on_token("DToplevelSeqSsm::on_token",
|
||||
tk,
|
||||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_symbol_token(const Token & tk,
|
||||
DToplevelSeqSsm::on_symbol_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
switch (seqtype_) {
|
||||
|
|
@ -215,7 +215,7 @@ namespace xo {
|
|||
if (var) {
|
||||
DProgressSsm::start(var, p_psm);
|
||||
} else {
|
||||
p_psm->unknown_variable_error("DExprSeqState::on_symbol_token",
|
||||
p_psm->unknown_variable_error("DToplevelSeqSsm::on_symbol_token",
|
||||
tk,
|
||||
this->get_expect_str(),
|
||||
p_psm);
|
||||
|
|
@ -234,7 +234,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_def_token(const Token & tk,
|
||||
DToplevelSeqSsm::on_def_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
(void)tk;
|
||||
|
|
@ -250,7 +250,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_lambda_token(const Token & tk,
|
||||
DToplevelSeqSsm::on_lambda_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
(void)tk;
|
||||
|
|
@ -271,7 +271,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_if_token(const Token & tk,
|
||||
DToplevelSeqSsm::on_if_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
switch (seqtype_) {
|
||||
|
|
@ -291,7 +291,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_string_token(const Token & tk,
|
||||
DToplevelSeqSsm::on_string_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
switch (seqtype_) {
|
||||
|
|
@ -318,7 +318,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_f64_token(const Token & tk,
|
||||
DToplevelSeqSsm::on_f64_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
switch (seqtype_) {
|
||||
|
|
@ -344,7 +344,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_i64_token(const Token & tk,
|
||||
DToplevelSeqSsm::on_i64_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
switch (seqtype_) {
|
||||
|
|
@ -370,7 +370,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_bool_token(const Token & tk,
|
||||
DToplevelSeqSsm::on_bool_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
switch (seqtype_) {
|
||||
|
|
@ -396,7 +396,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_leftparen_token(const Token & tk,
|
||||
DToplevelSeqSsm::on_leftparen_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
switch (seqtype_) {
|
||||
|
|
@ -423,21 +423,21 @@ namespace xo {
|
|||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_parsed_expression(obj<AExpression> expr,
|
||||
DToplevelSeqSsm::on_parsed_expression(obj<AExpression> expr,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
// toplevel expr sequence accepts an arbitrary number of expressions.
|
||||
|
||||
p_psm->capture_result("DExprSeqState::on_parsed_expression", expr);
|
||||
p_psm->capture_result("DToplevelSeqSsm::on_parsed_expression", expr);
|
||||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_parsed_expression_with_token(obj<AExpression> expr,
|
||||
DToplevelSeqSsm::on_parsed_expression_with_token(obj<AExpression> expr,
|
||||
const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
if (tk.tk_type() == tokentype::tk_semicolon) {
|
||||
p_psm->capture_result("DExprSeqState::on_parsed_expression_with_token", expr);
|
||||
p_psm->capture_result("DToplevelSeqSsm::on_parsed_expression_with_token", expr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -445,14 +445,14 @@ namespace xo {
|
|||
}
|
||||
|
||||
bool
|
||||
DExprSeqState::pretty(const ppindentinfo & ppii) const
|
||||
DToplevelSeqSsm::pretty(const ppindentinfo & ppii) const
|
||||
{
|
||||
return ppii.pps()->pretty_struct
|
||||
(ppii,
|
||||
"DExprSeqState",
|
||||
"DToplevelSeqSsm",
|
||||
refrtag("seqtype", seqtype_));
|
||||
}
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end DExprSeqState.cpp */
|
||||
/* end DToplevelSeqSsm.cpp */
|
||||
|
|
@ -1,22 +1,22 @@
|
|||
/** @file IPrintable_DExprSeqState.cpp
|
||||
/** @file IPrintable_DToplevelSeqSsm.cpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DExprSeqState.json5]
|
||||
* --input [idl/IPrintable_DToplevelSeqSsm.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DExprSeqState.json5]
|
||||
* [idl/IPrintable_DToplevelSeqSsm.json5]
|
||||
**/
|
||||
|
||||
#include "ssm/IPrintable_DExprSeqState.hpp"
|
||||
#include "ssm/IPrintable_DToplevelSeqSsm.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
auto
|
||||
IPrintable_DExprSeqState::pretty(const DExprSeqState & self, const ppindentinfo & ppii) -> bool
|
||||
IPrintable_DToplevelSeqSsm::pretty(const DToplevelSeqSsm & self, const ppindentinfo & ppii) -> bool
|
||||
{
|
||||
return self.pretty(ppii);
|
||||
}
|
||||
|
|
@ -25,4 +25,4 @@ namespace xo {
|
|||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end IPrintable_DExprSeqState.cpp */
|
||||
/* end IPrintable_DToplevelSeqSsm.cpp */
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
/** @file ISyntaxStateMachine_DExprSeqState.cpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/ISyntaxStateMachine_DExprSeqState.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/ISyntaxStateMachine_DExprSeqState.json5]
|
||||
**/
|
||||
|
||||
#include "ssm/ISyntaxStateMachine_DExprSeqState.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
auto
|
||||
ISyntaxStateMachine_DExprSeqState::ssm_type(const DExprSeqState & self) noexcept -> syntaxstatetype
|
||||
{
|
||||
return self.ssm_type();
|
||||
}
|
||||
|
||||
auto
|
||||
ISyntaxStateMachine_DExprSeqState::get_expect_str(const DExprSeqState & self) noexcept -> std::string_view
|
||||
{
|
||||
return self.get_expect_str();
|
||||
}
|
||||
|
||||
auto
|
||||
ISyntaxStateMachine_DExprSeqState::on_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_token(tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExprSeqState::on_parsed_symbol(DExprSeqState & self, std::string_view sym, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_symbol(sym, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExprSeqState::on_parsed_typedescr(DExprSeqState & self, TypeDescr td, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_typedescr(td, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExprSeqState::on_parsed_formal(DExprSeqState & self, const DUniqueString * param_name, TypeDescr param_type, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_formal(param_name, param_type, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExprSeqState::on_parsed_formal_arglist(DExprSeqState & self, DArray * arglist, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_formal_arglist(arglist, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExprSeqState::on_parsed_expression(DExprSeqState & self, obj<AExpression> expr, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_expression(expr, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExprSeqState::on_parsed_expression_with_token(DExprSeqState & self, obj<AExpression> expr, const Token & tk, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end ISyntaxStateMachine_DExprSeqState.cpp */
|
||||
69
src/reader2/ISyntaxStateMachine_DToplevelSeqSsm.cpp
Normal file
69
src/reader2/ISyntaxStateMachine_DToplevelSeqSsm.cpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/** @file ISyntaxStateMachine_DToplevelSeqSsm.cpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/ISyntaxStateMachine_DToplevelSeqSsm.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/ISyntaxStateMachine_DToplevelSeqSsm.json5]
|
||||
**/
|
||||
|
||||
#include "ssm/ISyntaxStateMachine_DToplevelSeqSsm.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
auto
|
||||
ISyntaxStateMachine_DToplevelSeqSsm::ssm_type(const DToplevelSeqSsm & self) noexcept -> syntaxstatetype
|
||||
{
|
||||
return self.ssm_type();
|
||||
}
|
||||
|
||||
auto
|
||||
ISyntaxStateMachine_DToplevelSeqSsm::get_expect_str(const DToplevelSeqSsm & self) noexcept -> std::string_view
|
||||
{
|
||||
return self.get_expect_str();
|
||||
}
|
||||
|
||||
auto
|
||||
ISyntaxStateMachine_DToplevelSeqSsm::on_token(DToplevelSeqSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_token(tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DToplevelSeqSsm::on_parsed_symbol(DToplevelSeqSsm & self, std::string_view sym, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_symbol(sym, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DToplevelSeqSsm::on_parsed_typedescr(DToplevelSeqSsm & self, TypeDescr td, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_typedescr(td, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DToplevelSeqSsm::on_parsed_formal(DToplevelSeqSsm & self, const DUniqueString * param_name, TypeDescr param_type, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_formal(param_name, param_type, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DToplevelSeqSsm::on_parsed_formal_arglist(DToplevelSeqSsm & self, DArray * arglist, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_formal_arglist(arglist, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DToplevelSeqSsm::on_parsed_expression(DToplevelSeqSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_expression(expr, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DToplevelSeqSsm::on_parsed_expression_with_token(DToplevelSeqSsm & self, obj<AExpression> expr, const Token & tk, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end ISyntaxStateMachine_DToplevelSeqSsm.cpp */
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
#include "SchematikaParser.hpp"
|
||||
#include "ParserStateMachine.hpp"
|
||||
#include "ParserStack.hpp"
|
||||
#include "DExprSeqState.hpp"
|
||||
#include "DToplevelSeqSsm.hpp"
|
||||
#include <cstddef>
|
||||
#include <xo/indentlog/scope.hpp>
|
||||
#include <stdexcept>
|
||||
|
|
@ -65,14 +65,14 @@ namespace xo {
|
|||
void
|
||||
SchematikaParser::begin_interactive_session()
|
||||
{
|
||||
DExprSeqState::establish_interactive(psm_.parser_alloc(), &psm_);
|
||||
DToplevelSeqSsm::establish_interactive(psm_.parser_alloc(), &psm_);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
SchematikaParser::begin_batch_session()
|
||||
{
|
||||
DExprSeqState::establish_batch(psm_.parser_alloc(), &psm_);
|
||||
DToplevelSeqSsm::establish_batch(psm_.parser_alloc(), &psm_);
|
||||
}
|
||||
|
||||
const ParserResult &
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include "reader2_register_facets.hpp"
|
||||
|
||||
#include "SchematikaParser.hpp"
|
||||
#include "ExprSeqState.hpp"
|
||||
#include "ToplevelSeqSsm.hpp"
|
||||
#include "DefineSsm.hpp"
|
||||
#include "LambdaSsm.hpp"
|
||||
#include "IfElseSsm.hpp"
|
||||
|
|
@ -37,8 +37,8 @@ namespace xo {
|
|||
{
|
||||
scope log(XO_DEBUG(true));
|
||||
|
||||
FacetRegistry::register_impl<ASyntaxStateMachine, DExprSeqState>();
|
||||
FacetRegistry::register_impl<APrintable, DExprSeqState>();
|
||||
FacetRegistry::register_impl<ASyntaxStateMachine, DToplevelSeqSsm>();
|
||||
FacetRegistry::register_impl<APrintable, DToplevelSeqSsm>();
|
||||
|
||||
FacetRegistry::register_impl<ASyntaxStateMachine, DDefineSsm>();
|
||||
FacetRegistry::register_impl<APrintable, DDefineSsm>();
|
||||
|
|
@ -80,7 +80,7 @@ namespace xo {
|
|||
// misc types showing up in parser stack arena
|
||||
TypeRegistry::register_type<ParserStack>();
|
||||
|
||||
log && log(xtag("DExprSeqState.tseq", typeseq::id<DExprSeqState>()));
|
||||
log && log(xtag("DToplevelSeqSsm.tseq", typeseq::id<DToplevelSeqSsm>()));
|
||||
log && log(xtag("DDefineSsm.tseq", typeseq::id<DDefineSsm>()));
|
||||
log && log(xtag("DLambdaSsm.tseq", typeseq::id<DLambdaSsm>()));
|
||||
log && log(xtag("DIfElseSsm.tseq", typeseq::id<DIfElseSsm>()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue