You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a project that needs to be able to generate mutable AST and of course, prettyprint it to get an output c/c++ code. Last night I came across CppParser and before anything else, thank you for sharing this amazing project. I love the fact that it does not depend on any huge library such as Clang.
I noticed CppWriter is a class to pretty-print AST to c/c++ code which is exactly what I needed.
Now I have to write a builder class to build AST from scratch, meaning that the parser won't be the one putting AST together, but the user will create AST using some limited/simplified builder API.
Basically, my project tries to convert huge computational graphs (which are mixed with symbolic expressions) to AST and from there to c/c++ code.
The core idea is to modify AST on various occasions and finally emit the c/c++ code using CppWriter.
I wrote this to ask for your advice on how to approach this. Given your in-depth insight into the data structures of the AST, do you think it is a good idea to approach the problem this way (i.e. writing an AST builder class)?
Is there any other well-established way to approach this that I am missing? (like some opensource projects or sth)
I would love to have your input on this.
Kind regards,
Saleh
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there,
Hope you are having a good day.
I am working on a project that needs to be able to generate mutable AST and of course, prettyprint it to get an output c/c++ code. Last night I came across CppParser and before anything else, thank you for sharing this amazing project. I love the fact that it does not depend on any huge library such as Clang.
I noticed
CppWriter
is a class to pretty-print AST to c/c++ code which is exactly what I needed.Now I have to write a builder class to build AST from scratch, meaning that the parser won't be the one putting AST together, but the user will create AST using some limited/simplified builder API.
Basically, my project tries to convert huge computational graphs (which are mixed with symbolic expressions) to AST and from there to c/c++ code.
The core idea is to modify AST on various occasions and finally emit the c/c++ code using
CppWriter
.I wrote this to ask for your advice on how to approach this. Given your in-depth insight into the data structures of the AST, do you think it is a good idea to approach the problem this way (i.e. writing an AST builder class)?
Is there any other well-established way to approach this that I am missing? (like some opensource projects or sth)
I would love to have your input on this.
Kind regards,
Saleh
Beta Was this translation helpful? Give feedback.
All reactions