Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit/AppGameKit Studio Showcase / [WIP] BASIC2AGKTier2 - A Basic Language to Tier 2 C++ Translator (No A direct converter but Close)

Author
Message
Dark Raven
10
Years of Service
User Offline
Joined: 27th Jul 2014
Location: United States
Posted: 6th May 2018 22:04
BASIC2AGKTier2 - Basic language to C++ Translator.

Just so everyone know this language is very close to c++ meaning alot things operate in a way of c++ does things. The language does allow classes and other Object Oriented programming.

Things to know before running:
1) This is not a straight out of the box tier to tier converter. It won't take agc files and convert them to c++.
2) The basic language that is used is similar to tier 1 code that it is very easy to port tier 1 code over to this
language with some tweaking. Much of the differences are some syntax difference and mainly variable declaration and arrays.
See include demo project based on code from this forum.
3) Basic2AGKTier2 does use third party software as a backend much like gcc is used for some programming languages compilers.
The main backend is a program called BC9Basic. This is a basic to c++ translator for windows gui and console development.
I use it as I didn't want to reinvent the wheel. It works great but the code generated needed work on to make it compatible with
Tier 2 libraries so I create Basic2AGKTier2 to do that. So in theory the generated cpp file (unfortunately currently will generate a single cpp file)
can be used on any tier2 compatible Platform though development is done on windows.
The other back end file is a c++ source beautifier called Astyle. Both programs are open source released under MIT license. See the About window in the program.
4) Documentation is limited. I've included a Guide.pdf which walks through the Basic2AGKTier2 interface. There is also a help file for the backend translator. Just
ignore the windows gui and console specifics and you will get an understanding of the language.
5) This is a hobby program so it originally was created for personal use and is just releasing in case other would like to mess with it. Because of this, Not sure how
rapid update if any will come. It seems to work find. I'll try to update with new AppGameKit Functions when Appgamekit updates but can't guarantee this. Sorry.
6) For any real use of the program you will need to have purchased Appgamekit and downloaded and installed the tier 2 library files from the tier 1 editor. Make sure everything is in a writable location.
Basic2AGKTier2 will work without this but you won't be able to do anything with the generated c++ code as Basic2AGKTier2 doesn't currently have a build system
and building your Tier2 will be the same as if you were doing work in C++ directly. So read the guide on the appgamekit site.
7) Also there is no guarentee that this will work for everyone and no guarentee that the generated cpp file will not need to be tweaked after generation because of possible errors the c++ compiler will find
that the translator doesn't. This is just a starting point and if you program the basic code good this will limit that amount of tweaking.

Hope you enjoy.

Michael
Dark Raven Studios Kansas City
https://studio.dark-raven.net

Attachments

Login to view attachments
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 7th May 2018 06:05 Edited at: 7th May 2018 06:06
Sounds like a solid strategy and great to see someone tackle this!

I wonder if now you could treat your custom BASIC as an intermediate step / target and write a full translator for converting AGK2 BASIC into the custom BASIC and then what you have already would convert that over to tier 2?
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)

Login to post a reply

Server time is: 2024-11-23 11:46:22
Your offset time is: 2024-11-23 11:46:22