xo-reader2: + PSM,SSM on_parsed_formal_arglist()
This commit is contained in:
parent
8f531065a9
commit
eaa99881e0
49 changed files with 285 additions and 3 deletions
|
|
@ -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