xo-reader2: + on_f64_token() + handle in DDefineSsm+DProgressSsm
This commit is contained in:
parent
8b148285b1
commit
5bd78b8f4e
62 changed files with 1680 additions and 25 deletions
|
|
@ -147,6 +147,12 @@ namespace xo {
|
|||
void on_singleassign_token(const Token & tk,
|
||||
ParserStateMachine * p_psm);
|
||||
|
||||
/** update state for this syntax on incoming f64 token @p tk,
|
||||
* overall parser state in @p p_psm
|
||||
**/
|
||||
void on_f64_token(const Token & tk,
|
||||
ParserStateMachine * p_psm);
|
||||
|
||||
/** update state for this syntax after parsing a symbol @p sym;
|
||||
* overall parser state in @p p_psm
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -83,6 +83,12 @@ namespace xo {
|
|||
void on_singleassign_token(const Token & tk,
|
||||
ParserStateMachine * p_psm);
|
||||
|
||||
/** update state for this syntax on incoming f64 token @p tk,
|
||||
* overall parser state in @p p_psm
|
||||
**/
|
||||
void on_f64_token(const Token & tk,
|
||||
ParserStateMachine * p_psm);
|
||||
|
||||
/** update state for this syntax after parsing a symbol @p sym;
|
||||
* overall parser state in @p p_psm
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -103,6 +103,12 @@ namespace xo {
|
|||
void on_singleassign_token(const Token & tk,
|
||||
ParserStateMachine * p_psm);
|
||||
|
||||
/** update state for this syntax on incoming f64 token @p tk,
|
||||
* overall parser state in @p p_psm
|
||||
**/
|
||||
void on_f64_token(const Token & tk,
|
||||
ParserStateMachine * p_psm);
|
||||
|
||||
///@}
|
||||
/** @defgroup scm-expectsymbol-printable-facet printable facet methods **/
|
||||
///@{
|
||||
|
|
|
|||
|
|
@ -77,6 +77,12 @@ namespace xo {
|
|||
void on_singleassign_token(const Token & tk,
|
||||
ParserStateMachine * p_psm);
|
||||
|
||||
/** update state for this syntax on incoming f64 token @p tk,
|
||||
* overall parser state in @p p_psm
|
||||
**/
|
||||
void on_f64_token(const Token & tk,
|
||||
ParserStateMachine * p_psm);
|
||||
|
||||
/** (Never called).
|
||||
* Operate state machine for this syntax after symbol
|
||||
* emitted from nested ssm.
|
||||
|
|
|
|||
|
|
@ -90,6 +90,11 @@ namespace xo {
|
|||
**/
|
||||
void on_singleassign_token(const Token & tk, ParserStateMachine * p_psm);
|
||||
|
||||
/** update state for this syntax on incoming f64 token @p tk,
|
||||
* overall parser state in @p p_psm
|
||||
**/
|
||||
void on_f64_token(const Token & tk, ParserStateMachine * p_psm);
|
||||
|
||||
/** update state for this syntax on parsed symbol @p sym
|
||||
* from immediately-downstream ssm.
|
||||
* overall parser state in @p p_psm
|
||||
|
|
|
|||
220
xo-reader2/include/xo/reader2/DProgressSsm.hpp
Normal file
220
xo-reader2/include/xo/reader2/DProgressSsm.hpp
Normal file
|
|
@ -0,0 +1,220 @@
|
|||
/** @file DProgressSsm.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Jan 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ParserStateMachine.hpp"
|
||||
#include "syntaxstatetype.hpp"
|
||||
//#include <xo/expression2/Expression.hpp>
|
||||
#include <xo/facet/obj.hpp>
|
||||
|
||||
#ifdef NOT_YET
|
||||
#include "exprstate.hpp"
|
||||
#include "xo/reflect/TypeDescr.hpp"
|
||||
#include <iostream>
|
||||
//#include <cstdint>
|
||||
#endif
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** represent an infix operator.
|
||||
*
|
||||
* See @ref progress_xs::assemble_expr() for translation
|
||||
* to Expression
|
||||
**/
|
||||
enum class optype {
|
||||
invalid = -1,
|
||||
|
||||
/** op:= **/
|
||||
op_assign,
|
||||
|
||||
/** op< **/
|
||||
op_less,
|
||||
/** op<= **/
|
||||
op_less_equal,
|
||||
/** op== **/
|
||||
op_equal,
|
||||
/** op!= **/
|
||||
op_not_equal,
|
||||
/** op> **/
|
||||
op_great,
|
||||
/** op>= **/
|
||||
op_great_equal,
|
||||
|
||||
/** op+ **/
|
||||
op_add,
|
||||
/** op- **/
|
||||
op_subtract,
|
||||
|
||||
/** op* **/
|
||||
op_multiply,
|
||||
/** op/ **/
|
||||
op_divide,
|
||||
|
||||
n_optype
|
||||
};
|
||||
|
||||
extern const char *
|
||||
optype_descr(optype x);
|
||||
|
||||
/** report operator precedence.
|
||||
* lowest operator precedence is 1
|
||||
**/
|
||||
extern int
|
||||
precedence(optype x);
|
||||
|
||||
inline std::ostream &
|
||||
operator<< (std::ostream & os, optype x) {
|
||||
os << optype_descr(x);
|
||||
return os;
|
||||
}
|
||||
|
||||
/** @class DProgressSsm
|
||||
* @brief syntax state machine for parsing a schematica rhs-value-expression
|
||||
*
|
||||
* Handles an expression that produces a value, for example appearing on the
|
||||
* right-hand side of a definition.
|
||||
*
|
||||
* Deals with:
|
||||
* 1. infix operators including operator precedence.
|
||||
* 2. generates argument-type-specific arithmetic expressions,
|
||||
* for example using ``Apply::make_add2_f64()`` when adding floating-point numbers
|
||||
*
|
||||
* One reason for this to exist is to simulate one-token lookahead.
|
||||
* To look at but not consume a token T, can push a progress_xs instance P,
|
||||
* then send T to P.
|
||||
**/
|
||||
class DProgressSsm {
|
||||
public:
|
||||
using TypeDescr = xo::reflect::TypeDescr;
|
||||
using DArena = xo::mm::DArena;
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
|
||||
public:
|
||||
DProgressSsm(obj<AExpression> lhs, optype op);
|
||||
|
||||
static DProgressSsm * make(DArena & parser_mm,
|
||||
obj<AExpression> lhs,
|
||||
optype op);
|
||||
|
||||
static void start(DArena & parser_mm,
|
||||
obj<AExpression> valex,
|
||||
ParserStateMachine * p_psm);
|
||||
|
||||
#ifdef NOT_YET
|
||||
static void start(rp<Expression> valex,
|
||||
optype optype,
|
||||
parserstatemachine * p_psm);
|
||||
#endif
|
||||
|
||||
syntaxstatetype ssm_type() const noexcept;
|
||||
|
||||
#ifdef NOT_YET
|
||||
bool admits_f64() const;
|
||||
|
||||
void apply_type_error(const char * self_name,
|
||||
optype op,
|
||||
bp<Expression> expr1,
|
||||
bp<Expression> expr2,
|
||||
parserstatemachine * p_psm) const;
|
||||
#endif
|
||||
|
||||
std::string_view get_expect_str() const noexcept;
|
||||
|
||||
#ifdef NOT_YET
|
||||
void on_expr(bp<Expression> expr,
|
||||
parserstatemachine * p_psm) override;
|
||||
void on_expr_with_semicolon(bp<Expression> expr,
|
||||
parserstatemachine * p_psm) override;
|
||||
#endif
|
||||
void on_symbol_token(const Token & tk,
|
||||
ParserStateMachine * p_psm);
|
||||
void on_def_token(const Token & tk,
|
||||
ParserStateMachine * p_psm);
|
||||
void on_if_token(const Token & tk,
|
||||
ParserStateMachine * p_psm);
|
||||
void on_colon_token(const Token & tk,
|
||||
ParserStateMachine * p_psm);
|
||||
void on_singleassign_token(const Token & tk,
|
||||
ParserStateMachine * p_psm);
|
||||
void on_f64_token(const Token & tk,
|
||||
ParserStateMachine * p_psm);
|
||||
void on_parsed_symbol(std::string_view sym,
|
||||
ParserStateMachine * p_psm);
|
||||
void on_parsed_typedescr(TypeDescr td,
|
||||
ParserStateMachine * p_psm);
|
||||
|
||||
///@{
|
||||
|
||||
/** @defgroup scm-progressssm-printable-facet printable facet methods **/
|
||||
bool pretty(const ppindentinfo & ppii) const;
|
||||
|
||||
#ifdef NOT_YET
|
||||
void on_comma_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) final override;
|
||||
void on_typedescr(TypeDescr td,
|
||||
parserstatemachine * p_psm) override;
|
||||
|
||||
void on_semicolon_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) override;
|
||||
void on_assign_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) final override;
|
||||
void on_leftparen_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) override;
|
||||
void on_rightparen_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) override;
|
||||
void on_rightbrace_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) override;
|
||||
void on_then_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) override;
|
||||
void on_else_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) override;
|
||||
|
||||
/* entry point for an infix operator token */
|
||||
void on_operator_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) final override;
|
||||
|
||||
void on_bool_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) override;
|
||||
|
||||
void on_i64_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) override;
|
||||
|
||||
|
||||
void print(std::ostream & os) const override;
|
||||
|
||||
private:
|
||||
/** assemble expression representing
|
||||
* value of
|
||||
* @code
|
||||
* f(lhs_, rhs_)
|
||||
* @endcode
|
||||
*
|
||||
* where f determined by @ref op_type_
|
||||
**/
|
||||
obj<AExpression> assemble_expr(ParserStateMachine * p_psm);
|
||||
#endif
|
||||
|
||||
private:
|
||||
/** populate an expression here, may be followed by an operator **/
|
||||
obj<AExpression> lhs_;
|
||||
|
||||
/** infix operator, if supplied **/
|
||||
optype op_type_ = optype::invalid;
|
||||
|
||||
/** populate an expression here, following infix operator */
|
||||
obj<AExpression> rhs_;
|
||||
};
|
||||
} /*namespace scm*/
|
||||
|
||||
#ifndef ppdetail_atomic
|
||||
namespace print {
|
||||
PPDETAIL_ATOMIC(xo::scm::optype);
|
||||
}
|
||||
#endif
|
||||
} /*namespace xo*/
|
||||
|
||||
|
||||
/* end DProgressSsm.hpp */
|
||||
|
|
@ -122,6 +122,9 @@ namespace xo {
|
|||
/** operate state machine for incoming singleassign-token @p tk **/
|
||||
void on_singleassign_token(const Token & tk);
|
||||
|
||||
/** operate state machine for incoming f64-token @p tk **/
|
||||
void on_f64_token(const Token & tk);
|
||||
|
||||
///@}
|
||||
/** @defgroup scm-parserstatemachine-error-entrypoints error entry points **/
|
||||
///@{
|
||||
|
|
|
|||
|
|
@ -67,6 +67,8 @@ public:
|
|||
virtual void on_colon_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) = 0;
|
||||
/** update state machine for incoming singleassign-token @p tk **/
|
||||
virtual void on_singleassign_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) = 0;
|
||||
/** update state machine for incoming f64-token @p tk **/
|
||||
virtual void on_f64_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) = 0;
|
||||
/** update stat machine for incoming parsed symbol @p sym **/
|
||||
virtual void on_parsed_symbol(Opaque data, std::string_view sym, ParserStateMachine * p_psm) = 0;
|
||||
/** operate state machine for incoming type description @p td **/
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DExpectExprSsm.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
/** @file IPrintable_DProgressSsm.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IPrintable_DProgressSsm.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IPrintable_DProgressSsm.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Printable.hpp"
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
|
||||
#include "DProgressSsm.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IPrintable_DProgressSsm; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::print::APrintable,
|
||||
xo::scm::DProgressSsm>
|
||||
{
|
||||
using ImplType = xo::print::IPrintable_Xfer
|
||||
<xo::scm::DProgressSsm,
|
||||
xo::scm::IPrintable_DProgressSsm>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IPrintable_DProgressSsm
|
||||
**/
|
||||
class IPrintable_DProgressSsm {
|
||||
public:
|
||||
/** @defgroup scm-printable-dprogressssm-type-traits **/
|
||||
///@{
|
||||
using ppindentinfo = xo::print::APrintable::ppindentinfo;
|
||||
using Copaque = xo::print::APrintable::Copaque;
|
||||
using Opaque = xo::print::APrintable::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-printable-dprogressssm-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** Pretty-printing support for this object.
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
|
||||
static bool pretty(const DProgressSsm & self, const ppindentinfo & ppii);
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -65,6 +65,7 @@ namespace scm {
|
|||
[[noreturn]] void on_if_token(Opaque, const Token &, ParserStateMachine *) override;
|
||||
[[noreturn]] void on_colon_token(Opaque, const Token &, ParserStateMachine *) override;
|
||||
[[noreturn]] void on_singleassign_token(Opaque, const Token &, ParserStateMachine *) override;
|
||||
[[noreturn]] void on_f64_token(Opaque, const Token &, ParserStateMachine *) override;
|
||||
[[noreturn]] void on_parsed_symbol(Opaque, std::string_view, ParserStateMachine *) override;
|
||||
[[noreturn]] void on_parsed_typedescr(Opaque, TypeDescr, ParserStateMachine *) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ namespace xo {
|
|||
static void on_colon_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming singleassign-token @p tk **/
|
||||
static void on_singleassign_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming f64-token @p tk **/
|
||||
static void on_f64_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update stat machine for incoming parsed symbol @p sym **/
|
||||
static void on_parsed_symbol(DDefineSsm & self, std::string_view sym, ParserStateMachine * p_psm);
|
||||
/** operate state machine for incoming type description @p td **/
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/ISyntaxStateMachine_DExpectExprSsm.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
|
|
@ -64,6 +64,8 @@ namespace xo {
|
|||
static void on_colon_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming singleassign-token @p tk **/
|
||||
static void on_singleassign_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming f64-token @p tk **/
|
||||
static void on_f64_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update stat machine for incoming parsed symbol @p sym **/
|
||||
static void on_parsed_symbol(DExpectExprSsm & self, std::string_view sym, ParserStateMachine * p_psm);
|
||||
/** operate state machine for incoming type description @p td **/
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ namespace xo {
|
|||
static void on_colon_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming singleassign-token @p tk **/
|
||||
static void on_singleassign_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming f64-token @p tk **/
|
||||
static void on_f64_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update stat machine for incoming parsed symbol @p sym **/
|
||||
static void on_parsed_symbol(DExpectSymbolSsm & self, std::string_view sym, ParserStateMachine * p_psm);
|
||||
/** operate state machine for incoming type description @p td **/
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ namespace xo {
|
|||
static void on_colon_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming singleassign-token @p tk **/
|
||||
static void on_singleassign_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming f64-token @p tk **/
|
||||
static void on_f64_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update stat machine for incoming parsed symbol @p sym **/
|
||||
static void on_parsed_symbol(DExpectTypeSsm & self, std::string_view sym, ParserStateMachine * p_psm);
|
||||
/** operate state machine for incoming type description @p td **/
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ namespace xo {
|
|||
static void on_colon_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming singleassign-token @p tk **/
|
||||
static void on_singleassign_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming f64-token @p tk **/
|
||||
static void on_f64_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update stat machine for incoming parsed symbol @p sym **/
|
||||
static void on_parsed_symbol(DExprSeqState & self, std::string_view sym, ParserStateMachine * p_psm);
|
||||
/** operate state machine for incoming type description @p td **/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,79 @@
|
|||
/** @file ISyntaxStateMachine_DProgressSsm.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/ISyntaxStateMachine_DProgressSsm.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/ISyntaxStateMachine_DProgressSsm.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SyntaxStateMachine.hpp"
|
||||
#include "SyntaxStateMachine.hpp"
|
||||
#include "ssm/ISyntaxStateMachine_Xfer.hpp"
|
||||
#include "DProgressSsm.hpp"
|
||||
|
||||
namespace xo { namespace scm { class ISyntaxStateMachine_DProgressSsm; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::scm::ASyntaxStateMachine,
|
||||
xo::scm::DProgressSsm>
|
||||
{
|
||||
using ImplType = xo::scm::ISyntaxStateMachine_Xfer
|
||||
<xo::scm::DProgressSsm,
|
||||
xo::scm::ISyntaxStateMachine_DProgressSsm>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class ISyntaxStateMachine_DProgressSsm
|
||||
**/
|
||||
class ISyntaxStateMachine_DProgressSsm {
|
||||
public:
|
||||
/** @defgroup scm-syntaxstatemachine-dprogressssm-type-traits **/
|
||||
///@{
|
||||
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
|
||||
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
|
||||
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-syntaxstatemachine-dprogressssm-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** identify a type of syntax state machine **/
|
||||
static syntaxstatetype ssm_type(const DProgressSsm & self) noexcept;
|
||||
/** text describing expected/allowed input to this ssm in current state **/
|
||||
static std::string_view get_expect_str(const DProgressSsm & self) noexcept;
|
||||
|
||||
// non-const methods
|
||||
/** operate state machine for incoming symbol-token @p tk **/
|
||||
static void on_symbol_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming define-keyword-token @p tk **/
|
||||
static void on_def_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming if-keyword-token @p tk **/
|
||||
static void on_if_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming colon-token @p tk **/
|
||||
static void on_colon_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming singleassign-token @p tk **/
|
||||
static void on_singleassign_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update state machine for incoming f64-token @p tk **/
|
||||
static void on_f64_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm);
|
||||
/** update stat machine for incoming parsed symbol @p sym **/
|
||||
static void on_parsed_symbol(DProgressSsm & self, std::string_view sym, ParserStateMachine * p_psm);
|
||||
/** operate state machine for incoming type description @p td **/
|
||||
static void on_parsed_typedescr(DProgressSsm & self, TypeDescr td, ParserStateMachine * p_psm);
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -67,6 +67,9 @@ namespace scm {
|
|||
void on_singleassign_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) override {
|
||||
return I::on_singleassign_token(_dcast(data), tk, p_psm);
|
||||
}
|
||||
void on_f64_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) override {
|
||||
return I::on_f64_token(_dcast(data), tk, p_psm);
|
||||
}
|
||||
void on_parsed_symbol(Opaque data, std::string_view sym, ParserStateMachine * p_psm) override {
|
||||
return I::on_parsed_symbol(_dcast(data), sym, p_psm);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,9 @@ public:
|
|||
void on_singleassign_token(const Token & tk, ParserStateMachine * p_psm) {
|
||||
return O::iface()->on_singleassign_token(O::data(), tk, p_psm);
|
||||
}
|
||||
void on_f64_token(const Token & tk, ParserStateMachine * p_psm) {
|
||||
return O::iface()->on_f64_token(O::data(), tk, p_psm);
|
||||
}
|
||||
void on_parsed_symbol(std::string_view sym, ParserStateMachine * p_psm) {
|
||||
return O::iface()->on_parsed_symbol(O::data(), sym, p_psm);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ namespace xo {
|
|||
/** handle define-expression. See @ref DDefineSsm **/
|
||||
defexpr,
|
||||
|
||||
/** rhs expression. state exists to achieve 1-token lookahead **/
|
||||
progress,
|
||||
|
||||
/** comes lasts, counts number of valid enums **/
|
||||
N
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue