xo-expression2 xo-reader2 DSequenceExpr, DSequenceSsm [WIP]
This commit is contained in:
parent
e7bdcbc125
commit
bcd95502d2
4 changed files with 195 additions and 18 deletions
|
|
@ -169,21 +169,6 @@ namespace xo {
|
|||
void on_parsed_typedescr(TypeDescr td,
|
||||
ParserStateMachine * p_psm);
|
||||
|
||||
#ifdef OBSOLETE
|
||||
/** update state for this ssm to consume param (name,value)
|
||||
* emitted by nested @p_psm
|
||||
**/
|
||||
void on_parsed_formal(const DUniqueString * param_name,
|
||||
TypeDescr param_type,
|
||||
ParserStateMachine * p_psm);
|
||||
|
||||
/** consume formal params @p arglist from completed nested ssm,
|
||||
* with overall parser state in @p p_psm.
|
||||
**/
|
||||
void on_parsed_formal_arglist(DArray * arglist,
|
||||
ParserStateMachine * p_psm);
|
||||
#endif
|
||||
|
||||
/** update state for this syntax after parsing an expression @p expr,
|
||||
* overall parser state in @p p_psm
|
||||
**/
|
||||
|
|
|
|||
57
include/xo/reader2/DSequenceSsm.hpp
Normal file
57
include/xo/reader2/DSequenceSsm.hpp
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
/** @file DSequenceSsm.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Jan 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DSyntaxStateMachine.hpp"
|
||||
//#include "exprstate.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm { class Sequence; }
|
||||
namespace scm { class Lambda; }
|
||||
|
||||
namespace scm {
|
||||
class DSequenceSsm : public DSyntaxStateMachine<DSequenceSsm> {
|
||||
public:
|
||||
using Sequence = xo::scm::Sequence;
|
||||
using Lambda = xo::scm::Lambda;
|
||||
|
||||
public:
|
||||
const char * ssm_classname() const noexcept { return "DSequenceSsm"; }
|
||||
|
||||
#ifdef NOT_YET
|
||||
/** start parsing a sequence-expr.
|
||||
* input begins with first expression in the sequence.
|
||||
**/
|
||||
static void start(parserstatemachine * p_psm);
|
||||
|
||||
/** named ctor idiom **/
|
||||
static std::unique_ptr<sequence_xs> make();
|
||||
|
||||
virtual void on_expr(bp<Expression> expr,
|
||||
parserstatemachine * p_psm) override;
|
||||
virtual void on_expr_with_semicolon(bp<Expression> expr,
|
||||
parserstatemachine * p_psm) override;
|
||||
|
||||
virtual void on_rightbrace_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) override;
|
||||
|
||||
virtual void print(std::ostream & os) const override;
|
||||
virtual bool pretty_print(const xo::print::ppindentinfo & ppii) const override;
|
||||
#endif
|
||||
|
||||
private:
|
||||
DSequenceSsm();
|
||||
|
||||
private:
|
||||
/** will build SequenceExpr from in-order contents of this array **/
|
||||
DArray * expr_v_;
|
||||
//std::vector<rp<Expression>> expr_v_;
|
||||
};
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
|
||||
/* end DSequenceSsm.hpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue