Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive WIT (WebAssembly Interface Types) code generator tool that parses WIT files using ANTLR4 grammar and generates C++ host function bindings. The tool integrates with the existing cmcpp library to provide type-safe WebAssembly Component Model integration.
Key changes:
- Adds ANTLR4-based WIT grammar parser with comprehensive test suite (95+ official WIT test files)
- Implements
wit-codegentool that generates C++ bindings from WIT interface definitions - Enhances WAMR sample with generated code and helper functions for simplified host application development
Reviewed Changes
Copilot reviewed 40 out of 44 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vcpkg.json | Adds antlr4 dependency for grammar parsing |
| tools/wit-codegen/wit-codegen.cpp | Main WIT code generator implementation using ANTLR visitor pattern |
| grammar/Wit.g4 | Complete ANTLR grammar for WebAssembly Interface Types specification |
| test/test_grammar.cpp | Test suite validating grammar against 95+ official WIT files |
| include/wamr.hpp | Enhanced with helper functions for context creation and memory management |
| samples/wamr/ | Updated sample demonstrating generated bindings usage |
| CMakeLists.txt | Adds packaging configuration and version information |
ed9695f to
186b100
Compare
Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
186b100 to
3cf7915
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15 +/- ##
==========================================
+ Coverage 84.08% 84.11% +0.03%
==========================================
Files 19 19
Lines 1445 1448 +3
Branches 129 129
==========================================
+ Hits 1215 1218 +3
Misses 140 140
Partials 90 90 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
No description provided.