Thread: Basic To C++ Converter

  1. #1
    Unregistered
    Guest

    Exclamation Basic To C++ Converter

    I am attempting to make a BASIC to C++ converter... The name should say it all, but for you people who dont understand; it takes a .BAS file (BASIC) and re-writes the code to a .CPP file (C++); Now the program doesnt just copy one file to another, it converts the sorce to a C++ version.
    Example

    BASIC
    -------
    IF a= 10 then print "This is a test"
    C++
    -----
    if (a = 10 ) cout << "This is a test" << endl;

    Now what i need help with is coping identifires

    I cant change this code

    BASIC
    -------
    DIM a AS INTEGER

    Its supposed to change to

    int a

    Can you please help
    ---------------------------
    check out my site
    http://home.dencity.com/neoprogramming/index.html

  2. #2
    Unregistered
    Guest
    PLEASE HELP

  3. #3
    Unregistered
    Guest
    What are you looking for?

    > DIM a AS INTEGER
    read "DIM" - and throw it away
    read "a" - save it in varName
    read "AS" - and throw it away
    read "INTEGER", perform a table lookup which translates BAS types to C++ types,
    output table["INTEGER"] " " varName ";"

    This simplistic approach will work for simple files, but for anything complex, you need to understand language grammars, parsing and how compilers and intepreters generally work.

    And you didn't post any code...

  4. #4
    Unregistered
    Guest

    Angry

    you are wasting my and your time, screw you, basic is a dead "language", deal

  5. #5

    I think it's great

    Actually I think it's great. If you would like to update old programs into C++, this would be easier. Like ORE. It's a MMRPG engine, written in Visual Basic. Which is exactly the same as basic, they just included some stuff for VB, but anyway. Using a converter, a programmer fluent in C++ but not Basic could edit the engine. DUH YOU IDIOT.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Basic C Help - Currency Converter
    By liljp617 in forum C Programming
    Replies: 9
    Last Post: 09-07-2008, 10:12 PM
  2. [ANN] New script engine (Basic sintax)
    By MKTMK in forum C++ Programming
    Replies: 1
    Last Post: 11-01-2005, 10:28 AM
  3. what are your thoughts on visual basic?
    By orion- in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 09-22-2005, 04:28 AM
  4. visual basic vs C or C++
    By FOOTOO in forum Windows Programming
    Replies: 5
    Last Post: 02-06-2005, 08:41 PM