From 4c84f8c198aabcb60c9274865ed7ece1c554c341 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 20 Jan 2026 22:13:01 -0500 Subject: [PATCH] xo-reader2 xo-object2: regenerate facets from idl --- CMakeLists.txt | 2 ++ idl/SyntaxStateMachine.json5 | 9 +++++++++ include/xo/reader2/DDefineSsm.hpp | 6 ++++++ include/xo/reader2/DExpectSymbolSsm.hpp | 6 ++++++ include/xo/reader2/DExprSeqState.hpp | 5 +++++ src/reader2/DDefineSsm.cpp | 9 +++++++++ src/reader2/DExpectSymbolSsm.cpp | 9 +++++++++ src/reader2/DExprSeqState.cpp | 9 +++++++++ 8 files changed, 55 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2ee946b..ac780154 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,6 +110,8 @@ xo_add_genfacetimpl( OUTPUT_CPP_DIR src/reader2 ) +xo_add_genfacet_all(xo-reader2-genfacet-all) + # ---------------------------------------------------------------- # shared library diff --git a/idl/SyntaxStateMachine.json5 b/idl/SyntaxStateMachine.json5 index 28811512..f1b74111 100644 --- a/idl/SyntaxStateMachine.json5 +++ b/idl/SyntaxStateMachine.json5 @@ -70,6 +70,15 @@ {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_parsed_symbol", doc: ["update stat machine for incoming parsed symbol @p sym"], diff --git a/include/xo/reader2/DDefineSsm.hpp b/include/xo/reader2/DDefineSsm.hpp index b8444cbe..468d1a22 100644 --- a/include/xo/reader2/DDefineSsm.hpp +++ b/include/xo/reader2/DDefineSsm.hpp @@ -127,6 +127,12 @@ namespace xo { void on_if_token(const Token & tk, ParserStateMachine * p_psm); + /** update state for this syntax on incoming colon token @p tk, + * overall parser state in @p p_psm + **/ + void on_colon_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 **/ diff --git a/include/xo/reader2/DExpectSymbolSsm.hpp b/include/xo/reader2/DExpectSymbolSsm.hpp index 2ecc556d..1854486e 100644 --- a/include/xo/reader2/DExpectSymbolSsm.hpp +++ b/include/xo/reader2/DExpectSymbolSsm.hpp @@ -69,6 +69,12 @@ namespace xo { void on_if_token(const Token & tk, ParserStateMachine * p_psm); + /** update state for this syntax on incoming colon token @p tk, + * overall parser state in @p p_psm + **/ + void on_colon_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. * diff --git a/include/xo/reader2/DExprSeqState.hpp b/include/xo/reader2/DExprSeqState.hpp index 32eaef0f..90c69c5f 100644 --- a/include/xo/reader2/DExprSeqState.hpp +++ b/include/xo/reader2/DExprSeqState.hpp @@ -79,6 +79,11 @@ namespace xo { **/ void on_if_token(const Token & tk, ParserStateMachine * p_psm); + /** update state for this syntax on incoming colon token @p tk, + * overall parser state in @p p_psm + **/ + void on_colon_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 diff --git a/src/reader2/DDefineSsm.cpp b/src/reader2/DDefineSsm.cpp index c1e3f6a9..13b99028 100644 --- a/src/reader2/DDefineSsm.cpp +++ b/src/reader2/DDefineSsm.cpp @@ -498,6 +498,15 @@ namespace xo { this->get_expect_str()); } + void + DDefineSsm::on_colon_token(const Token & tk, + ParserStateMachine * p_psm) + { + p_psm->illegal_input_on_token("DDefineSsm::on_colon_token", + tk, + this->get_expect_str()); + } + bool DDefineSsm::pretty(const ppindentinfo & ppii) const { diff --git a/src/reader2/DExpectSymbolSsm.cpp b/src/reader2/DExpectSymbolSsm.cpp index c859528f..1eccc454 100644 --- a/src/reader2/DExpectSymbolSsm.cpp +++ b/src/reader2/DExpectSymbolSsm.cpp @@ -95,6 +95,15 @@ namespace xo { this->get_expect_str()); } + void + DExpectSymbolSsm::on_colon_token(const Token & tk, + ParserStateMachine * p_psm) + { + p_psm->illegal_input_on_token("DExpectSymbolSsm::on_colon_token", + tk, + this->get_expect_str()); + } + void DExpectSymbolSsm::on_parsed_symbol(std::string_view sym, ParserStateMachine * p_psm) diff --git a/src/reader2/DExprSeqState.cpp b/src/reader2/DExprSeqState.cpp index e994bbf1..6744c77d 100644 --- a/src/reader2/DExprSeqState.cpp +++ b/src/reader2/DExprSeqState.cpp @@ -160,6 +160,15 @@ namespace xo { } } + void + DExprSeqState::on_colon_token(const Token & tk, + ParserStateMachine * p_psm) + { + p_psm->illegal_input_on_token("DExprSeqState::on_colon_token", + tk, + this->get_expect_str()); + } + void DExprSeqState::on_parsed_symbol(std::string_view sym, ParserStateMachine * p_psm)