xo-reader2: refactor: push token dispatch to satellite SSMs

This commit is contained in:
Roland Conybeare 2026-01-23 19:01:12 -05:00
commit a8df123045
32 changed files with 590 additions and 816 deletions

View file

@ -46,89 +46,8 @@
],
nonconst_methods: [
{
name: "on_symbol_token",
doc: ["operate state machine for incoming symbol-token @p tk"],
return_type: "void",
args: [
{type: "const Token &", name: "tk"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_def_token",
doc: ["update state machine for incoming define-keyword-token @p tk"],
return_type: "void",
args: [
{type: "const Token &", name: "tk"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_if_token",
doc: ["update state machine for incoming if-keyword-token @p tk"],
return_type: "void",
args: [
{type: "const Token &", name: "tk"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_colon_token",
doc: ["update state machine for incoming colon-token @p tk"],
return_type: "void",
args: [
{type: "const Token &", name: "tk"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_singleassign_token",
doc: ["update state machine for incoming singleassign-token @p tk"],
return_type: "void",
args: [
{type: "const Token &", name: "tk"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_f64_token",
doc: ["update state machine for incoming f64-token @p tk"],
return_type: "void",
args: [
{type: "const Token &", name: "tk"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_i64_token",
doc: ["update state machine for incoming i64-token @p tk"],
return_type: "void",
args: [
{type: "const Token &", name: "tk"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_bool_token",
doc: ["update state machine for incoming bool-token @p tk"],
return_type: "void",
args: [
{type: "const Token &", name: "tk"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_string_token",
doc: ["update state machine for incoming string-token @p tk"],
return_type: "void",
args: [
{type: "const Token &", name: "tk"},
{type: "ParserStateMachine *", name: "p_psm"},
],
},
{
name: "on_semicolon_token",
doc: ["update state machine for incoming semicolon-token @p tk"],
name: "on_token",
doc: ["operate state machine for incoming token @p tk"],
return_type: "void",
args: [
{type: "const Token &", name: "tk"},

View file

@ -117,6 +117,12 @@ namespace xo {
**/
std::string_view get_expect_str() const noexcept;
/** operate state machine for this syntax on incoming token @p tk
* with overall parser state in @p p_psm
**/
void on_token(const Token & tk,
ParserStateMachine * p_psm);
/** operate state machine for this syntax on incoming symbol-token @p tk
* with overall parser state in @p p_psm
**/

View file

@ -53,6 +53,12 @@ namespace xo {
**/
std::string_view get_expect_str() const noexcept;
/** operate state machine for this syntax on incoming token @p tk
* with overall parser state in @p p_psm
**/
void on_token(const Token & tk,
ParserStateMachine * p_psm);
/** operate state machine for this syntax on incoming symbol-token @p tk
* with overall parser state in @p p_psm
**/

View file

@ -93,6 +93,12 @@ namespace xo {
void on_parsed_expression_with_semicolon(obj<AExpression> expr,
ParserStateMachine * p_psm);
/** operate state machine for this syntax on incoming token @p tk
* with overall parser state in @p p_psm
**/
void on_token(const Token & tk,
ParserStateMachine * p_psm);
/** update state for this syntax on incoming token @p tk,
* overall parser state in @p p_psm.
**/

View file

@ -47,6 +47,12 @@ namespace xo {
**/
std::string_view get_expect_str() const noexcept;
/** operate state machine for this syntax on incoming token @p tk
* with overall parser state in @p p_psm
**/
void on_token(const Token & tk,
ParserStateMachine * p_psm);
/** operate state machien for this syntax on incoming symbol-token @p tk
* with overall parser state in @p p_psm
**/

View file

@ -65,6 +65,12 @@ namespace xo {
**/
std::string_view get_expect_str() const noexcept;
/** operate state machine for this syntax on incoming token @p tk
* with overall parser state in @p p_psm
**/
void on_token(const Token & tk,
ParserStateMachine * p_psm);
/** operate state machine for this syntax on incoming symbol token @p tk
* with overall parser state in @p p_psm
**/

View file

@ -131,6 +131,12 @@ namespace xo {
/** @defgroup scm-progressssm-ssm-facet syntaxstatemachine facet methods **/
/// @{
/** operate state machine for this syntax on incoming token @p tk
* with overall parser state in @p p_psm
**/
void on_token(const Token & tk,
ParserStateMachine * p_psm);
void on_symbol_token(const Token & tk,
ParserStateMachine * p_psm);
void on_def_token(const Token & tk,

View file

@ -123,36 +123,6 @@ namespace xo {
**/
void on_token(const Token & tk);
/** operate state machine for incoming symbol-token @p tk **/
void on_symbol_token(const Token & tk);
/** operate state machine for incoming define-token @p tk **/
void on_def_token(const Token & tk);
/** operate state machine for incoming if-token @p tk **/
void on_if_token(const Token & tk);
/** operate state machine for incoming colon-token @p tk **/
void on_colon_token(const Token & tk);
/** operate state machine for incoming singleassign-token @p tk **/
void on_singleassign_token(const Token & tk);
/** operate state machine for incoming string-otoken @p tk **/
void on_string_token(const Token & tk);
/** operate state machine for incoming f64-token @p tk **/
void on_f64_token(const Token & tk);
/** operate state machine for incoming i64-token @p tk **/
void on_i64_token(const Token & tk);
/** operate state machine for incoming bool-token @p tk **/
void on_bool_token(const Token & tk);
/** operate state machine for incoming semicolon-token @p tk **/
void on_semicolon_token(const Token & tk);
///@}
/** @defgroup scm-parserstatemachine-error-entrypoints error entry points **/
///@{

View file

@ -57,26 +57,8 @@ public:
virtual std::string_view get_expect_str(Copaque data) const noexcept = 0;
// nonconst methods
/** operate state machine for incoming symbol-token @p tk **/
virtual void on_symbol_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) = 0;
/** update state machine for incoming define-keyword-token @p tk **/
virtual void on_def_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) = 0;
/** update state machine for incoming if-keyword-token @p tk **/
virtual void on_if_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) = 0;
/** update state machine for incoming colon-token @p tk **/
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 state machine for incoming i64-token @p tk **/
virtual void on_i64_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) = 0;
/** update state machine for incoming bool-token @p tk **/
virtual void on_bool_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) = 0;
/** update state machine for incoming string-token @p tk **/
virtual void on_string_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) = 0;
/** update state machine for incoming semicolon-token @p tk **/
virtual void on_semicolon_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) = 0;
/** operate state machine for incoming token @p tk **/
virtual void on_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 **/

View file

@ -60,16 +60,7 @@ namespace scm {
[[noreturn]] std::string_view get_expect_str(Copaque) const noexcept override { _fatal(); }
// nonconst methods
[[noreturn]] void on_symbol_token(Opaque, const Token &, ParserStateMachine *) override;
[[noreturn]] void on_def_token(Opaque, const Token &, ParserStateMachine *) override;
[[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_i64_token(Opaque, const Token &, ParserStateMachine *) override;
[[noreturn]] void on_bool_token(Opaque, const Token &, ParserStateMachine *) override;
[[noreturn]] void on_string_token(Opaque, const Token &, ParserStateMachine *) override;
[[noreturn]] void on_semicolon_token(Opaque, const Token &, ParserStateMachine *) override;
[[noreturn]] void on_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;
[[noreturn]] void on_parsed_expression(Opaque, obj<AExpression>, ParserStateMachine *) override;

View file

@ -54,26 +54,8 @@ namespace xo {
static std::string_view get_expect_str(const DDefineSsm & self) noexcept;
// non-const methods
/** operate state machine for incoming symbol-token @p tk **/
static void on_symbol_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming define-keyword-token @p tk **/
static void on_def_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming if-keyword-token @p tk **/
static void on_if_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming colon-token @p tk **/
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 state machine for incoming i64-token @p tk **/
static void on_i64_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming bool-token @p tk **/
static void on_bool_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming string-token @p tk **/
static void on_string_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming semicolon-token @p tk **/
static void on_semicolon_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** operate state machine for incoming token @p tk **/
static void on_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 **/

View file

@ -54,26 +54,8 @@ namespace xo {
static std::string_view get_expect_str(const DExpectExprSsm & self) noexcept;
// non-const methods
/** operate state machine for incoming symbol-token @p tk **/
static void on_symbol_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming define-keyword-token @p tk **/
static void on_def_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming if-keyword-token @p tk **/
static void on_if_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming colon-token @p tk **/
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 state machine for incoming i64-token @p tk **/
static void on_i64_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming bool-token @p tk **/
static void on_bool_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming string-token @p tk **/
static void on_string_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming semicolon-token @p tk **/
static void on_semicolon_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** operate state machine for incoming token @p tk **/
static void on_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 **/

View file

@ -54,26 +54,8 @@ namespace xo {
static std::string_view get_expect_str(const DExpectSymbolSsm & self) noexcept;
// non-const methods
/** operate state machine for incoming symbol-token @p tk **/
static void on_symbol_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming define-keyword-token @p tk **/
static void on_def_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming if-keyword-token @p tk **/
static void on_if_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming colon-token @p tk **/
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 state machine for incoming i64-token @p tk **/
static void on_i64_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming bool-token @p tk **/
static void on_bool_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming string-token @p tk **/
static void on_string_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming semicolon-token @p tk **/
static void on_semicolon_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** operate state machine for incoming token @p tk **/
static void on_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 **/

View file

@ -54,26 +54,8 @@ namespace xo {
static std::string_view get_expect_str(const DExpectTypeSsm & self) noexcept;
// non-const methods
/** operate state machine for incoming symbol-token @p tk **/
static void on_symbol_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming define-keyword-token @p tk **/
static void on_def_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming if-keyword-token @p tk **/
static void on_if_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming colon-token @p tk **/
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 state machine for incoming i64-token @p tk **/
static void on_i64_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming bool-token @p tk **/
static void on_bool_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming string-token @p tk **/
static void on_string_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming semicolon-token @p tk **/
static void on_semicolon_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** operate state machine for incoming token @p tk **/
static void on_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 **/

View file

@ -54,26 +54,8 @@ namespace xo {
static std::string_view get_expect_str(const DExprSeqState & self) noexcept;
// non-const methods
/** operate state machine for incoming symbol-token @p tk **/
static void on_symbol_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming define-keyword-token @p tk **/
static void on_def_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming if-keyword-token @p tk **/
static void on_if_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming colon-token @p tk **/
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 state machine for incoming i64-token @p tk **/
static void on_i64_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming bool-token @p tk **/
static void on_bool_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming string-token @p tk **/
static void on_string_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming semicolon-token @p tk **/
static void on_semicolon_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm);
/** operate state machine for incoming token @p tk **/
static void on_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 **/

View file

@ -54,26 +54,8 @@ namespace xo {
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 state machine for incoming i64-token @p tk **/
static void on_i64_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming bool-token @p tk **/
static void on_bool_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming string-token @p tk **/
static void on_string_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for incoming semicolon-token @p tk **/
static void on_semicolon_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm);
/** operate state machine for incoming token @p tk **/
static void on_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 **/

View file

@ -52,35 +52,8 @@ namespace scm {
}
// non-const methods
void on_symbol_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) override {
return I::on_symbol_token(_dcast(data), tk, p_psm);
}
void on_def_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) override {
return I::on_def_token(_dcast(data), tk, p_psm);
}
void on_if_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) override {
return I::on_if_token(_dcast(data), tk, p_psm);
}
void on_colon_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) override {
return I::on_colon_token(_dcast(data), tk, p_psm);
}
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_i64_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) override {
return I::on_i64_token(_dcast(data), tk, p_psm);
}
void on_bool_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) override {
return I::on_bool_token(_dcast(data), tk, p_psm);
}
void on_string_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) override {
return I::on_string_token(_dcast(data), tk, p_psm);
}
void on_semicolon_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) override {
return I::on_semicolon_token(_dcast(data), tk, p_psm);
void on_token(Opaque data, const Token & tk, ParserStateMachine * p_psm) override {
return I::on_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);

View file

@ -56,35 +56,8 @@ public:
}
// non-const methods (still const in router!)
void on_symbol_token(const Token & tk, ParserStateMachine * p_psm) {
return O::iface()->on_symbol_token(O::data(), tk, p_psm);
}
void on_def_token(const Token & tk, ParserStateMachine * p_psm) {
return O::iface()->on_def_token(O::data(), tk, p_psm);
}
void on_if_token(const Token & tk, ParserStateMachine * p_psm) {
return O::iface()->on_if_token(O::data(), tk, p_psm);
}
void on_colon_token(const Token & tk, ParserStateMachine * p_psm) {
return O::iface()->on_colon_token(O::data(), tk, p_psm);
}
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_i64_token(const Token & tk, ParserStateMachine * p_psm) {
return O::iface()->on_i64_token(O::data(), tk, p_psm);
}
void on_bool_token(const Token & tk, ParserStateMachine * p_psm) {
return O::iface()->on_bool_token(O::data(), tk, p_psm);
}
void on_string_token(const Token & tk, ParserStateMachine * p_psm) {
return O::iface()->on_string_token(O::data(), tk, p_psm);
}
void on_semicolon_token(const Token & tk, ParserStateMachine * p_psm) {
return O::iface()->on_semicolon_token(O::data(), tk, p_psm);
void on_token(const Token & tk, ParserStateMachine * p_psm) {
return O::iface()->on_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);

View file

@ -369,7 +369,9 @@ namespace xo {
= with_facet<ASyntaxStateMachine>::mkobj(define_ssm);
p_psm->push_ssm(ssm);
p_psm->on_def_token(Token::def_token());
// note: triggers poly dispatch
p_psm->on_token(Token::def_token());
}
syntaxstatetype
@ -489,6 +491,92 @@ namespace xo {
this->get_expect_str());
}
void
DDefineSsm::on_token(const Token & tk,
ParserStateMachine * p_psm)
{
scope log(XO_DEBUG(p_psm->debug_flag()), xtag("tk", tk));
switch (tk.tk_type()) {
case tokentype::tk_symbol:
this->on_symbol_token(tk, p_psm);
break;
case tokentype::tk_def:
this->on_def_token(tk, p_psm);
break;
case tokentype::tk_if:
this->on_if_token(tk, p_psm);
break;
case tokentype::tk_colon:
this->on_colon_token(tk, p_psm);
break;
case tokentype::tk_singleassign:
this->on_singleassign_token(tk, p_psm);
break;
case tokentype::tk_string:
this->on_string_token(tk, p_psm);
break;
case tokentype::tk_f64:
this->on_f64_token(tk, p_psm);
break;
case tokentype::tk_i64:
this->on_i64_token(tk, p_psm);
break;
case tokentype::tk_bool:
this->on_bool_token(tk, p_psm);
break;
case tokentype::tk_semicolon:
this->on_semicolon_token(tk, p_psm);
break;
// all the not-yet handled cases
case tokentype::tk_invalid:
case tokentype::tk_leftparen:
case tokentype::tk_rightparen:
case tokentype::tk_leftbracket:
case tokentype::tk_rightbracket:
case tokentype::tk_leftbrace:
case tokentype::tk_rightbrace:
case tokentype::tk_leftangle:
case tokentype::tk_rightangle:
case tokentype::tk_lessequal:
case tokentype::tk_greatequal:
case tokentype::tk_dot:
case tokentype::tk_comma:
case tokentype::tk_doublecolon:
case tokentype::tk_assign:
case tokentype::tk_yields:
case tokentype::tk_plus:
case tokentype::tk_minus:
case tokentype::tk_star:
case tokentype::tk_slash:
case tokentype::tk_cmpeq:
case tokentype::tk_cmpne:
case tokentype::tk_type:
case tokentype::tk_lambda:
case tokentype::tk_then:
case tokentype::tk_else:
case tokentype::tk_let:
case tokentype::tk_in:
case tokentype::tk_end:
case tokentype::N:
break;
}
p_psm->illegal_input_on_token("DDefineSsm::on_token",
tk,
this->get_expect_str());
}
void
DDefineSsm::on_symbol_token(const Token & tk,
ParserStateMachine * p_psm)

View file

@ -102,6 +102,92 @@ namespace xo {
}
}
void
DExpectExprSsm::on_token(const Token & tk,
ParserStateMachine * p_psm)
{
scope log(XO_DEBUG(p_psm->debug_flag()), xtag("tk", tk));
switch (tk.tk_type()) {
case tokentype::tk_symbol:
this->on_symbol_token(tk, p_psm);
break;
case tokentype::tk_def:
this->on_def_token(tk, p_psm);
break;
case tokentype::tk_if:
this->on_if_token(tk, p_psm);
break;
case tokentype::tk_colon:
this->on_colon_token(tk, p_psm);
break;
case tokentype::tk_singleassign:
this->on_singleassign_token(tk, p_psm);
break;
case tokentype::tk_string:
this->on_string_token(tk, p_psm);
break;
case tokentype::tk_f64:
this->on_f64_token(tk, p_psm);
break;
case tokentype::tk_i64:
this->on_i64_token(tk, p_psm);
break;
case tokentype::tk_bool:
this->on_bool_token(tk, p_psm);
break;
case tokentype::tk_semicolon:
this->on_semicolon_token(tk, p_psm);
break;
// all the not-yet handled cases
case tokentype::tk_invalid:
case tokentype::tk_leftparen:
case tokentype::tk_rightparen:
case tokentype::tk_leftbracket:
case tokentype::tk_rightbracket:
case tokentype::tk_leftbrace:
case tokentype::tk_rightbrace:
case tokentype::tk_leftangle:
case tokentype::tk_rightangle:
case tokentype::tk_lessequal:
case tokentype::tk_greatequal:
case tokentype::tk_dot:
case tokentype::tk_comma:
case tokentype::tk_doublecolon:
case tokentype::tk_assign:
case tokentype::tk_yields:
case tokentype::tk_plus:
case tokentype::tk_minus:
case tokentype::tk_star:
case tokentype::tk_slash:
case tokentype::tk_cmpeq:
case tokentype::tk_cmpne:
case tokentype::tk_type:
case tokentype::tk_lambda:
case tokentype::tk_then:
case tokentype::tk_else:
case tokentype::tk_let:
case tokentype::tk_in:
case tokentype::tk_end:
case tokentype::N:
break;
}
p_psm->illegal_input_on_token("DExpectExprSsm::on_token",
tk,
this->get_expect_str());
}
void
DExpectExprSsm::on_symbol_token(const Token & tk,
ParserStateMachine * p_psm)

View file

@ -92,6 +92,92 @@ namespace xo {
this->get_expect_str());
}
void
DExpectSymbolSsm::on_token(const Token & tk,
ParserStateMachine * p_psm)
{
scope log(XO_DEBUG(p_psm->debug_flag()), xtag("tk", tk));
switch (tk.tk_type()) {
case tokentype::tk_symbol:
this->on_symbol_token(tk, p_psm);
break;
case tokentype::tk_def:
this->on_def_token(tk, p_psm);
break;
case tokentype::tk_if:
this->on_if_token(tk, p_psm);
break;
case tokentype::tk_colon:
this->on_colon_token(tk, p_psm);
break;
case tokentype::tk_singleassign:
this->on_singleassign_token(tk, p_psm);
break;
case tokentype::tk_string:
this->on_string_token(tk, p_psm);
break;
case tokentype::tk_f64:
this->on_f64_token(tk, p_psm);
break;
case tokentype::tk_i64:
this->on_i64_token(tk, p_psm);
break;
case tokentype::tk_bool:
this->on_bool_token(tk, p_psm);
break;
case tokentype::tk_semicolon:
this->on_semicolon_token(tk, p_psm);
break;
// all the not-yet handled cases
case tokentype::tk_invalid:
case tokentype::tk_leftparen:
case tokentype::tk_rightparen:
case tokentype::tk_leftbracket:
case tokentype::tk_rightbracket:
case tokentype::tk_leftbrace:
case tokentype::tk_rightbrace:
case tokentype::tk_leftangle:
case tokentype::tk_rightangle:
case tokentype::tk_lessequal:
case tokentype::tk_greatequal:
case tokentype::tk_dot:
case tokentype::tk_comma:
case tokentype::tk_doublecolon:
case tokentype::tk_assign:
case tokentype::tk_yields:
case tokentype::tk_plus:
case tokentype::tk_minus:
case tokentype::tk_star:
case tokentype::tk_slash:
case tokentype::tk_cmpeq:
case tokentype::tk_cmpne:
case tokentype::tk_type:
case tokentype::tk_lambda:
case tokentype::tk_then:
case tokentype::tk_else:
case tokentype::tk_let:
case tokentype::tk_in:
case tokentype::tk_end:
case tokentype::N:
break;
}
p_psm->illegal_input_on_token("DExpectSymbolSsm::on_token",
tk,
this->get_expect_str());
}
void
DExpectSymbolSsm::on_symbol_token(const Token & tk,
ParserStateMachine * p_psm)

View file

@ -56,6 +56,92 @@ namespace xo {
return "typename";
}
void
DExpectTypeSsm::on_token(const Token & tk,
ParserStateMachine * p_psm)
{
scope log(XO_DEBUG(p_psm->debug_flag()), xtag("tk", tk));
switch (tk.tk_type()) {
case tokentype::tk_symbol:
this->on_symbol_token(tk, p_psm);
break;
case tokentype::tk_def:
this->on_def_token(tk, p_psm);
break;
case tokentype::tk_if:
this->on_if_token(tk, p_psm);
break;
case tokentype::tk_colon:
this->on_colon_token(tk, p_psm);
break;
case tokentype::tk_singleassign:
this->on_singleassign_token(tk, p_psm);
break;
case tokentype::tk_string:
this->on_string_token(tk, p_psm);
break;
case tokentype::tk_f64:
this->on_f64_token(tk, p_psm);
break;
case tokentype::tk_i64:
this->on_i64_token(tk, p_psm);
break;
case tokentype::tk_bool:
this->on_bool_token(tk, p_psm);
break;
case tokentype::tk_semicolon:
this->on_semicolon_token(tk, p_psm);
break;
// all the not-yet handled cases
case tokentype::tk_invalid:
case tokentype::tk_leftparen:
case tokentype::tk_rightparen:
case tokentype::tk_leftbracket:
case tokentype::tk_rightbracket:
case tokentype::tk_leftbrace:
case tokentype::tk_rightbrace:
case tokentype::tk_leftangle:
case tokentype::tk_rightangle:
case tokentype::tk_lessequal:
case tokentype::tk_greatequal:
case tokentype::tk_dot:
case tokentype::tk_comma:
case tokentype::tk_doublecolon:
case tokentype::tk_assign:
case tokentype::tk_yields:
case tokentype::tk_plus:
case tokentype::tk_minus:
case tokentype::tk_star:
case tokentype::tk_slash:
case tokentype::tk_cmpeq:
case tokentype::tk_cmpne:
case tokentype::tk_type:
case tokentype::tk_lambda:
case tokentype::tk_then:
case tokentype::tk_else:
case tokentype::tk_let:
case tokentype::tk_in:
case tokentype::tk_end:
case tokentype::N:
break;
}
p_psm->illegal_input_on_token("DExpectTypeSsm::on_token",
tk,
this->get_expect_str());
}
void
DExpectTypeSsm::on_def_token(const Token & tk,
ParserStateMachine * p_psm)

View file

@ -105,6 +105,92 @@ namespace xo {
return "impossible-DExprSeqState::get_expr_str";
}
void
DExprSeqState::on_token(const Token & tk,
ParserStateMachine * p_psm)
{
scope log(XO_DEBUG(p_psm->debug_flag()), xtag("tk", tk));
switch (tk.tk_type()) {
case tokentype::tk_symbol:
this->on_symbol_token(tk, p_psm);
break;
case tokentype::tk_def:
this->on_def_token(tk, p_psm);
break;
case tokentype::tk_if:
this->on_if_token(tk, p_psm);
break;
case tokentype::tk_colon:
this->on_colon_token(tk, p_psm);
break;
case tokentype::tk_singleassign:
this->on_singleassign_token(tk, p_psm);
break;
case tokentype::tk_string:
this->on_string_token(tk, p_psm);
break;
case tokentype::tk_f64:
this->on_f64_token(tk, p_psm);
break;
case tokentype::tk_i64:
this->on_i64_token(tk, p_psm);
break;
case tokentype::tk_bool:
this->on_bool_token(tk, p_psm);
break;
case tokentype::tk_semicolon:
this->on_semicolon_token(tk, p_psm);
break;
// all the not-yet handled cases
case tokentype::tk_invalid:
case tokentype::tk_leftparen:
case tokentype::tk_rightparen:
case tokentype::tk_leftbracket:
case tokentype::tk_rightbracket:
case tokentype::tk_leftbrace:
case tokentype::tk_rightbrace:
case tokentype::tk_leftangle:
case tokentype::tk_rightangle:
case tokentype::tk_lessequal:
case tokentype::tk_greatequal:
case tokentype::tk_dot:
case tokentype::tk_comma:
case tokentype::tk_doublecolon:
case tokentype::tk_assign:
case tokentype::tk_yields:
case tokentype::tk_plus:
case tokentype::tk_minus:
case tokentype::tk_star:
case tokentype::tk_slash:
case tokentype::tk_cmpeq:
case tokentype::tk_cmpne:
case tokentype::tk_type:
case tokentype::tk_lambda:
case tokentype::tk_then:
case tokentype::tk_else:
case tokentype::tk_let:
case tokentype::tk_in:
case tokentype::tk_end:
case tokentype::N:
break;
}
p_psm->illegal_input_on_token("DExprSeqState::on_token",
tk,
this->get_expect_str());
}
void
DExprSeqState::on_symbol_token(const Token & tk,
ParserStateMachine * p_psm)

View file

@ -158,6 +158,92 @@ namespace xo {
}
}
void
DProgressSsm::on_token(const Token & tk,
ParserStateMachine * p_psm)
{
scope log(XO_DEBUG(p_psm->debug_flag()), xtag("tk", tk));
switch (tk.tk_type()) {
case tokentype::tk_symbol:
this->on_symbol_token(tk, p_psm);
break;
case tokentype::tk_def:
this->on_def_token(tk, p_psm);
break;
case tokentype::tk_if:
this->on_if_token(tk, p_psm);
break;
case tokentype::tk_colon:
this->on_colon_token(tk, p_psm);
break;
case tokentype::tk_singleassign:
this->on_singleassign_token(tk, p_psm);
break;
case tokentype::tk_string:
this->on_string_token(tk, p_psm);
break;
case tokentype::tk_f64:
this->on_f64_token(tk, p_psm);
break;
case tokentype::tk_i64:
this->on_i64_token(tk, p_psm);
break;
case tokentype::tk_bool:
this->on_bool_token(tk, p_psm);
break;
case tokentype::tk_semicolon:
this->on_semicolon_token(tk, p_psm);
break;
// all the not-yet handled cases
case tokentype::tk_invalid:
case tokentype::tk_leftparen:
case tokentype::tk_rightparen:
case tokentype::tk_leftbracket:
case tokentype::tk_rightbracket:
case tokentype::tk_leftbrace:
case tokentype::tk_rightbrace:
case tokentype::tk_leftangle:
case tokentype::tk_rightangle:
case tokentype::tk_lessequal:
case tokentype::tk_greatequal:
case tokentype::tk_dot:
case tokentype::tk_comma:
case tokentype::tk_doublecolon:
case tokentype::tk_assign:
case tokentype::tk_yields:
case tokentype::tk_plus:
case tokentype::tk_minus:
case tokentype::tk_star:
case tokentype::tk_slash:
case tokentype::tk_cmpeq:
case tokentype::tk_cmpne:
case tokentype::tk_type:
case tokentype::tk_lambda:
case tokentype::tk_then:
case tokentype::tk_else:
case tokentype::tk_let:
case tokentype::tk_in:
case tokentype::tk_end:
case tokentype::N:
break;
}
p_psm->illegal_input_on_token("DProgressSsm::on_token",
tk,
this->get_expect_str());
}
void
DProgressSsm::on_symbol_token(const Token & tk,
ParserStateMachine * p_psm)

View file

@ -35,61 +35,7 @@ ISyntaxStateMachine_Any::_valid
// nonconst methods
auto
ISyntaxStateMachine_Any::on_symbol_token(Opaque, const Token &, ParserStateMachine *) -> void
{
_fatal();
}
auto
ISyntaxStateMachine_Any::on_def_token(Opaque, const Token &, ParserStateMachine *) -> void
{
_fatal();
}
auto
ISyntaxStateMachine_Any::on_if_token(Opaque, const Token &, ParserStateMachine *) -> void
{
_fatal();
}
auto
ISyntaxStateMachine_Any::on_colon_token(Opaque, const Token &, ParserStateMachine *) -> void
{
_fatal();
}
auto
ISyntaxStateMachine_Any::on_singleassign_token(Opaque, const Token &, ParserStateMachine *) -> void
{
_fatal();
}
auto
ISyntaxStateMachine_Any::on_f64_token(Opaque, const Token &, ParserStateMachine *) -> void
{
_fatal();
}
auto
ISyntaxStateMachine_Any::on_i64_token(Opaque, const Token &, ParserStateMachine *) -> void
{
_fatal();
}
auto
ISyntaxStateMachine_Any::on_bool_token(Opaque, const Token &, ParserStateMachine *) -> void
{
_fatal();
}
auto
ISyntaxStateMachine_Any::on_string_token(Opaque, const Token &, ParserStateMachine *) -> void
{
_fatal();
}
auto
ISyntaxStateMachine_Any::on_semicolon_token(Opaque, const Token &, ParserStateMachine *) -> void
ISyntaxStateMachine_Any::on_token(Opaque, const Token &, ParserStateMachine *) -> void
{
_fatal();
}

View file

@ -28,54 +28,9 @@ namespace xo {
}
auto
ISyntaxStateMachine_DDefineSsm::on_symbol_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
ISyntaxStateMachine_DDefineSsm::on_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_symbol_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DDefineSsm::on_def_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_def_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DDefineSsm::on_if_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_if_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DDefineSsm::on_colon_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_colon_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DDefineSsm::on_singleassign_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_singleassign_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DDefineSsm::on_f64_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_f64_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DDefineSsm::on_i64_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_i64_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DDefineSsm::on_bool_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_bool_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DDefineSsm::on_string_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_string_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DDefineSsm::on_semicolon_token(DDefineSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_semicolon_token(tk, p_psm);
self.on_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DDefineSsm::on_parsed_symbol(DDefineSsm & self, std::string_view sym, ParserStateMachine * p_psm) -> void

View file

@ -28,54 +28,9 @@ namespace xo {
}
auto
ISyntaxStateMachine_DExpectExprSsm::on_symbol_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
ISyntaxStateMachine_DExpectExprSsm::on_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_symbol_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectExprSsm::on_def_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_def_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectExprSsm::on_if_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_if_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectExprSsm::on_colon_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_colon_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectExprSsm::on_singleassign_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_singleassign_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectExprSsm::on_f64_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_f64_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectExprSsm::on_i64_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_i64_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectExprSsm::on_bool_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_bool_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectExprSsm::on_string_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_string_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectExprSsm::on_semicolon_token(DExpectExprSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_semicolon_token(tk, p_psm);
self.on_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectExprSsm::on_parsed_symbol(DExpectExprSsm & self, std::string_view sym, ParserStateMachine * p_psm) -> void

View file

@ -28,54 +28,9 @@ namespace xo {
}
auto
ISyntaxStateMachine_DExpectSymbolSsm::on_symbol_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
ISyntaxStateMachine_DExpectSymbolSsm::on_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_symbol_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectSymbolSsm::on_def_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_def_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectSymbolSsm::on_if_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_if_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectSymbolSsm::on_colon_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_colon_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectSymbolSsm::on_singleassign_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_singleassign_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectSymbolSsm::on_f64_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_f64_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectSymbolSsm::on_i64_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_i64_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectSymbolSsm::on_bool_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_bool_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectSymbolSsm::on_string_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_string_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectSymbolSsm::on_semicolon_token(DExpectSymbolSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_semicolon_token(tk, p_psm);
self.on_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectSymbolSsm::on_parsed_symbol(DExpectSymbolSsm & self, std::string_view sym, ParserStateMachine * p_psm) -> void

View file

@ -28,54 +28,9 @@ namespace xo {
}
auto
ISyntaxStateMachine_DExpectTypeSsm::on_symbol_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
ISyntaxStateMachine_DExpectTypeSsm::on_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_symbol_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectTypeSsm::on_def_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_def_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectTypeSsm::on_if_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_if_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectTypeSsm::on_colon_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_colon_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectTypeSsm::on_singleassign_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_singleassign_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectTypeSsm::on_f64_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_f64_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectTypeSsm::on_i64_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_i64_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectTypeSsm::on_bool_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_bool_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectTypeSsm::on_string_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_string_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectTypeSsm::on_semicolon_token(DExpectTypeSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_semicolon_token(tk, p_psm);
self.on_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExpectTypeSsm::on_parsed_symbol(DExpectTypeSsm & self, std::string_view sym, ParserStateMachine * p_psm) -> void

View file

@ -28,54 +28,9 @@ namespace xo {
}
auto
ISyntaxStateMachine_DExprSeqState::on_symbol_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm) -> void
ISyntaxStateMachine_DExprSeqState::on_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_symbol_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExprSeqState::on_def_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_def_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExprSeqState::on_if_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_if_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExprSeqState::on_colon_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_colon_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExprSeqState::on_singleassign_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_singleassign_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExprSeqState::on_f64_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_f64_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExprSeqState::on_i64_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_i64_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExprSeqState::on_bool_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_bool_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExprSeqState::on_string_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_string_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExprSeqState::on_semicolon_token(DExprSeqState & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_semicolon_token(tk, p_psm);
self.on_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DExprSeqState::on_parsed_symbol(DExprSeqState & self, std::string_view sym, ParserStateMachine * p_psm) -> void

View file

@ -28,54 +28,9 @@ namespace xo {
}
auto
ISyntaxStateMachine_DProgressSsm::on_symbol_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
ISyntaxStateMachine_DProgressSsm::on_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_symbol_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DProgressSsm::on_def_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_def_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DProgressSsm::on_if_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_if_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DProgressSsm::on_colon_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_colon_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DProgressSsm::on_singleassign_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_singleassign_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DProgressSsm::on_f64_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_f64_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DProgressSsm::on_i64_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_i64_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DProgressSsm::on_bool_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_bool_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DProgressSsm::on_string_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_string_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DProgressSsm::on_semicolon_token(DProgressSsm & self, const Token & tk, ParserStateMachine * p_psm) -> void
{
self.on_semicolon_token(tk, p_psm);
self.on_token(tk, p_psm);
}
auto
ISyntaxStateMachine_DProgressSsm::on_parsed_symbol(DProgressSsm & self, std::string_view sym, ParserStateMachine * p_psm) -> void

View file

@ -162,163 +162,7 @@ namespace xo {
));
}
switch (tk.tk_type()) {
case tokentype::tk_symbol:
this->on_symbol_token(tk);
break;
case tokentype::tk_def:
this->on_def_token(tk);
break;
case tokentype::tk_if:
this->on_if_token(tk);
break;
case tokentype::tk_colon:
this->on_colon_token(tk);
break;
case tokentype::tk_singleassign:
this->on_singleassign_token(tk);
break;
case tokentype::tk_string:
this->on_string_token(tk);
break;
case tokentype::tk_f64:
this->on_f64_token(tk);
break;
case tokentype::tk_i64:
this->on_i64_token(tk);
break;
case tokentype::tk_bool:
this->on_bool_token(tk);
break;
case tokentype::tk_semicolon:
this->on_semicolon_token(tk);
break;
// all the not-yet handled cases
case tokentype::tk_invalid:
case tokentype::tk_leftparen:
case tokentype::tk_rightparen:
case tokentype::tk_leftbracket:
case tokentype::tk_rightbracket:
case tokentype::tk_leftbrace:
case tokentype::tk_rightbrace:
case tokentype::tk_leftangle:
case tokentype::tk_rightangle:
case tokentype::tk_lessequal:
case tokentype::tk_greatequal:
case tokentype::tk_dot:
case tokentype::tk_comma:
case tokentype::tk_doublecolon:
case tokentype::tk_assign:
case tokentype::tk_yields:
case tokentype::tk_plus:
case tokentype::tk_minus:
case tokentype::tk_star:
case tokentype::tk_slash:
case tokentype::tk_cmpeq:
case tokentype::tk_cmpne:
case tokentype::tk_type:
case tokentype::tk_lambda:
case tokentype::tk_then:
case tokentype::tk_else:
case tokentype::tk_let:
case tokentype::tk_in:
case tokentype::tk_end:
case tokentype::N:
throw std::runtime_error(tostr("ParserStateMachin::on_token:",
"NOT IMPLEMENTED",
xtag("token", tk)));
}
}
void
ParserStateMachine::on_symbol_token(const Token & tk)
{
scope log(XO_DEBUG(debug_flag_), xtag("tk", tk));
stack_->top().on_symbol_token(tk, this);
}
void
ParserStateMachine::on_def_token(const Token & tk)
{
scope log(XO_DEBUG(debug_flag_), xtag("tk", tk));
stack_->top().on_def_token(tk, this);
}
void
ParserStateMachine::on_if_token(const Token & tk)
{
scope log(XO_DEBUG(debug_flag_), xtag("tk", tk));
stack_->top().on_if_token(tk, this);
}
void
ParserStateMachine::on_colon_token(const Token & tk)
{
scope log(XO_DEBUG(debug_flag_), xtag("tk", tk));
stack_->top().on_colon_token(tk, this);
}
void
ParserStateMachine::on_singleassign_token(const Token & tk)
{
scope log(XO_DEBUG(debug_flag_), xtag("tk", tk));
stack_->top().on_singleassign_token(tk, this);
}
void
ParserStateMachine::on_string_token(const Token & tk)
{
scope log(XO_DEBUG(debug_flag_), xtag("tk", tk));
stack_->top().on_string_token(tk, this);
}
void
ParserStateMachine::on_f64_token(const Token & tk)
{
scope log(XO_DEBUG(debug_flag_), xtag("tk", tk));
stack_->top().on_f64_token(tk, this);
}
void
ParserStateMachine::on_i64_token(const Token & tk)
{
scope log(XO_DEBUG(debug_flag_), xtag("tk", tk));
stack_->top().on_i64_token(tk, this);
}
void
ParserStateMachine::on_bool_token(const Token & tk)
{
scope log(XO_DEBUG(debug_flag_), xtag("tk", tk));
stack_->top().on_bool_token(tk, this);
}
void
ParserStateMachine::on_semicolon_token(const Token & tk)
{
scope log(XO_DEBUG(debug_flag_), xtag("tk", tk));
stack_->top().on_semicolon_token(tk, this);
stack_->top().on_token(tk, this);
}
void