-
Notifications
You must be signed in to change notification settings - Fork 13
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
Exampel Header generator #9
Comments
@jb090979 Please consider my experiments on code generation, build on top of it, or build your own stuff. It's jinja2 based. Sorry I have not looked into this upstream repo in a while. (I had to fork to make some quick changes when I implemented it.) I hope in any case that we can together build some interest around various code generation tools based on this Franca parser (and jinja). |
@gunnarx https://github.com/jb090979/pyfranca/tree/dev_jb This branch contains the following changes
So maybe you take a look on my branch. Without zayfod I can not push my changes upstream. But I would prever that we work on the same code base. A few questions to you generator: |
Basically I realize there's a lot to do to make this to the CommonAPI level. It now just produces skeleton code, not really organized for proper use. (For one thing, a separate server and client code is not even being created. I guess it's basically a skeleton for a server at this point). The extent to which I had the time to complete it, it was mostly done for two purposes:
Thanks a lot for pointing out your fork - I'm not working actively on this at the moment but I will monitor it, and we can keep in touch on any improvements. |
thats fine. In particular for point 2 I add the structured comment support to pyfranca. So you are able to render the structured comments in the fidl file as Doxygen comment in cpp. So in pyfranca class ast each member got a field "comments" this is an ordered dict with the franca metatags as keys and the corrsponding test as value. My render function looks like : def render_comments(comments, tag, with_brief=False, with_comment_sign=False, with_intro=False, add_spaces=""):
|
some advises: your generator process one fidl file after another. I start the same way but if you consider the import directive it could be that you import multiple packages while processing one fidl file. An Example: file1.fidl imports file2.fidl you start your generator with Now you will process the packages in file2.fidl 2 times. It is may better to process all input files in pyfranca processor in a first step and in a second one render all packages. pyfrance has no problem to process packages twice. It detects that a package is already process and skip further processing. Anyway you use my fork. In zayfod latest version there is a bug. :-) |
Yeah I knew I had an issue with includes, and other things. Thanks for the suggestions. My code is still messy, and the limitations are also not well documented. Awesome that you have parsing of comments. A long standing desire is to have better Franca to Documentation generation, and comments are of course critical for that. Doxygen was just an easy way, but I would try generating for example Markdown (or similar) and processing that with Jekyll, Sphinx/ReadTheDocs, AsciiDoc, (or similar) to easily get attractive documentation. |
I keep track on your generator. If you have questions or you want to request a pyfranca feature please let me know. May I can help you. |
OK. @jb090979 originally I was seeing this as out of scope of It seems to me that both of you have been working in the same direction and what remains are implementation details. Is this correct?
|
yes correct. |
The original franca project provide an example HppGenerator.
https://github.com/franca/franca/blob/master/examples/org.franca.examples.basic/src/org/franca/examples/basic/generators/ExampleHppGenerator.xtend
I think for all pyfranca users would it be usefull to have an example code generator.
What do you think about this idea?
I can create one if you like. My idea is to create a simple C++ header file using jinja2 as template library.
The text was updated successfully, but these errors were encountered: