xo-reader2: + PSM,SSM on_parsed_formal_arglist()
This commit is contained in:
parent
2f9d49b083
commit
554c01ffad
48 changed files with 283 additions and 3 deletions
|
|
@ -715,6 +715,15 @@ namespace xo {
|
|||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DDefineSsm::on_parsed_formal_arglist(DArray * arglist,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
p_psm->illegal_parsed_formal_arglist("DDefineSsm::on_parsed_formal_arglist",
|
||||
arglist,
|
||||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DDefineSsm::on_parsed_expression(obj<AExpression> expr,
|
||||
ParserStateMachine * p_psm)
|
||||
|
|
|
|||
|
|
@ -365,6 +365,15 @@ namespace xo {
|
|||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DExpectExprSsm::on_parsed_formal_arglist(DArray * arglist,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
p_psm->illegal_parsed_formal_arglist("DExpectExprSsm::on_parsed_formal_arglist",
|
||||
arglist,
|
||||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DExpectExprSsm::on_parsed_expression(obj<AExpression> expr,
|
||||
ParserStateMachine * p_psm)
|
||||
|
|
|
|||
|
|
@ -212,6 +212,15 @@ namespace xo {
|
|||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DExpectFormalArgSsm::on_parsed_formal_arglist(DArray * arglist,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
p_psm->illegal_parsed_formal_arglist("DExpectFormalArgSsm::on_parsed_formal_arglist",
|
||||
arglist,
|
||||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DExpectFormalArgSsm::on_parsed_expression(obj<AExpression> expr,
|
||||
ParserStateMachine * p_psm)
|
||||
|
|
|
|||
|
|
@ -241,6 +241,15 @@ namespace xo {
|
|||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DExpectFormalArglistSsm::on_parsed_formal_arglist(DArray * arglist,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
p_psm->illegal_parsed_formal_arglist("DExpectFormalArglistSsm::on_parsed_formal_arglist",
|
||||
arglist,
|
||||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DExpectFormalArglistSsm::on_parsed_expression(obj<AExpression> expr,
|
||||
ParserStateMachine * p_psm)
|
||||
|
|
|
|||
|
|
@ -84,6 +84,15 @@ namespace xo {
|
|||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DExpectSymbolSsm::on_parsed_formal_arglist(DArray * arglist,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
p_psm->illegal_parsed_formal_arglist("DExpectSymbolSsm::on_parsed_formal_arglist",
|
||||
arglist,
|
||||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DExpectSymbolSsm::on_parsed_expression(obj<AExpression> expr,
|
||||
ParserStateMachine * p_psm)
|
||||
|
|
|
|||
|
|
@ -285,6 +285,15 @@ namespace xo {
|
|||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DExpectTypeSsm::on_parsed_formal_arglist(DArray * arglist,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
p_psm->illegal_parsed_formal_arglist("DExpectTypeSsm::on_parsed_formal_arglist",
|
||||
arglist,
|
||||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DExpectTypeSsm::on_parsed_expression(obj<AExpression> expr,
|
||||
ParserStateMachine * p_psm)
|
||||
|
|
|
|||
|
|
@ -460,6 +460,15 @@ namespace xo {
|
|||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_parsed_formal_arglist(DArray * arglist,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
p_psm->illegal_parsed_formal_arglist("DExprSeqState::on_parsed_formal_arglist",
|
||||
arglist,
|
||||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DExprSeqState::on_parsed_expression(obj<AExpression> expr,
|
||||
ParserStateMachine * p_psm)
|
||||
|
|
|
|||
|
|
@ -391,6 +391,15 @@ namespace xo {
|
|||
|
||||
}
|
||||
|
||||
void
|
||||
DIfElseSsm::on_parsed_formal_arglist(DArray * arglist,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
p_psm->illegal_parsed_formal_arglist("DIfElseSsm::on_parsed_formal_arglist",
|
||||
arglist,
|
||||
this->get_expect_str());
|
||||
}
|
||||
|
||||
#ifdef NOT_YET
|
||||
void
|
||||
if_else_xs::on_expr(bp<Expression> expr,
|
||||
|
|
|
|||
|
|
@ -349,6 +349,15 @@ namespace xo {
|
|||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DLambdaSsm::on_parsed_formal_arglist(DArray * arglist,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
p_psm->illegal_parsed_formal_arglist("DLambdaSsm::on_parsed_formal_arglist",
|
||||
arglist,
|
||||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DLambdaSsm::on_parsed_expression(obj<AExpression> expr,
|
||||
ParserStateMachine * p_psm)
|
||||
|
|
|
|||
|
|
@ -566,6 +566,15 @@ namespace xo {
|
|||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DProgressSsm::on_parsed_formal_arglist(DArray * arglist,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
p_psm->illegal_parsed_formal_arglist("DProgressSsm::on_parsed_formal_arglist",
|
||||
arglist,
|
||||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DProgressSsm::on_parsed_expression(obj<AExpression> expr,
|
||||
ParserStateMachine * p_psm)
|
||||
|
|
|
|||
|
|
@ -58,6 +58,12 @@ ISyntaxStateMachine_Any::on_parsed_formal(Opaque, const DUniqueString *, TypeDes
|
|||
_fatal();
|
||||
}
|
||||
|
||||
auto
|
||||
ISyntaxStateMachine_Any::on_parsed_formal_arglist(Opaque, DArray *, ParserStateMachine *) -> void
|
||||
{
|
||||
_fatal();
|
||||
}
|
||||
|
||||
auto
|
||||
ISyntaxStateMachine_Any::on_parsed_expression(Opaque, obj<AExpression>, ParserStateMachine *) -> void
|
||||
{
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ namespace xo {
|
|||
self.on_parsed_formal(param_name, param_type, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DDefineSsm::on_parsed_formal_arglist(DDefineSsm & self, DArray * arglist, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_formal_arglist(arglist, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DDefineSsm::on_parsed_expression(DDefineSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_expression(expr, p_psm);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ namespace xo {
|
|||
self.on_parsed_formal(param_name, param_type, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExpectExprSsm::on_parsed_formal_arglist(DExpectExprSsm & self, DArray * arglist, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_formal_arglist(arglist, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExpectExprSsm::on_parsed_expression(DExpectExprSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_expression(expr, p_psm);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ namespace xo {
|
|||
self.on_parsed_formal(param_name, param_type, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExpectFormalArgSsm::on_parsed_formal_arglist(DExpectFormalArgSsm & self, DArray * arglist, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_formal_arglist(arglist, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExpectFormalArgSsm::on_parsed_expression(DExpectFormalArgSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_expression(expr, p_psm);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ namespace xo {
|
|||
self.on_parsed_formal(param_name, param_type, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExpectFormalArglistSsm::on_parsed_formal_arglist(DExpectFormalArglistSsm & self, DArray * arglist, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_formal_arglist(arglist, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExpectFormalArglistSsm::on_parsed_expression(DExpectFormalArglistSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_expression(expr, p_psm);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ namespace xo {
|
|||
self.on_parsed_formal(param_name, param_type, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExpectSymbolSsm::on_parsed_formal_arglist(DExpectSymbolSsm & self, DArray * arglist, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_formal_arglist(arglist, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExpectSymbolSsm::on_parsed_expression(DExpectSymbolSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_expression(expr, p_psm);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ namespace xo {
|
|||
self.on_parsed_formal(param_name, param_type, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExpectTypeSsm::on_parsed_formal_arglist(DExpectTypeSsm & self, DArray * arglist, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_formal_arglist(arglist, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExpectTypeSsm::on_parsed_expression(DExpectTypeSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_expression(expr, p_psm);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ namespace xo {
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ namespace xo {
|
|||
self.on_parsed_formal(param_name, param_type, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DIfElseSsm::on_parsed_formal_arglist(DIfElseSsm & self, DArray * arglist, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_formal_arglist(arglist, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DIfElseSsm::on_parsed_expression(DIfElseSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_expression(expr, p_psm);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ namespace xo {
|
|||
self.on_parsed_formal(param_name, param_type, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DLambdaSsm::on_parsed_formal_arglist(DLambdaSsm & self, DArray * arglist, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_formal_arglist(arglist, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DLambdaSsm::on_parsed_expression(DLambdaSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_expression(expr, p_psm);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ namespace xo {
|
|||
self.on_parsed_formal(param_name, param_type, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DProgressSsm::on_parsed_formal_arglist(DProgressSsm & self, DArray * arglist, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_formal_arglist(arglist, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DProgressSsm::on_parsed_expression(DProgressSsm & self, obj<AExpression> expr, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_parsed_expression(expr, p_psm);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
#include "ParserStateMachine.hpp"
|
||||
#include "ParserStack.hpp"
|
||||
#include "SyntaxStateMachine.hpp"
|
||||
#include <xo/object2/array/IPrintable_DArray.hpp>
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/alloc2/arena/IAllocator_DArena.hpp>
|
||||
#include <xo/indentlog/scope.hpp>
|
||||
#include <xo/indentlog/print/tostr.hpp>
|
||||
|
|
@ -13,6 +15,7 @@
|
|||
#include <stdexcept>
|
||||
|
||||
namespace xo {
|
||||
using xo::print::APrintable;
|
||||
using xo::facet::with_facet;
|
||||
|
||||
namespace scm {
|
||||
|
|
@ -140,6 +143,17 @@ namespace xo {
|
|||
this->stack_->top().on_parsed_formal(sym, td, this);
|
||||
}
|
||||
|
||||
void
|
||||
ParserStateMachine::on_parsed_formal_arglist(DArray * arglist)
|
||||
{
|
||||
scope log(XO_DEBUG(debug_flag_),
|
||||
xtag("arglist", obj<APrintable,DArray>(arglist)));
|
||||
|
||||
assert(stack_);
|
||||
|
||||
this->stack_->top().on_parsed_formal_arglist(arglist, this);
|
||||
}
|
||||
|
||||
void
|
||||
ParserStateMachine::on_parsed_expression(obj<AExpression> expr)
|
||||
{
|
||||
|
|
@ -269,7 +283,7 @@ namespace xo {
|
|||
// - want to write error message using DArena
|
||||
// - need something like log_streambuf and/or tostr() that's arena-aware
|
||||
|
||||
auto errmsg_string = tostr("Unexpected expression",
|
||||
auto errmsg_string = tostr("Unexpected formal",
|
||||
xtag("param_name", std::string_view(*param_name)),
|
||||
xtag("param_type", param_type),
|
||||
xtag("expecting", expect_str),
|
||||
|
|
@ -284,6 +298,20 @@ namespace xo {
|
|||
this->capture_error(ssm_name, errmsg);
|
||||
}
|
||||
|
||||
void
|
||||
ParserStateMachine::illegal_parsed_formal_arglist(std::string_view ssm_name,
|
||||
DArray * arglist,
|
||||
std::string_view expect_str)
|
||||
{
|
||||
obj<APrintable,DArray> arglist_pr(arglist);
|
||||
|
||||
auto errmsg_string = tostr("Unexpected formal arglist",
|
||||
xtag("arglist", arglist_pr),
|
||||
xtag("expecting", expect_str),
|
||||
xtag("ssm", ssm_name),
|
||||
xtag("via", "ParserStateMachine::illegal_parsed_formal_arglist"));
|
||||
}
|
||||
|
||||
void
|
||||
ParserStateMachine::illegal_parsed_expression(std::string_view ssm_name,
|
||||
obj<AExpression> expr,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue