Qbasicnews.com

Full Version: QB vs C++
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Quote:This compiler phase seems to be dwindling already - trying to write a qb compiler teaches you that BASIC syntax is easy on the programmer and hard on the compiler, and gives you an appreciation for the simplicity (especially from the compiler's perspective) of C. But I'm not going to give up.

If you sat down an penned out the entire grammar for QB and then used tools such as flex and bison, you could have a working parser/lexer in less than a weeks work, this would also remove the necessity of splitting up the if-then-else and colon separated statements because they would just get tokenised along with the rest of the input. Then you can spend most of your time coding the interesting stuff such as type checking and code generation.
I hate bison and flex. It can be done without them, and it's not that hard.
Anyways, I'm working on a project that kinda requires my attention right now. The first group project that has ever really worked out for me. And I'm doing a script compiler - easier, but it still outputs to asm, and it could easily be modified to spit out real asm.

Good luck with your projects.
C++ and its OOP is superb! I have worked hard enough with QB to feel its limitations. Forget speed, pointers in C++ make it atleast a million times better than QB. :wink:
Pointers are not OOP :roll: references are, but C++ uses pointers...
That's why C++ is so odd Big Grin
Quote:Pointers are not OOP :roll: references are, but C++ uses pointers...
That's why C++ is so odd Big Grin
You can use both.. C++ is a party and everybody is invited Big Grin
Pages: 1 2 3