Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Still Spring Break

Sign in to follow this  


BASIC to C++ Compiler

Input BASIC Code:

LET x = 39 * 2
PRINT "Hello, World!", 50+1, x
IF 5+5 > 123 THEN PRINT "Testing"
INPUT x, a, b

Output C++ Code:

//Begin Intro Segment
using namespace std;
int main()
//End Intro Segment
//Begin Variable Segment
int x = 0; int a = 0; int b = 0;
//End Variable Segment
//Begin Generated Code Segment
x = 39 * 2;
cout << "Hello, World!" << 50+1 << x;
if(5+5 > 123){ cout << "Testing";}
cin >> x >> a >> b;
//End Generated Code Segment
return 0;

Sign in to follow this  

1 Comment

Recommended Comments

Hurrah for BASIC. [smile] This looks like an interesting project.

With regard to your last entry on implicit conversions, I agree that implicit narrowing conversions (float to int) and lack of a proper Boolean type aren't great, but I don't see the problem with implicit widening conversions (int to float). I rather like the way C#/.NET handles this, with the ability to declare both implicit and explicit conversion operators.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!