-
Notifications
You must be signed in to change notification settings - Fork 165
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
Option to not use new
in C++
#293
Comments
I am not proficient enough in C++ to attempt an implementation, but PRs are welcome! |
I don't know that much about the tools BNFC uses to generate C++ code, but I'll do my best. |
BNFC does not use a lot of tools; it simply prints concrete syntax, maybe with the help of the |
Makefiles for C++ backend have |
Well, if there is an option
then this option would output a So, short answer: yes. |
I would like to do this issue if I have time... |
Great! A first step could be to write up an example how the product should look like (e.g. by modifying some BNFC-generated C++ output). I cannot help here much since I am not an active C++ programmer. Once the design is complete, it should not be hard to get it into BNFC. I can help with the Haskell part, if needed. |
I created a PR. Clone pattern for std::shared_ptr in C++ following part will be changed. Prog *Prog::clone() const
{
return new Prog(*this);
} |
@andreasabel I created second pull-request at #410 EDIT: |
…yet)" This reverts commit d06ef0a.
…yet)" This reverts commit d06ef0a.
…yet)" This reverts commit d06ef0a.
@andreasabel Hi, I updated PR again. |
@andreasabel If additional function is not necessary, or it can not be maintained. Anyway, I wish to close or merge that. |
I would love it if there was an option on BNFC to parse into either a
std::shared_ptr
/std::unique_ptr
or to stack allocate classes because it's been a chore to track down everything that's been parsed and properlydelete
it.The text was updated successfully, but these errors were encountered: