xo-reader2 stack: parenthesized expressions [WIP]
This commit is contained in:
parent
ca1370570b
commit
d65eb54102
24 changed files with 1095 additions and 35 deletions
|
|
@ -37,6 +37,10 @@ set(SELF_SRCS
|
|||
ISyntaxStateMachine_DLambdaSsm.cpp
|
||||
IPrintable_DLambdaSsm.cpp
|
||||
|
||||
DParenSsm.cpp
|
||||
ISyntaxStateMachine_DParenSsm.cpp
|
||||
IPrintable_DParenSsm.cpp
|
||||
|
||||
DExpectFormalArglistSsm.cpp
|
||||
ISyntaxStateMachine_DExpectFormalArglistSsm.cpp
|
||||
IPrintable_DExpectFormalArglistSsm.cpp
|
||||
|
|
|
|||
|
|
@ -555,7 +555,6 @@ namespace xo {
|
|||
case tokentype::tk_end:
|
||||
case tokentype::N:
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
Super::on_token(tk, p_psm);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include "SyntaxStateMachine.hpp"
|
||||
#include "ssm/ISyntaxStateMachine_DProgressSsm.hpp"
|
||||
#include "DSequenceSsm.hpp"
|
||||
#include "LambdaSsm.hpp"
|
||||
#include "syntaxstatetype.hpp"
|
||||
#include <xo/expression2/Variable.hpp>
|
||||
#include <xo/expression2/Constant.hpp>
|
||||
|
|
@ -138,6 +139,10 @@ namespace xo {
|
|||
this->on_bool_token(tk, p_psm);
|
||||
return;
|
||||
|
||||
case tokentype::tk_lambda:
|
||||
this->on_lambda_token(tk, p_psm);
|
||||
return;
|
||||
|
||||
// all the not-yet handled cases
|
||||
case tokentype::tk_invalid:
|
||||
case tokentype::tk_if:
|
||||
|
|
@ -165,7 +170,6 @@ namespace xo {
|
|||
case tokentype::tk_cmpeq:
|
||||
case tokentype::tk_cmpne:
|
||||
case tokentype::tk_type:
|
||||
case tokentype::tk_lambda:
|
||||
case tokentype::tk_then:
|
||||
case tokentype::tk_else:
|
||||
case tokentype::tk_let:
|
||||
|
|
@ -379,6 +383,15 @@ namespace xo {
|
|||
p_psm);
|
||||
}
|
||||
|
||||
void
|
||||
DExpectExprSsm::on_lambda_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
(void)tk;
|
||||
|
||||
DLambdaSsm::start(p_psm);
|
||||
}
|
||||
|
||||
void
|
||||
DExpectExprSsm::on_parsed_expression(obj<AExpression> expr,
|
||||
ParserStateMachine * p_psm)
|
||||
|
|
@ -412,17 +425,6 @@ namespace xo {
|
|||
}
|
||||
|
||||
#ifdef NOT_YET
|
||||
void
|
||||
expect_expr_xs::on_lambda_token(const token_type & /*tk*/,
|
||||
parserstatemachine * p_psm)
|
||||
{
|
||||
scope log(XO_DEBUG(p_psm->debug_flag()));
|
||||
|
||||
//constexpr const char * self_name = "exprstate::on_leftparen";
|
||||
|
||||
lambda_xs::start(p_psm);
|
||||
}
|
||||
|
||||
void
|
||||
expect_expr_xs::on_if_token(const token_type & /*tk*/,
|
||||
parserstatemachine * p_psm)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/** @file DExprSeqState.cpp
|
||||
*
|
||||
*
|
||||
* @author Roland Conybeare, Jan 2026
|
||||
**/
|
||||
|
||||
|
|
@ -9,6 +9,8 @@
|
|||
#include "DLambdaSsm.hpp"
|
||||
#include "DProgressSsm.hpp"
|
||||
#include "DIfElseSsm.hpp"
|
||||
#include "ParenSsm.hpp"
|
||||
#include "ExpectExprSsm.hpp"
|
||||
|
||||
#include <xo/expression2/DConstant.hpp>
|
||||
#include <xo/expression2/detail/IExpression_DConstant.hpp>
|
||||
|
|
@ -152,9 +154,12 @@ namespace xo {
|
|||
this->on_bool_token(tk, p_psm);
|
||||
return;
|
||||
|
||||
case tokentype::tk_leftparen:
|
||||
this->on_leftparen_token(tk, p_psm);
|
||||
return;
|
||||
|
||||
// all the not-yet handled cases
|
||||
case tokentype::tk_invalid:
|
||||
case tokentype::tk_leftparen:
|
||||
case tokentype::tk_rightparen:
|
||||
case tokentype::tk_leftbracket:
|
||||
case tokentype::tk_rightbracket:
|
||||
|
|
@ -389,6 +394,27 @@ namespace xo {
|
|||
Super::on_token(tk, p_psm);
|
||||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_leftparen_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
switch (seqtype_) {
|
||||
case exprseqtype::toplevel_interactive: {
|
||||
DParenSsm::start(p_psm);
|
||||
p_psm->on_token(Token::leftparen_token());
|
||||
|
||||
return;
|
||||
}
|
||||
case exprseqtype::toplevel_batch:
|
||||
break;
|
||||
case exprseqtype::N:
|
||||
assert(false); // unreachable
|
||||
break;
|
||||
}
|
||||
|
||||
Super::on_token(tk, p_psm);
|
||||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_parsed_expression(obj<AExpression> expr,
|
||||
ParserStateMachine * p_psm)
|
||||
|
|
|
|||
|
|
@ -136,6 +136,10 @@ namespace xo {
|
|||
this->on_yields_token(tk, p_psm);
|
||||
return;
|
||||
|
||||
case tokentype::tk_leftbrace:
|
||||
this->on_leftbrace_token(tk, p_psm);
|
||||
return;
|
||||
|
||||
// all the not-yet-handled cases
|
||||
case tokentype::tk_def:
|
||||
case tokentype::tk_if:
|
||||
|
|
@ -152,7 +156,6 @@ namespace xo {
|
|||
case tokentype::tk_rightparen:
|
||||
case tokentype::tk_leftbracket:
|
||||
case tokentype::tk_rightbracket:
|
||||
case tokentype::tk_leftbrace:
|
||||
case tokentype::tk_rightbrace:
|
||||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
|
|
@ -179,11 +182,6 @@ namespace xo {
|
|||
}
|
||||
|
||||
Super::on_token(tk, p_psm);
|
||||
#ifdef OBSOLETE
|
||||
p_psm->illegal_input_on_token("DLambdaSsm::on_token",
|
||||
tk,
|
||||
this->get_expect_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -199,11 +197,6 @@ namespace xo {
|
|||
}
|
||||
|
||||
Super::on_token(tk, p_psm);
|
||||
#ifdef OBSOLETE
|
||||
p_psm->illegal_input_on_token("DLambdaSsm::on_lambda_token",
|
||||
tk,
|
||||
this->get_expect_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -220,13 +213,28 @@ namespace xo {
|
|||
}
|
||||
|
||||
Super::on_token(tk, p_psm);
|
||||
#ifdef OBSOLETE
|
||||
p_psm->illegal_input_on_token("DLambdaSsm::on_yields_token",
|
||||
tk,
|
||||
this->get_expect_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
DLambdaSsm::on_leftbrace_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
if (lmstate_ == lambdastatetype::lm_2) {
|
||||
// control here when leftbrace immediately follows
|
||||
// formal param list.
|
||||
// Otherwise leftbrace arrives in DExpectExprSsm
|
||||
// pushed via on_parsed_typedescr()
|
||||
|
||||
this->lmstate_ = lambdastatetype::lm_4;
|
||||
|
||||
DExpectExprSsm::start(p_psm);
|
||||
// precharge ssm for body with leftbrace
|
||||
p_psm->on_token(Token::leftbrace_token());
|
||||
return;
|
||||
}
|
||||
|
||||
Super::on_token(tk, p_psm);
|
||||
}
|
||||
|
||||
void
|
||||
DLambdaSsm::on_parsed_typedescr(TypeDescr td,
|
||||
|
|
|
|||
382
src/reader2/DParenSsm.cpp
Normal file
382
src/reader2/DParenSsm.cpp
Normal file
|
|
@ -0,0 +1,382 @@
|
|||
/** @file DParenSsm.cpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#include "ParenSsm.hpp"
|
||||
#include "syntaxstatetype.hpp"
|
||||
#include <string_view>
|
||||
|
||||
namespace xo {
|
||||
using xo::facet::with_facet;
|
||||
using xo::facet::typeseq;
|
||||
|
||||
namespace scm {
|
||||
|
||||
extern const char *
|
||||
parenexprstatetype_descr(parenexprstatetype x)
|
||||
{
|
||||
switch(x) {
|
||||
case parenexprstatetype::invalid: return "invalid";
|
||||
case parenexprstatetype::lparen_0: return "lparen_0";
|
||||
case parenexprstatetype::lparen_1: return "lparen_1";
|
||||
case parenexprstatetype::lparen_2: return "lparen_2";
|
||||
case parenexprstatetype::N: break;
|
||||
}
|
||||
|
||||
return "???parenexprstatetype";
|
||||
}
|
||||
|
||||
std::ostream &
|
||||
operator<<(std::ostream & os, parenexprstatetype x) {
|
||||
os << parenexprstatetype_descr(x);
|
||||
return os;
|
||||
}
|
||||
|
||||
DParenSsm::DParenSsm()
|
||||
: parenstate_(parenexprstatetype::lparen_0),
|
||||
expr_{}
|
||||
{}
|
||||
|
||||
DParenSsm *
|
||||
DParenSsm::make(DArena & mm)
|
||||
{
|
||||
void * mem = mm.alloc(typeseq::id<DParenSsm>(),
|
||||
sizeof(DParenSsm));
|
||||
|
||||
return new (mem) DParenSsm();
|
||||
}
|
||||
|
||||
void
|
||||
DParenSsm::start(ParserStateMachine * p_psm)
|
||||
{
|
||||
DParenSsm * paren_ssm = DParenSsm::make(p_psm->parser_alloc());
|
||||
|
||||
auto ssm = with_facet<ASyntaxStateMachine>::mkobj(paren_ssm);
|
||||
|
||||
p_psm->push_ssm(ssm);
|
||||
}
|
||||
|
||||
syntaxstatetype
|
||||
DParenSsm::ssm_type() const noexcept
|
||||
{
|
||||
return syntaxstatetype::paren;
|
||||
}
|
||||
|
||||
std::string_view
|
||||
DParenSsm::get_expect_str() const noexcept
|
||||
{
|
||||
switch (this->parenstate_) {
|
||||
case parenexprstatetype::invalid:
|
||||
case parenexprstatetype::N:
|
||||
break;
|
||||
case parenexprstatetype::lparen_0: return "lparen_0";
|
||||
case parenexprstatetype::lparen_1: return "lparen_1";
|
||||
case parenexprstatetype::lparen_2: return "lparen_2";
|
||||
}
|
||||
|
||||
return "???parenexprstatetype";
|
||||
}
|
||||
|
||||
void
|
||||
DParenSsm::on_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
switch (tk.tk_type()) {
|
||||
case tokentype::tk_leftparen:
|
||||
this->on_leftparen_token(tk, p_psm);
|
||||
return;
|
||||
// all the not-yet handled cases
|
||||
case tokentype::tk_symbol:
|
||||
case tokentype::tk_def:
|
||||
case tokentype::tk_colon:
|
||||
case tokentype::tk_singleassign:
|
||||
case tokentype::tk_semicolon:
|
||||
case tokentype::tk_invalid:
|
||||
case tokentype::tk_string:
|
||||
case tokentype::tk_f64:
|
||||
case tokentype::tk_i64:
|
||||
case tokentype::tk_bool:
|
||||
case tokentype::tk_if:
|
||||
case tokentype::tk_rightparen:
|
||||
case tokentype::tk_leftbracket:
|
||||
case tokentype::tk_rightbracket:
|
||||
case tokentype::tk_leftbrace:
|
||||
case tokentype::tk_rightbrace:
|
||||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_lessequal:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_comma:
|
||||
case tokentype::tk_doublecolon:
|
||||
case tokentype::tk_assign:
|
||||
case tokentype::tk_yields:
|
||||
case tokentype::tk_plus:
|
||||
case tokentype::tk_minus:
|
||||
case tokentype::tk_star:
|
||||
case tokentype::tk_slash:
|
||||
case tokentype::tk_cmpeq:
|
||||
case tokentype::tk_cmpne:
|
||||
case tokentype::tk_type:
|
||||
case tokentype::tk_lambda:
|
||||
case tokentype::tk_then:
|
||||
case tokentype::tk_else:
|
||||
case tokentype::tk_let:
|
||||
case tokentype::tk_in:
|
||||
case tokentype::tk_end:
|
||||
case tokentype::N:
|
||||
break;
|
||||
}
|
||||
|
||||
Super::on_token(tk, p_psm);
|
||||
}
|
||||
|
||||
void
|
||||
DParenSsm::on_leftparen_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
Super::on_token(tk, p_psm);
|
||||
}
|
||||
|
||||
#ifdef OBSOLETE
|
||||
void
|
||||
paren_xs::start(parserstatemachine * p_psm)
|
||||
{
|
||||
p_psm->push_exprstate(paren_xs::make());
|
||||
expect_expr_xs::start(p_psm);
|
||||
}
|
||||
|
||||
bool
|
||||
paren_xs::admits_rightparen() const {
|
||||
switch (parenxs_type_) {
|
||||
case parenexprstatetype::lparen_0:
|
||||
/* unreachable */
|
||||
assert(false);
|
||||
return false;
|
||||
|
||||
case parenexprstatetype::lparen_1:
|
||||
return true;
|
||||
|
||||
case parenexprstatetype::invalid:
|
||||
case parenexprstatetype::n_parenexprstatetype:
|
||||
/* unreachable */
|
||||
assert(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
paren_xs::admits_f64() const {
|
||||
switch (parenxs_type_) {
|
||||
case parenexprstatetype::lparen_0:
|
||||
return true;
|
||||
|
||||
case parenexprstatetype::lparen_1:
|
||||
return false;
|
||||
|
||||
case parenexprstatetype::invalid:
|
||||
case parenexprstatetype::n_parenexprstatetype:
|
||||
/* unreachable */
|
||||
assert(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
paren_xs::on_def_token(const token_type & tk,
|
||||
parserstatemachine * /*p_psm*/)
|
||||
{
|
||||
constexpr const char * c_self_name = "paren_xs::on_def";
|
||||
|
||||
this->illegal_input_error(c_self_name, tk);
|
||||
}
|
||||
|
||||
void
|
||||
paren_xs::on_symbol_token(const token_type & /*tk*/,
|
||||
parserstatemachine * p_psm)
|
||||
{
|
||||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag));
|
||||
|
||||
log && log(xtag("exstype", p_psm->top_exprstate().exs_type()));
|
||||
|
||||
//constexpr const char * self_name = "paren_xs::on_symbol";
|
||||
|
||||
/* TODO: lparen_0: treat as variable reference */
|
||||
|
||||
assert(false);
|
||||
}
|
||||
|
||||
void
|
||||
paren_xs::on_typedescr(TypeDescr /*td*/,
|
||||
parserstatemachine * /*p_psm*/)
|
||||
{
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
paren_xs::on_colon_token(const token_type & tk,
|
||||
parserstatemachine * /*p_psm*/)
|
||||
{
|
||||
constexpr const char * c_self_name = "paren_xs::on_colon";
|
||||
|
||||
this->illegal_input_error(c_self_name, tk);
|
||||
}
|
||||
|
||||
void
|
||||
paren_xs::on_semicolon_token(const token_type & tk,
|
||||
parserstatemachine * /*p_psm*/)
|
||||
{
|
||||
constexpr const char * c_self_name = "paren_xs::on_semicolon";
|
||||
|
||||
this->illegal_input_error(c_self_name, tk);
|
||||
}
|
||||
|
||||
void
|
||||
paren_xs::on_singleassign_token(const token_type & tk,
|
||||
parserstatemachine * /*p_psm*/)
|
||||
{
|
||||
constexpr const char * c_self_name = "paren_xs::on_singleassign";
|
||||
|
||||
this->illegal_input_error(c_self_name, tk);
|
||||
}
|
||||
|
||||
void
|
||||
paren_xs::on_leftparen_token(const token_type & tk,
|
||||
parserstatemachine * /*p_psm*/)
|
||||
{
|
||||
constexpr const char * c_self_name = "paren_xs::on_leftparen";
|
||||
|
||||
this->illegal_input_error(c_self_name, tk);
|
||||
}
|
||||
|
||||
void
|
||||
paren_xs::on_rightparen_token(const token_type & tk,
|
||||
parserstatemachine * p_psm)
|
||||
{
|
||||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag));
|
||||
|
||||
constexpr const char * c_self_name = "paren_xs::on_rightparen";
|
||||
|
||||
if (!this->admits_rightparen())
|
||||
{
|
||||
this->illegal_input_error(c_self_name, tk);
|
||||
}
|
||||
|
||||
if (this->parenxs_type_ == parenexprstatetype::lparen_1) {
|
||||
rp<Expression> expr = this->gen_expr_;
|
||||
|
||||
std::unique_ptr<exprstate> self = p_psm->pop_exprstate();
|
||||
|
||||
p_psm->top_exprstate().on_expr(expr, p_psm);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
paren_xs::on_i64_token(const token_type & tk,
|
||||
parserstatemachine * /*p_psm*/)
|
||||
{
|
||||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag));
|
||||
|
||||
constexpr const char * c_self_name = "paren_xs::on_i64";
|
||||
|
||||
this->illegal_input_error(c_self_name, tk);
|
||||
}
|
||||
|
||||
void
|
||||
paren_xs::on_f64_token(const token_type & tk,
|
||||
parserstatemachine * /*p_psm*/)
|
||||
{
|
||||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag));
|
||||
|
||||
constexpr const char * c_self_name = "paren_xs::on_f64";
|
||||
|
||||
this->illegal_input_error(c_self_name, tk);
|
||||
}
|
||||
|
||||
void
|
||||
paren_xs::on_expr(bp<Expression> expr,
|
||||
parserstatemachine * p_psm)
|
||||
{
|
||||
constexpr bool c_debug_flag = true;
|
||||
scope log(XO_DEBUG(c_debug_flag));
|
||||
|
||||
log && log(xtag("exstype", this->exs_type_),
|
||||
xtag("expr", expr));
|
||||
|
||||
switch (this->parenxs_type_) {
|
||||
case parenexprstatetype::lparen_0: {
|
||||
this->parenxs_type_ = parenexprstatetype::lparen_1; /* wants on_rightparen */
|
||||
progress_xs::start(expr.promote(), p_psm);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
case parenexprstatetype::lparen_1: {
|
||||
this->gen_expr_ = expr.promote();
|
||||
|
||||
/* expect immediate incoming call, this time to on_rightparen() */
|
||||
return;
|
||||
}
|
||||
|
||||
default:
|
||||
/* unreachable */
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
} /*on_expr*/
|
||||
|
||||
void
|
||||
paren_xs::on_symbol(const std::string & /*symbol_name*/,
|
||||
parserstatemachine * /*p_psm*/)
|
||||
{
|
||||
switch(this->parenxs_type_) {
|
||||
case parenexprstatetype::lparen_0:
|
||||
case parenexprstatetype::lparen_1:
|
||||
/* NOT IMPLEMENTED */
|
||||
assert(false);
|
||||
return;
|
||||
|
||||
default:
|
||||
/* unreachable */
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
paren_xs::print(std::ostream & os) const {
|
||||
os << "<paren_xs"
|
||||
<< xtag("this", (void*)this)
|
||||
//<< xtag("type", exs_type_);
|
||||
<< xtag("parenxs_type", parenxs_type_);
|
||||
|
||||
if (gen_expr_)
|
||||
os << xtag("gen_expr", gen_expr_);
|
||||
|
||||
os << ">";
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
DParenSsm::pretty(const ppindentinfo & ppii) const
|
||||
{
|
||||
return ppii.pps()->pretty_struct(ppii,
|
||||
"DParenSsm",
|
||||
refrtag("parenstate", parenstate_),
|
||||
refrtag("expect", this->get_expect_str()));
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end DParenSsm.cpp */
|
||||
28
src/reader2/IPrintable_DParenSsm.cpp
Normal file
28
src/reader2/IPrintable_DParenSsm.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/** @file IPrintable_DParenSsm.cpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DParenSsm.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DParenSsm.json5]
|
||||
**/
|
||||
|
||||
#include "ssm/IPrintable_DParenSsm.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
auto
|
||||
IPrintable_DParenSsm::pretty(const DParenSsm & self, const ppindentinfo & ppii) -> bool
|
||||
{
|
||||
return self.pretty(ppii);
|
||||
}
|
||||
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end IPrintable_DParenSsm.cpp */
|
||||
69
src/reader2/ISyntaxStateMachine_DParenSsm.cpp
Normal file
69
src/reader2/ISyntaxStateMachine_DParenSsm.cpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/** @file ISyntaxStateMachine_DParenSsm.cpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/ISyntaxStateMachine_DParenSsm.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/ISyntaxStateMachine_DParenSsm.json5]
|
||||
**/
|
||||
|
||||
#include "ssm/ISyntaxStateMachine_DParenSsm.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
auto
|
||||
ISyntaxStateMachine_DParenSsm::ssm_type(const DParenSsm & self) noexcept -> syntaxstatetype
|
||||
{
|
||||
return self.ssm_type();
|
||||
}
|
||||
|
||||
auto
|
||||
ISyntaxStateMachine_DParenSsm::get_expect_str(const DParenSsm & self) noexcept -> std::string_view
|
||||
{
|
||||
return self.get_expect_str();
|
||||
}
|
||||
|
||||
auto
|
||||
ISyntaxStateMachine_DParenSsm::on_token(DParenSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_token(tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DParenSsm::on_parsed_symbol(DParenSsm & self, std::string_view sym, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_symbol(sym, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DParenSsm::on_parsed_typedescr(DParenSsm & self, TypeDescr td, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_typedescr(td, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DParenSsm::on_parsed_formal(DParenSsm & self, const DUniqueString * param_name, TypeDescr param_type, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_formal(param_name, param_type, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DParenSsm::on_parsed_formal_arglist(DParenSsm & self, DArray * arglist, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_formal_arglist(arglist, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DParenSsm::on_parsed_expression(DParenSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_expression(expr, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DParenSsm::on_parsed_expression_with_token(DParenSsm & 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_DParenSsm.cpp */
|
||||
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
#include <xo/reader2/ssm/IPrintable_DSequenceSsm.hpp>
|
||||
|
||||
#include "ParenSsm.hpp"
|
||||
|
||||
#include <xo/reader2/ssm/ISyntaxStateMachine_DExpectFormalArglistSsm.hpp>
|
||||
#include <xo/reader2/ssm/IPrintable_DExpectFormalArglistSsm.hpp>
|
||||
|
||||
|
|
@ -85,6 +87,9 @@ namespace xo {
|
|||
FacetRegistry::register_impl<ASyntaxStateMachine, DProgressSsm>();
|
||||
FacetRegistry::register_impl<APrintable, DProgressSsm>();
|
||||
|
||||
FacetRegistry::register_impl<ASyntaxStateMachine, DParenSsm>();
|
||||
FacetRegistry::register_impl<APrintable, DParenSsm>();
|
||||
|
||||
log && log(xtag("DExprSeqState.tseq", typeseq::id<DExprSeqState>()));
|
||||
log && log(xtag("DDefineSsm.tseq", typeseq::id<DDefineSsm>()));
|
||||
log && log(xtag("DLambdaSsm.tseq", typeseq::id<DLambdaSsm>()));
|
||||
|
|
@ -95,6 +100,7 @@ namespace xo {
|
|||
log && log(xtag("DExpectTypeSsm.tseq", typeseq::id<DExpectTypeSsm>()));
|
||||
log && log(xtag("DExpectExprSsm.tseq", typeseq::id<DExpectExprSsm>()));
|
||||
log && log(xtag("DProgressSsm.tseq", typeseq::id<DProgressSsm>()));
|
||||
log && log(xtag("DParenSsm.tseq", typeseq::id<DParenSsm>()));
|
||||
log && log(xtag("ASyntaxStateMachine.tseq", typeseq::id<ASyntaxStateMachine>()));
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ namespace xo {
|
|||
return "sequence";
|
||||
case syntaxstatetype::progress:
|
||||
return "progress";
|
||||
case syntaxstatetype::paren:
|
||||
return "paren";
|
||||
case syntaxstatetype::expect_toplevel_expression_sequence:
|
||||
return "expect-toplevel-expression-sequence";
|
||||
case syntaxstatetype::expect_formal_arglist:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue