Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalise attributes and metadata the parsing phase and add support for missing CXX attributes #665

Closed
ahayzen-kdab opened this issue Aug 18, 2023 · 1 comment
Labels
🤔 discussion Feedback welcome ⬆️ feature New feature or request 👷 refactor Something needs to change

Comments

@ahayzen-kdab
Copy link
Collaborator

If we split the parser and generator phase to have a naming phase (as discussed in #572 (comment) )

An extension would be to make the parser phase like a tree, with each node having "metadata" (such as namespace, cxx_name, rust_name). This would then allow all types and blocks to have metadata tagged onto them as currently not all types or blocks support all the attributes.

Also being able to go from a leaf node to it's parent would be useful for the generation phase. As currently we have to pass in items such as the module_ident into the generation methods. When instead it could climb the tree until it finds the module. This would then allow each generation method to just take one node as a parameter. Which then could lead to the generation being written as a trait on the parser objects, eg GeneratedCpp -> TryFrom -> ParsedInvokable.

Consider this as part of a refactor of the parser phase.

@ahayzen-kdab ahayzen-kdab added ⬆️ feature New feature or request 🤔 discussion Feedback welcome 👷 refactor Something needs to change labels Aug 18, 2023
@LeonMatthesKDAB
Copy link
Collaborator

This is probably superseded by #937

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 discussion Feedback welcome ⬆️ feature New feature or request 👷 refactor Something needs to change
Projects
None yet
Development

No branches or pull requests

2 participants