Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Yab to C converter
10-06-2018, 04:53 AM
Post: #1
Brick Yab to C converter
I know a technique to write a Basic compiler using C or C++ as a backend. Currently the stand-alone executable codes from Yab appear to just link an interpreter to a zipped copy of the source and I think I can do better.

Since BASIC isn't fully structured it'll have to be written using a Switch command in a While loop to act as a state machine. Also, to implement declaration of variables on-the-fly, it will have to be a pass-and-a-half compiler. That's a fancy way to say the compiler will have to write to a header file or so at the same time as the C source that includes it using its preprocessor.

Is there interest? My goal is to have some code written to serve as an example for another BASIC compiler I want to write. I may need help with the Haiku runtimes.
Find all posts by this user
Quote this message in a reply
10-07-2018, 01:42 AM
Post: #2
RE: Yab to C converter
To work well with the Haiku GUI, one would have to incorporate some c++ to make the appropriate calls. The yab source code could be used as an example as yab uses c and c is ueed to cal c++ wrappers to call Haiku GUI elements.

Fat Elk Sortware
Visit this user's website Find all posts by this user
Quote this message in a reply
10-11-2018, 03:08 PM
Post: #3
RE: Yab to C converter
Thanks for your reply! I'll see what I can do.
Find all posts by this user
Quote this message in a reply
10-22-2018, 06:32 AM
Post: #4
RE: Yab to C converter
After looking at the YABASIC parser source, I am not quite familiar with Flex and Bison so I may have to start my YAB transpiler some other time after I have finished the Kitten transpiler for running AmosPro on AmigaOne PowerPC.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Free Web Hosting