xo-reader2: + DExpectFormalArglistSsm starts DExpectFormalArgSsm
This commit is contained in:
parent
60657ae68a
commit
089bd9fcbb
7 changed files with 39 additions and 22 deletions
|
|
@ -54,8 +54,12 @@ namespace xo {
|
|||
DExpectFormalArgSsm();
|
||||
|
||||
/** create empty instance using memory from @p mm **/
|
||||
DExpectFormalArgSsm * _make(DArena & mm);
|
||||
static obj<ASyntaxStateMachine,DExpectFormalArgSsm> make(DArena & mm);
|
||||
|
||||
/** create empty instance using memory from @p mm **/
|
||||
static DExpectFormalArgSsm * _make(DArena & mm);
|
||||
|
||||
/** puah instance of this ssm onto @p p_psm **/
|
||||
static void start(ParserStateMachine * p_psm);
|
||||
|
||||
/** @defgroup scm-expectformalargssm-ssm-facet syntaxstatemachine facet methods **/
|
||||
|
|
|
|||
|
|
@ -38,8 +38,7 @@ namespace xo {
|
|||
* to the state machine on top of the stack
|
||||
* as of when this start() method invoked
|
||||
**/
|
||||
static void start(DArena & parser_mm,
|
||||
ParserStateMachine * p_psm);
|
||||
static void start(ParserStateMachine * p_psm);
|
||||
|
||||
/** update state for this syntax on incoming token @p tk,
|
||||
* with overall parser state in @p p_psm
|
||||
|
|
|
|||
|
|
@ -597,7 +597,7 @@ namespace xo {
|
|||
if (defstate_ == defexprstatetype::def_0) {
|
||||
this->defstate_ = defexprstatetype::def_1;
|
||||
|
||||
DExpectSymbolSsm::start(p_psm->parser_alloc(), p_psm);
|
||||
DExpectSymbolSsm::start(p_psm);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,14 @@
|
|||
**/
|
||||
|
||||
#include "DExpectFormalArgSsm.hpp"
|
||||
#include "ssm/ISyntaxStateMachine_DExpectFormalArgSsm.hpp"
|
||||
#include "DExpectSymbolSsm.hpp"
|
||||
#include "ssm/ISyntaxStateMachine_DExpectSymbolSsm.hpp"
|
||||
|
||||
#ifdef NOT_YET
|
||||
#include "expect_symbol_xs.hpp"
|
||||
#include "expect_type_xs.hpp"
|
||||
#include "parserstatemachine.hpp"
|
||||
#include "exprstatestack.hpp"
|
||||
//#include "parserstatemachine.hpp"
|
||||
//#include "exprstatestack.hpp"
|
||||
#include "xo/expression/Variable.hpp"
|
||||
#endif
|
||||
|
||||
|
|
@ -38,6 +40,12 @@ namespace xo {
|
|||
|
||||
DExpectFormalArgSsm::DExpectFormalArgSsm() = default;
|
||||
|
||||
obj<ASyntaxStateMachine,DExpectFormalArgSsm>
|
||||
DExpectFormalArgSsm::make(DArena & mm)
|
||||
{
|
||||
return obj<ASyntaxStateMachine,DExpectFormalArgSsm>(_make(mm));
|
||||
}
|
||||
|
||||
DExpectFormalArgSsm *
|
||||
DExpectFormalArgSsm::_make(DArena & mm)
|
||||
{
|
||||
|
|
@ -46,6 +54,14 @@ namespace xo {
|
|||
return new (mem) DExpectFormalArgSsm();
|
||||
}
|
||||
|
||||
void
|
||||
DExpectFormalArgSsm::start(ParserStateMachine * p_psm)
|
||||
{
|
||||
p_psm->push_ssm(DExpectFormalArgSsm::make(p_psm->parser_alloc()));
|
||||
|
||||
DExpectSymbolSsm::start(p_psm);
|
||||
}
|
||||
|
||||
syntaxstatetype
|
||||
DExpectFormalArgSsm::ssm_type() const noexcept {
|
||||
return syntaxstatetype::expect_formal_arg;
|
||||
|
|
@ -161,14 +177,8 @@ namespace xo {
|
|||
expr,
|
||||
this->get_expect_str());
|
||||
}
|
||||
|
||||
#ifdef NOT_YET
|
||||
void
|
||||
DExpectFormalSsm::start(ParserStateMachine * p_psm) {
|
||||
p_psm->push_exprstate(expect_formal_xs::make());
|
||||
|
||||
expect_symbol_xs::start(p_psm);
|
||||
}
|
||||
|
||||
expect_formal_xs::expect_formal_xs()
|
||||
: exprstate(exprstatetype::expect_formal)
|
||||
{}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
#include "DExpectFormalArglistSsm.hpp"
|
||||
#include "ssm/ISyntaxStateMachine_DExpectFormalArglistSsm.hpp"
|
||||
#include "DExpectFormalArgSsm.hpp"
|
||||
#include "ssm/ISyntaxStateMachine_DExpectFormalArgSsm.hpp"
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/alloc2/arena/IAllocator_DArena.hpp>
|
||||
#include <xo/facet/FacetRegistry.hpp>
|
||||
|
|
@ -213,14 +215,10 @@ namespace xo {
|
|||
DExpectFormalArglistSsm::on_leftparen_token(const Token & tk,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
scope log(XO_DEBUG(true));
|
||||
|
||||
if (fastate_ == formalarglstatetype::argl_0) {
|
||||
this->fastate_ = formalarglstatetype::argl_1a;
|
||||
|
||||
log && log("STUB: DExpectFormalArglistSsm::on_leftparen_token -> DExpectFormalSsm::start()");
|
||||
|
||||
//DExpectFormalSsm::start(p_psm);
|
||||
DExpectFormalArgSsm::start(p_psm);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,11 +29,10 @@ namespace xo {
|
|||
}
|
||||
|
||||
void
|
||||
DExpectSymbolSsm::start(DArena & parser_alloc,
|
||||
ParserStateMachine * p_psm)
|
||||
DExpectSymbolSsm::start(ParserStateMachine * p_psm)
|
||||
{
|
||||
DExpectSymbolSsm * sym_ssm
|
||||
= DExpectSymbolSsm::make(parser_alloc);
|
||||
= DExpectSymbolSsm::make(p_psm->parser_alloc());
|
||||
|
||||
// note:
|
||||
// relying on [ISyntaxStateMachine_DExpectedSymbolSsm.hpp]
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@
|
|||
#include <xo/reader2/ssm/ISyntaxStateMachine_DExpectFormalArglistSsm.hpp>
|
||||
#include <xo/reader2/ssm/IPrintable_DExpectFormalArglistSsm.hpp>
|
||||
|
||||
#include <xo/reader2/ssm/ISyntaxStateMachine_DExpectFormalArgSsm.hpp>
|
||||
#include <xo/reader2/ssm/IPrintable_DExpectFormalArgSsm.hpp>
|
||||
|
||||
#include <xo/reader2/ssm/ISyntaxStateMachine_DExpectSymbolSsm.hpp>
|
||||
#include <xo/reader2/ssm/IPrintable_DExpectSymbolSsm.hpp>
|
||||
|
||||
|
|
@ -63,6 +66,9 @@ namespace xo {
|
|||
FacetRegistry::register_impl<ASyntaxStateMachine, DExpectFormalArglistSsm>();
|
||||
FacetRegistry::register_impl<APrintable, DExpectFormalArglistSsm>();
|
||||
|
||||
FacetRegistry::register_impl<ASyntaxStateMachine, DExpectFormalArgSsm>();
|
||||
FacetRegistry::register_impl<APrintable, DExpectFormalArgSsm>();
|
||||
|
||||
FacetRegistry::register_impl<ASyntaxStateMachine, DExpectSymbolSsm>();
|
||||
FacetRegistry::register_impl<APrintable, DExpectSymbolSsm>();
|
||||
|
||||
|
|
@ -80,6 +86,7 @@ namespace xo {
|
|||
log && log(xtag("DLambdaSsm.tseq", typeseq::id<DLambdaSsm>()));
|
||||
log && log(xtag("DIfElseSsm.tseq", typeseq::id<DIfElseSsm>()));
|
||||
log && log(xtag("DExpectFormalArglistSsm.tseq", typeseq::id<DExpectFormalArglistSsm>()));
|
||||
log && log(xtag("DExpectFormalArgSsm.tseq", typeseq::id<DExpectFormalArgSsm>()));
|
||||
log && log(xtag("DExpectSymbolSsm.tseq", typeseq::id<DExpectSymbolSsm>()));
|
||||
log && log(xtag("DExpectTypeSsm.tseq", typeseq::id<DExpectTypeSsm>()));
|
||||
log && log(xtag("DExpectExprSsm.tseq", typeseq::id<DExpectExprSsm>()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue