Join 244,309 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 854 people online right now. Registration is fast and FREE... Join Now!
Given your current level of understanding of programming, OOP concepts and such (not trying to be rude or anything I swear, I just making this observation from your questions in the VB.NET forum) I would say taking on a project like this is well above your head. Creating a language is no simple task, it takes a team years to develop and debug a language
As Psycho said, no offense, but it's really above you. HOWEVER. [read on]
You could make your own interpreted language. That's not difficult. It's basically just reading in a file, and either: 1) Outputting the "translated" code to a language which you DO know 2) Running it directly through your interpreter. No secondary code.
Here's an example~ I wrote my own Brainfuck interpreter the other day. [click for blog entry]
Note, this is a really simple interpreter. Brainfuck only has 8 commands.
cpp
/* * A brainfuck interpreter * Author: Danny Battison * Contact: gabehabe@gmail.com */
#include <iostream> #include <fstream> using namespace std;
void DisplayHelp();
int main(int argc, char *argv[]) { if (argc < 2 || argc > 3) { DisplayHelp(); return EXIT_FAILURE; } if (!strcmp(argv[1], "-?")) { cout << "BRAINFUCK INTERPRETER: WRITTEN BY DANNY BATTISON" << endl << "This program is designed to interpret a brainfuck application." << endl << "Written in C++" << endl << "Contact the author: gabehabe (at) gmail (dot) com"; }
else if (!strcmp(argv[1],"-i")) { if (argc < 2 || argc > 3) { DisplayHelp(); return EXIT_FAILURE; } else { ifstream file; file.open(argv[2]); if (!file.is_open()) { cout << "ERROR: File could not be found."; return EXIT_FAILURE; } string bf = ""; char buffer; file.get(buffer); bf += buffer; while (!file.eof()) {file.get(buffer); bf += buffer;} file.close(); char* ptr = new char[5000]; int sub; for (sub = 0; sub < 5000; sub++) ptr[sub] = 0; sub = 0;
unsigned int i; int loopPosition = -1; for (i = 0; i < bf.length(); i++) { switch (bf[i]) { case '+': ptr[sub]++; break; case '-': ptr[sub]--; break; case '>': sub++; break; case '<': sub--; break; case '.': cout << ptr[sub]; break; case ',': ptr[sub] = getchar(); if (ptr[sub] == 13) {ptr[sub] = '\0'; loopPosition = -1;} break; case '[': loopPosition = i; break; case ']': if (loopPosition != -1) {if (ptr[sub] != '\0') i = loopPosition-1; else loopPosition = -1;} break; } } } return EXIT_SUCCESS; } }
Other than that, I'd say avoid trying to make your own compiled language. I'm getting books on it soon, I'll most likely be blogging about it. Keep an eye out, I try to write stuff in layman's terms.