yab | yet another Basic for HAIKU
Yab to C converter - Printable Version

+- yab | yet another Basic for HAIKU (https://yab.orgfree.com/forum)
+-- Forum: General discussion (https://yab.orgfree.com/forum/forumdisplay.php?fid=8)
+--- Forum: yab stuff (https://yab.orgfree.com/forum/forumdisplay.php?fid=10)
+--- Thread: Yab to C converter (/showthread.php?tid=118)

Pages: 1 2 3 4 5


RE: Yab to C converter - SamuraiCrow - 04-12-2021

Update:  I just added a fourth scope setting for parameters being passed in to functions.  Global, local, static local and now parameter are the four scopes.  Hopefully juggling more scopes doesn't become necessary.  Now to find another segfault cause on shut down.


RE: Yab to C converter - SamuraiCrow - 04-16-2021

Update: The segfault is still there but several bugs about parameter passing and subroutine definitions and calls are now fixed. The segfault happens when deallocating a temporary Float variable when the compiler quits.


RE: Yab to C converter - bbjimmy - 04-17-2021

Progress!

Code:
~/Yab2Cpp/runtime> main
2

Hello
world!


3.141593         is pi


9.000000


Nice work.


RE: Yab to C converter - SamuraiCrow - 04-21-2021

Thanks! I finally found the cause of the seg-fault.  The temporary variable was being deallocated twice, thus creating an alias of itself in the recycling queue and therefore, being double-freed at shutdown as well.


RE: Yab to C converter - SamuraiCrow - 04-30-2021

Update: I've added a test using a For...Next loop. It seems to generate the correct code but when compiled with GCC 10 under Linux it goes into an unexpected infinite loop.


RE: Yab to C converter - lorglas - 04-30-2021

(04-30-2021, 04:44 AM)SamuraiCrow Wrote: Update:  I've added a test using a For...Next loop.  It seems to generate the correct code but when compiled with GCC 10 under Linux it goes into an unexpected infinite loop.
If i want to make it, i get following message.
make
g++ -c -Wall -std=c++11 -fno-rtti -fno-exceptions -Os yabCodeStructures.cpp -o build/yabCodeStructures.o
In file included from /boot/home/Desktop/expand/Yab2Cpp-master/yabCodeStructures.cpp:9:
/boot/home/Desktop/expand/Yab2Cpp-master/yab2cpp.h:14: unordered_map: No such file or directory
Makefile:38: recipe for target 'build/yabCodeStructures.o' failed
make: *** [build/yabCodeStructures.o] Error 1

how to solve this.


RE: Yab to C converter - bbjimmy - 05-01-2021

My guess is you are compiling on x86_gcc2 and need to setarch x86 to make it compile properly


RE: Yab to C converter - SamuraiCrow - 05-01-2021

(05-01-2021, 09:58 AM)bbjimmy Wrote: My guess is you are compiling on x86_gcc2 and need to setarch x86 to make it compile properly
Correct.  It requires GCC 6 or newer.


RE: Yab to C converter - SamuraiCrow - 05-05-2021

Update:  I start my new day job tomorrow.  We'll see how much time I have left to work on this.


RE: Yab to C converter - SamuraiCrow - 06-28-2022

Update:

Fixed longstanding bugs with multiple call sites referring to the same function and missing curly braces on conditional branch.


Free Web Hosting