Skip to content

Conversation

@hpdekoning
Copy link
Member

@hpdekoning hpdekoning commented Dec 4, 2025

Create a BNF Extractor tool that can extract the BNF snippets from the KerML textual notation EBNF grammar and from the SysML textual notation EBNF and graphical notation GBNF grammars, and convert it to two target formats:

  • Plain text file, suitable for machine processing by an EBNF or GBNF parser.
  • Simple HTML file, that supports easy browsing and navigation for human readers, with hyperlinks from usages of all grammar elements to their declaration.

The adapted tool should be added under tool-support .


A new folder bnf_grammar_tools has been created under tool-support, with two new Python command line tools: bnf_grammar_processor and bnf_file_parser. In addition to the standard Python modules, three other open source packages have been used, that are all licensed under the MIT License:

  • Package beautifulsoup4 used to parse the HTML input files.
  • Package lark, a parser toolkit written in python, is used to parse and verify the extracted BNF source.
  • Package pytest is used to run python unit tests.

The README.adoc in subdirectory bnf_grammar_tools contains a full description on how to install and use the tools. A workflow to extract, validate and correct BNF grammars has been added.

In terms of data used for testing, under further subdirectory tests/KerML_and_SysML_spec_sources the raw HTML files that were exported from the release 2025-04 versions of the KerML and SysML specs in View Editor are stored. They have been used to test the correctness of the implementation. Also, subdirectory tests/KerML_and_SysML_grammars contains a complete set of all input files and generated output and log files. These illustrate how the tools can be used and how errors in the respective BNF grammars are detected and reported, and can be inspected for review. Also, BNF grammars before and after manual corrections can be compared, using a diff tool, to systematically compile mistakes to be raised as OMG RTF issues.

hpdekoning and others added 30 commits June 21, 2025 18:32
…rML EBNF and SysML EBNF & GBNF grammars in .txt and .html formats
… images (copied from Graphical-Specification-WG repo)
…nf_file_parser tool, that now completely implement the workflow described in the README documentation
@hpdekoning hpdekoning self-assigned this Dec 4, 2025
@seidewitz seidewitz added this to the 2025-12 milestone Dec 11, 2025
@seidewitz seidewitz assigned seidewitz and unassigned hpdekoning Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants