PDA

View Full Version : BC9 Basic (from jcfuller)



ErosOlmi
20-01-2013, 14:39
James C. Fuller (thinBasic forum member jcfuller) is the developer of BC9 project, a spin off of BCX project.

BC9 is a source code basic to c translator.
Recently James has found an house for his project. You can find here: http://bc9basic.99k.org/index.html

You can download BC9 and see if this project can help your development.
Downloads contains full BC9 source code.
If I'm not wrong BC9 is developed using BC9 itself, translated into cpp and compiled with MinGW gcc/g++

Thanks a lot James for this project.

Just in case someone is interested into BC9 project, I've created thin forum area where to place posts about BC9:

Forum (http://www.thinbasic.com/community/forum.php)

Community Discussion (http://www.thinbasic.com/community/forumdisplay.php?190-Community-Discussion)

General (http://www.thinbasic.com/community/forumdisplay.php?218-General)

Other languages (http://www.thinbasic.com/community/forumdisplay.php?291-Other-languages)

bc9 Basic (from jcfuller)





Ciao
Eros

jcfuller
21-01-2013, 12:14
Eros,
Thank you for your support. Yes you are correct bc9 is developed using bc9.

James

jcfuller
03-10-2013, 16:05
bc9Basic has been updated to ver 9.1.6.4
http://bc9.bcxbasic.com/
See the October 03 News item

James

jcfuller
22-02-2016, 21:22
New bc9Basic release.
This is just the translator.
You will also need the latest bc9Adp2 package if you don't have it.
Update your bc9Adp2 package with the new translator.


added Pelle's C Forum Moderator frankie's changes to replace the Variadic Macros in the CreateArr function.
These changes were made to allow for DYNAMIC arrays in a 64 bit compiled program and for
dependent functions such as REDIM and DSPLIT to function as expected in a 64 bit compiled
program.


https://sourceforge.net/projects/bc9basic/files/bc9Basic/bc9_9241.zip/download


James

anne wilson
31-10-2016, 17:20
Hi James

I would like to get more resources and knowledge about BC9Basic . Where can we get it? as you have stated
that the website bcxbasic.com has already lapsed, there is no other resource that we could find more stuff
on this BC9Basic

Also can BC9Basic convert PowerBasic source codes to c++ ?

We need a 64bit compiler which PowerBasic do not have (as of now) so the only way is to
translate it to c++

After this translation, what would be the best c++ compiler can we use to compile the resultant c++ code ?

Thanks

Anne

José Roca
31-10-2016, 19:22
You can contact him in mi forum

http://www.jose.it-berater.org/smfforum/index.php?board=436.0

kcvinu
07-11-2016, 18:57
@Eros,
You said --->
If I'm not wrong BC9 is developed using BC9 itself, translated into cpp and compiled with MinGW gcc/g++
<-----

I have a doubt. Forgive me if it is a silly one. How did one can create something with that thing ?. If BC9 is not created yet, then how can i use it to create itself ?

ErosOlmi
07-11-2016, 21:28
The very first version of the translator from Basic to C can be created with any language.
Once your translator add all needed minimum functionality to your BASIC language (especially string handling and file handling, ...), you can use your BASIC language to recreate the first translator in BASIC language and convert to C.
From that point you will use your BASIC language as translate to C even to maintain your translator.

jcfuller
08-11-2016, 16:33
A bit late to the party but....

It is a three part translate/compile process.
It can get tricky adding new features with chicken/egg syndrome.
This three step compile process is necessary to ensure that any changes in the internal runtime code are fully incorporated. If there are errors in that runtime code that affect the translator, they will not show until the third compile.


For the first compile you need to use an older version.
For now I use version 9.1.3.1 for the first translation
Translate/compile
You now have a new bc9.exe
You then translate compile with the new bc9.exe
And Repeat once again.


James

kcvinu
08-11-2016, 20:03
@jcfuller,
Thanks for the info. With lot of interest, i tried to translate an example code in bc9. It was partially succeeded. It translate basic code to C but it can't compile c code to an exe. I am using TDM-GCC-32 compiler. This is my MingW Path =C:\TDM-GCC-32\bin
This is BCEdit's output shows.
==============================================
:\bc9Adp2\bc9 -ne "Alert.bas"
bc9Basic: BASIC to C/C++ Translator
bc9Basic Version 9.2.3.5 (2015/09/28)
[Lines In: 50] [Lines Out: 307] [Statements: 43] [Time: 0.06 sec's]
bc9Basic translated "Alert.bas" to "Alert.c" For a C Compiler
Shelling to ASTYLE.EXE
Formatted E:\2014 Softwares\BC9 - Code Translator\bc9Adp2_9235_1007\bc9Adp2\examples\Gui_Demos\Alert\Alert.c
InsertOptArg Ver 1.04 an Optional Parameter fixup for the gcc Compiler
Compiling "Alert.c" to a 32bit "Windows Gui App" Using the TDM-GCC Distro
Alert.c:32:46: fatal error: urlmon.h: No such file or directory
compilation terminated.
Finished!
Shelling Out To: TDMGCC.BAT "Alert" -m32 gui

Make done
==========================================
I then copied urlmon.h to project folder. Then it shows to other files are missing. msxml.h and winapifamily.h. I copied those two files and run again. Then it shows a hundreds of errors like type is not declared bla bla bla.
Now C file is ok. What to do for this problem ?

jcfuller
08-11-2016, 21:43
Do you have the "MinGW Windows Release" selected in the drop down combo at the top right?

James

kcvinu
08-11-2016, 22:37
@jcfuller,
Yes.
This is my final output -
This is not complete. I can't post the full output because text size is bigger.

C:\bc9Adp2\bc9 -ne "Alert.bas"
bc9Basic: BASIC to C/C++ Translator
bc9Basic Version 9.2.3.5 (2015/09/28)
[Lines In: 50] [Lines Out: 307] [Statements: 43] [Time: 0.05 sec's]
bc9Basic translated "Alert.bas" to "Alert.c" For a C Compiler
Shelling to ASTYLE.EXE
Formatted E:\2014 Softwares\BC9 - Code Translator\bc9Adp2_9235_1007\bc9Adp2\examples\Gui_Demos\Alert\Alert.c
InsertOptArg Ver 1.04 an Optional Parameter fixup for the gcc Compiler
Compiling "Alert.c" to a 32bit "Windows Gui App" Using the TDM-GCC Distro
In file included from ./urlmon.h:425:0,
from Alert.c:32:
./msxml.h:460:13: error: unknown type name '_COM_Outptr_'
_COM_Outptr_ void **ppvObject);
^
./msxml.h:489:13: error: unknown type name '_In_'
_In_ DISPID dispIdMember,
^
./msxml.h:491:13: error: unknown type name '_In_'
_In_ REFIID riid,
^

jcfuller
09-11-2016, 00:12
No idea without seeing the basic source. Sorry.

James

kcvinu
09-11-2016, 08:20
Basic source is the example file named Alert.bas in "C:\bc9Adp2\examples\Gui_Demos\Alert\Alert.bas". I think you have this file.

jcfuller
09-11-2016, 11:52
Duh.. Sorry about that.
I just downloaded the 9.2.3.5 package from Sourceforge and tested with MinGW-TDM. I only have the 64bit version but I compiled for 32bit.
All was fine. I would guess issues with your MinGW install or ??? What OS are you using?I do not have a 32bit OS .

James

kcvinu
09-11-2016, 13:58
@jcfuler,
I am using Windows 8 32 bit.