Jump to content

Low Quality Interpreter I made


Recommended Posts

I made a c++ program which reads what the user types and kinda pseudo-compiles* it so that the user can input functions. I'm a noob to c++ and I had no idea how I was going to display graphs and functions based on an equation the user could type in (such as "y = x^2+3") for my graph program, so I made a text based interpreter with my own language*.

 

It works kinda like this

 

m,100,&A would "move" the value 100 to the variable A

same as

A = 100;

 

+,&X,1,&X would add variable X and 1, store in X

same as

x++;

or

x+=1;

 

I realized it's vaguely like asm, but I just set it up this way so I can prepare a command and then get the input.

 

I even got working goto and label statements.

 

I got if and else statements and comparisons kinda working but not done.

 

Is anyone interested?

demo, source?

 

*I'm probably using the wrong terminology.

Link to comment
Share on other sites

  • 3 weeks later...

Wow...that`s nice man...I`m crazy to enter in nice projects like this, but i`m kind of studying to much =//...then I have to go slow on the thinks that i want to do "for myself"

 

If I have some time, I`ll see all this project ^^

 

added to my list of "Things to do"

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...