I am slowly creating a simple programming language (a bit like Lua).
The interpreter has 2 important methods,
exec reads the tokens 1 by 1 and does stuff as it says like creating new variables, etc.
evaluate basically interprets a bit differently.
==, new numbers (
+-*/^% and new strings with
It also understands variables and takes their value to be used.
In the end of
evaluate, it returns one value for
exec to use.
A ginormous design hole in this interpreter is the fact that you cannot create new strings in
exec without creating a variable.
string a = "some string"; a.someStringMethod();
Works, but this:
This also means multidimensional arrays do not work, although I plan to use
. instead of
If you still do not understand how the interpreter right now here is the GitHub page on it:
So the overall question is: How would I merge these 2 methods?