Conversation
… format - DslFilterGraph<In, Out> builds, type-checks and runs named-edge DSL graphs: fan-out copies, fan-in merges with holes for dropped paths, drop propagation and dead ends; GraphOutputs for keyed multi-output graphs and Void for sink-only graphs - MergeFilter / registerMergeFilter for fan-in stages - validateDslGraph and GraphError report every build problem with line:column - lexy parser: located, descriptive syntax errors identical to the hand-written parser, real term columns, decimals, escapes and '#' in strings - both parsers: one syntax error per statement, no follow-on errors; checks for malformed numbers, empty fan-in groups and unterminated strings - toMermaid: generated node ids, output labels and stage arguments - README, EXAMPLE.md and apps/textPipeline lead with the DSL; the JSON format stays supported
… hand-written parser - dsl::parseGraphProgram (and so DslFilterGraph and validateDslGraph) now runs on the lexy-based parser, which moved into GraphLang.hpp; results and diagnostics are unchanged - the hand-written tokenizer/parser moved to GraphLangHandwritten.hpp as [[deprecated]] dsl::parseGraphProgramHandwritten, to be removed later - GraphLangLexy.hpp keeps parseGraphProgramLexy as an alias - parity tests compare the lexy parser against the deprecated one
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Until now the text DSL could only be parsed, validated and drawn; running a runtime graph still required JSON. This PR makes the DSL executable and the primary way to describe runtime graphs. The JSON format stays fully supported.
Changes
Running DSL graphs
DslFilterGraph<In, Out>(DslFilterGraph.hpp) builds, type-checks and runs named-edge DSL graphs, and is itself aMessageFilter, so it can be nested or registered as a stage.std::nullopt) skips everything downstream.endare discarded.out),GraphOutputs(several, optionally keyed outputs of different types) orVoid(sink-only).MergeFilter/registerMergeFilterprovide fan-in stages for(a, b) -> Merge, using the same combiner signature asJoinFilter.Voidmisuse, and the output shape. All problems are thrown together in oneGraphErrorwithline:column;validateDslGraph<In, Out>(text)returns them without throwing.Parser
dsl::parseGraphProgramnow uses the lexy-based parser, which moved intoGraphLang.hpp.1:17: expected '->' but found 'Print'. Previously the lexy path reported every problem as "syntax error" at column 1.(), and unterminated strings, which no longer swallow the following lines.#inside strings.GraphLangHandwritten.hppas[[deprecated]] dsl::parseGraphProgramHandwritten. Tests check it against the lexy parser for identical output and diagnostics.parseGraphProgramLexyremains as an alias.{}instead ofnull, matching JSON stages without"config".toMermaiduses generated node ids (no clashes withendor internal$outedges), labels outputs and lists stage arguments.Docs and example
apps/textPipelinelead with the DSL: tap, merge, named outputs, diagnostics, and the same pipeline in JSON.ABbranch line was missing.Testing
windows-msvc-debug-developer-modepreset (ASan,/W4): 55/55 tests pass, no compiler warnings; thetextPipelineoutput matches EXAMPLE.md.GraphOutputs,Voidgraphs, nesting, every build-time check, and parser diagnostics: 20 malformed inputs with exact expected messages, run through both parsers.linux-gcc.Notes
GraphLang.hpp(and thereforeDslFilterGraph.hpp) now includes lexy. Consumers of the CMake target are unaffected, since lexy is an external include there. Projects adding lexy's headers as a regular include path at/W4will see MSVC warning C4310 from inside lexy.key=valuepairs; nested objects and lists are not expressible yet.