Naming Phase #835
Replies: 4 comments 7 replies
-
Open Question: |
Beta Was this translation helpful? Give feedback.
-
We may need to delay some of our parsed structure-building 🤔 If we want to handle naming after parsing, that means we don't know which items refer to what until after naming. Whilst this makes sense for our generation, for our parsing phase it's actually pretty stupid and annoying. So what if we instead parse lists of QObjects, Signals, etc., all individually, then combine them together after parsing & naming (potentially for Generation only?). This seems to be pretty much what CXX does as well from reading their source code. |
Beta Was this translation helpful? Give feedback.
-
I think we need to step back and think overall what all the phases are to get from the input macro, to the generated C++ and rewritten Rust code. What we need to achieve this is
At the moment we have parser (finding, removing, partial determining names) -> generator (partial determining names, creating new / passthrough) -> writer (combining). With the current phases we have the following problems
|
Beta Was this translation helpful? Give feedback.
-
We also need to consider how we wanted to flatten the generation potentially ? Eg instead of having things in a tree instead consider each This would work well for the Rust side where things are blocks and for the C++ source side. The hard part is the C++ header side where the class definition cannot ( ? ) be split up and needs methods under a common class with the correct ordering of forward declares etc. |
Beta Was this translation helpful? Give feedback.
-
As already discussed in #572 (comment) , we're thinking of adding a naming phase to CXX-Qt.
This phase would come after parsing and is responsible of generating appropriate names for everything.
Requirements we'd need for the generated data:
#[namespace]
,#[cxx_name]
and#[rust_name]
.This Discussion serves as a place to brainstorm and document the design of this naming phase.
Beta Was this translation helpful? Give feedback.
All reactions