I am trying to learn the process of making script languages. It seems simple, but I am at a lack of proper resource material which demonstrates a working example, which is small. There is this script language called TrumpScript which I found hilarious, but it is a little objectified.
So let me get this straight.
A token is a subset of data from a line. These include: +, numbers, strings, -, , =, *, variable names.
Each token has its priority of execution. In the line: var a = 5 + 6 * 2;, * will be the highest, + is second, var a is third and = is the last.
These tokens are to be written out into a list of commands, making up byte code.
The byte code should be a state based thing in which you push values and call an operation… such as…
push 32
push a
add
Does add pop 32 and pop a from the state? Or should future pushes pop the second push in that pop has to be ran twice to edit push 1? Or am I getting this process wrong?