Yab to C converter
#31
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.
Reply
#32
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.
Reply
#33
Progress!

Code:
~/Yab2Cpp/runtime> main
2

Hello
world!


3.141593         is pi


9.000000


Nice work.
Reply
#34
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.
Reply
#35
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.
Reply
#36
(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.
Reply
#37
My guess is you are compiling on x86_gcc2 and need to setarch x86 to make it compile properly
Reply
#38
(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.
Reply
#39
Update:  I start my new day job tomorrow.  We'll see how much time I have left to work on this.
Reply
#40
Update:

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


Forum Jump:


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