Yab to C converter
#11
The extension .yab is only used for convenience. There is no requirement to have an extension on a yab script and any filename is acceptable for s script, bound or built program.
Reply
#12
After looking at the documentation for the latest version of Bison, I see it can generate C++ code directly so the need to update the interpreter is not so desperate. I'll put the bulk of my efforts into the transpiler first.
Reply
#13
The core is taking shape.  I think I just passed 1500 lines of code.  https://github.com/SamuraiCrow/Yab2Cpp
Reply
#14
This is looking good. Any hint on how to compile it, or is there a make file?
Reply
#15
(03-14-2021, 08:35 AM)bbjimmy Wrote: This is looking good. Any hint on how to compile it, or is there a make file?
I'm just roughing in a first-draft for now.  Once I finish the function and variable support frameworks, maybe the print statement also, I'll start testing without the parser just to see if it generates executable code.  I can try to make a makefile pretty soon and then the bug-hunting can commence!  The last time I programmed in C++ was before C++11 was out and shared_ptr, "auto" to declare iterators and unordered_map have me spoiled!
Reply
#16
Well it compiles to object code now. Getting it to link is going to be tricky and will take serious organizational skills.
Reply
#17
(03-18-2021, 08:04 AM)SamuraiCrow Wrote: Well it compiles to object code now.  Getting it to link is going to be tricky and will take serious organizational skills.
Yay object files!
Reply
#18
Added a bunch of static initializers and now it builds and links! Now I need to finish the arrays and print statements so I can do test cases.
Reply
#19
I had to make a link in /boot/home/config/non-packaged/bin called clang++ linking to /boot/system/develop/tools/bin/g++ to get it to build.
Reply
#20
(03-20-2021, 08:59 AM)bbjimmy Wrote: I had to make a link in /boot/home/config/non-packaged/bin called clang++ linking to /boot/system/develop/tools/bin/g++ to get it to build.
I've now fixed the Makefile so that it'll build on GCC.  I was using LLVM's Clang compiler because it gave better error messages.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)
Free Web Hosting