|
Post by Tom Mulgrew on Nov 21, 2009 21:05:27 GMT -5
...Is available from the downloads page.
Cheers, -Tom
|
|
|
Post by DJLinux on Nov 22, 2009 19:19:10 GMT -5
i build the CommandLine compiler with VS6 and the SimpleCompiler too
if any will build the SimpleCompiler the include file Main.cpp is out of date use this as "Main.cpp"
#include "TomComp.h" #include <cstdlib> #include <iostream>
using namespace std;
// Test program char buffer [1024];
// Simple "print" function
void WrapPrint (TomVM& vm) {
// Regular print cout << vm.GetStringParam (1).c_str (); }
void WrapPrintr (TomVM& vm) {
// Print with newline cout << vm.GetStringParam (1).c_str () << endl; }
class DummyVMDebugger : public IVMDebugger { public: virtual int UserBreakPtCount(); virtual int UserBreakPtLine(int index); };
int DummyVMDebugger::UserBreakPtCount() { return 0; }
int DummyVMDebugger::UserBreakPtLine(int index) { return 0; }
int main (void) {
cout << "TomBasicCore BASIC compiler and virtual machine (C) Tom Mulgrew 2003-2004" << endl; cout << "Enter Basic program then hit Ctrl+Z (On Windows)"<< endl; cout << "Or pipe a text file into stdin" << endl;
// Create compiler and virtual machine // Allocate objects PluginDLLManager plugins("", true); DummyVMDebugger debugger;
TomVM vm(plugins, debugger); TomBasicCompiler comp (vm,plugins);
// Register function wrappers comp.AddFunction ("print", WrapPrint, compParamTypeList () << VTP_STRING, false, false, VTP_INT); comp.AddFunction ("printr", WrapPrintr, compParamTypeList () << VTP_STRING, false, false, VTP_INT);
// Read source from cin cin.getline (buffer, 1023); while (!cin.fail ()) { comp.Parser ().SourceCode ().push_back (buffer); cin.getline (buffer, 1023); };
// Compile program comp.ClearError (); comp.Compile (); if (comp.Error ()) { cout << endl << "COMPILE ERROR!: " << comp.GetError ().c_str () << endl; return 0; }
// Run program vm.Reset (); do {
// Execute 1000 VM op-codes (maximum) vm.Continue (1000);
} while (!(vm.Error () || vm.Done ()));
// Check for virtual machine error if (vm.Error ()) cout << endl << "RUNTIME ERROR!: " << vm.GetError ().c_str () << endl; else cout << endl << "Done!" << endl;
system("PAUSE"); return 0; }; HelloWorld.bat need this file "HelloWorld.gb" printr("Hello World!")
Joshy
|
|
|
Post by Empyrion Martyr on Apr 7, 2010 22:04:48 GMT -5
What compilers can we use to compiler the source?
What version of MingW for example? I have been having issues with compiling even this simple sample (after tedious work, it still fails to Link properly).
Maybe it's my installation of mingw.
|
|
|
Post by shadow008 on Sept 19, 2010 20:03:34 GMT -5
... is not at the downloads page and i cant find it on source forge.... I decided to go forward w/ my plan of converting b4gl to c++ for speed(cuz i need it) and i could really use the source code right now.
|
|
|
Post by shadow008 on Sept 28, 2010 10:45:00 GMT -5
so.....
anyone?
|
|
|
Post by angros47 on Sept 28, 2010 12:48:28 GMT -5
I decided to go forward w/ my plan of converting b4gl to c++ for speed(cuz i need it) and i could really use the source code right now. Why don't you use FreeBasic ( www.freebasic.net)? It's closer to Basic4gl than C/C++, and has almost the same speed of C.
|
|
|
Post by matthew on Sept 28, 2010 15:04:38 GMT -5
I thought that I would have had the source somewhere on my computer but I don't think I downloaded the newest version. Has anyone seen New Basic4GL on SourceForge here? It looks like tom has been updating the SVN repository over the past few days. ;D
|
|
|
Post by shadow008 on Sept 28, 2010 20:32:54 GMT -5
I decided to go forward w/ my plan of converting b4gl to c++ for speed(cuz i need it) and i could really use the source code right now. Why don't you use FreeBasic ( www.freebasic.net)? It's closer to Basic4gl than C/C++, and has almost the same speed of C. Personal prefrences. I dont mind the vastly different syntax, and I kinda wanna learn C++ in the near future (right now). Not that im giving up on B4gl (hell no, too awesome), but I'm trying my hand at a new language, and after coding in b4gl for a few years, C++ looks SOOOOOOOO much easier and i understand so much more of it then from my other attempts. And i thought i had it on my computer at one time... but i guess it got deleted somehow @_@
|
|
|
Post by chris857 on Sept 28, 2010 21:00:23 GMT -5
I downloaded it in July, and I put it up on my google site today: v2.5.8 source
|
|
|
Post by Wayne Rayner on Sept 29, 2010 1:32:58 GMT -5
what is contained on the newbasic4GL source forge site is basically Basic4GL that will be using wxWidgets as far as I know. However I have no clue how to compile basic4GL.
|
|
|
Post by shadow008 on Sept 29, 2010 11:00:25 GMT -5
Mostly, im just interested in everything EXCEPT the opengl part of the source code, such as the text functions, trig/matrices functions, sprite library, ect...
Just curious, could just use the functions that have the word "wrap" in front of them directly in my program and get the same results? Thats what it seems like.
Well... im working on it...
|
|
|
Post by Darkjester on Oct 3, 2010 17:02:16 GMT -5
how can you access all the source as a whole?
|
|
|
Post by matthew on Oct 4, 2010 5:19:34 GMT -5
@chris thanks for uploading the source  @dj if you mean the code on sourceforge, currently I don't think you can 
|
|
|
Post by Tom Mulgrew on Oct 4, 2010 5:56:45 GMT -5
Just so you know, I've updated the downloads page with the v2.5.8 source.
The sourceforge version is still a lot of work before it will be functional. I'm trying to replace the Borland VCL based GUI with wxWidgets. I've got a basic shell working, but there's a lot missing (debugging, syntax highlighting, options, create standalone). I'm also working on moving the OpenGL commands into a separate plugin which is taking a while. So not a lot to look at just yet.
Should be worth it in the long run though, and it would make a Linux port a lot more doable.
-Tom
|
|
|
Post by matthew on Oct 4, 2010 6:07:32 GMT -5
Does this mean the new Windows version of Basic4GL is being developed with MinGW? 
|
|