How to write a programming language (insaned)
14 Mar 2003 11:18:17 -0500

          From comp.compilers

Related articles
How to write a programming language (2003-03-14)
Re: How to write a programming language (Peter Cooper) (2003-03-17)
| List of all articles for this month |

From: (insaned)
Newsgroups: comp.compilers
Date: 14 Mar 2003 11:18:17 -0500
Keywords: question
Posted-Date: 14 Mar 2003 11:18:17 EST

Hello people.I would like to make my own programming language.It
should look like this:

$a = 1;
$b = 2;
$c = $a + $b;
$d = 1+(2*(3+1*2))+1;

function loop()
      return 1;

I have a basic ideas how should i do it, but i would like some help
about variables.Where to store them, how to use them, etc.Also about
the to store them, where, how to call them.
My programming language is going to be like PHP, vars will be
dynamicly created and should be any, string, object...

I splitt the code as follows:

i can't figure where to store variables and their names, in arrays
first thing to do is this!and i can't!

I am using Visual C++ and my idea is:

class Variable {
      bool is_string;
      bool is_integer;
      bool is_char;

      Variable *next_var;

      int get_int();
      char* get_string();
      char get_char();

      bool set_type(int);
      bool copy(void*);

Variable* vars;

when i create a variable:
vars = new Variable();

and later:

and so on...I don't know if this code is going to work, bacause i
didn't test it!But i thing it should!

So if anyone have any ideas, comments, or links in the web is welcome.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.