xo-reader2: refactor: make() + _make() pair for each ssm
This commit is contained in:
parent
da58e18779
commit
9a97bb2680
12 changed files with 92 additions and 59 deletions
|
|
@ -88,8 +88,12 @@ namespace xo {
|
|||
/** create instance using memory from @p parser_mm.
|
||||
* with function to be called supplied by @p fn_expr.
|
||||
**/
|
||||
static DApplySsm * make(DArena & parser_mm,
|
||||
obj<AExpression> fn_expr);
|
||||
static DApplySsm * _make(DArena & parser_mm,
|
||||
obj<AExpression> fn_expr);
|
||||
|
||||
/** create fop referring to new DApplySsm **/
|
||||
static obj<ASyntaxStateMachine,DApplySsm> make(DArena & parser_mm,
|
||||
obj<AExpression> fn_expr);
|
||||
|
||||
/**
|
||||
* Start apply. Will trigger this after input like
|
||||
|
|
|
|||
|
|
@ -25,9 +25,14 @@ namespace xo {
|
|||
explicit DExpectExprSsm(bool allow_defs,
|
||||
bool cxl_on_rightparen);
|
||||
|
||||
static DExpectExprSsm * make(DArena & parser_mm,
|
||||
bool allow_defs,
|
||||
bool cxl_on_rightbrace);
|
||||
static DExpectExprSsm * _make(DArena & parser_mm,
|
||||
bool allow_defs,
|
||||
bool cxl_on_rightbrace);
|
||||
|
||||
/** create fop referring to new DExpectExprSsm **/
|
||||
static obj<ASyntaxStateMachine,DExpectExprSsm> make(DArena & parser_mm,
|
||||
bool allow_defs,
|
||||
bool cxl_on_rightbrace);
|
||||
|
||||
static void start(DArena & parser_mm,
|
||||
bool allow_defs,
|
||||
|
|
|
|||
|
|
@ -29,7 +29,10 @@ namespace xo {
|
|||
DExpectSymbolSsm();
|
||||
|
||||
/** create instance using memory from @p parser_mm **/
|
||||
static DExpectSymbolSsm * make(DArena & parser_mm);
|
||||
static DExpectSymbolSsm * _make(DArena & parser_mm);
|
||||
|
||||
/** create fop referring to new DExpectSymbolSsm **/
|
||||
static obj<ASyntaxStateMachine,DExpectSymbolSsm> make(DArena & parser_mm);
|
||||
|
||||
/** start nested parser expecting a symbol,
|
||||
* on top of parser state machine @p p_psm.
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "DSyntaxStateMachine.hpp"
|
||||
#include <xo/facet/obj.hpp>
|
||||
#include <xo/indentlog/print/ppindentinfo.hpp>
|
||||
|
||||
namespace xo {
|
||||
|
|
@ -31,7 +32,10 @@ namespace xo {
|
|||
public:
|
||||
DExpectTypeSsm();
|
||||
|
||||
static DExpectTypeSsm * make(DArena & parser_mm);
|
||||
static DExpectTypeSsm * _make(DArena & parser_mm);
|
||||
|
||||
/** create fop referring to new DExpectTypeSsm **/
|
||||
static obj<ASyntaxStateMachine,DExpectTypeSsm> make(DArena & parser_mm);
|
||||
|
||||
static void start(ParserStateMachine * p_psm);
|
||||
|
||||
|
|
|
|||
|
|
@ -65,20 +65,16 @@ namespace xo {
|
|||
///@{
|
||||
explicit DIfElseSsm(DIfElseExpr * ifelse_expr);
|
||||
|
||||
#ifdef NOT_YET
|
||||
/** create instance using memory from @p parser_mm
|
||||
* with initial scaffold @p ifelse_expr
|
||||
**/
|
||||
static obj<AExpression,DIfElseSsm> make(DArena & parser_mm,
|
||||
DIfElseExpr * ifelse_expr);
|
||||
#endif
|
||||
|
||||
/** create instance using memory from @p parser_mm
|
||||
* with initial scaffold @p ifelse_expr.
|
||||
**/
|
||||
static DIfElseSsm * _make(DArena & parser_mm,
|
||||
DIfElseExpr * ifelse_expr);
|
||||
|
||||
/** create fop referring to new DIfElseSsm **/
|
||||
static obj<ASyntaxStateMachine,DIfElseSsm> make(DArena & parser_mm,
|
||||
DIfElseExpr * ifelse_expr);
|
||||
|
||||
/** start nested parser for an if-else expression
|
||||
* on top of parser state machine @p p_psm.
|
||||
* Use @p parser_mm to allocate syntax state machines
|
||||
|
|
|
|||
|
|
@ -96,9 +96,14 @@ namespace xo {
|
|||
public:
|
||||
DProgressSsm(obj<AExpression> lhs, optype op);
|
||||
|
||||
static DProgressSsm * make(DArena & parser_mm,
|
||||
obj<AExpression> lhs,
|
||||
optype op);
|
||||
static DProgressSsm * _make(DArena & parser_mm,
|
||||
obj<AExpression> lhs,
|
||||
optype op);
|
||||
|
||||
/** create fop referring to new DProgressSsm **/
|
||||
static obj<ASyntaxStateMachine,DProgressSsm> make(DArena & parser_mm,
|
||||
obj<AExpression> lhs,
|
||||
optype op);
|
||||
|
||||
static void start(DArena & parser_mm,
|
||||
ParserStateMachine * p_psm);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue