The expression parser...
The operator precedence expression parser uses two stacks (values and operators) and a precedence lookup table to determine appropriate actions and solve the expression.
"Operator precedence parsing is based on bottom-up shift-reduce parsing. As an expression is parsed, tokens are shifted to a stack. At the appropriate time, the stack is reduced, applying the operator at the top of the stack." - Thomas Niemann
As I already mentioned, I've only implemented an expression parser for integer types. I still need to settle on a final design for the expression parser function. I could make a template out of it but I'll probably end up making a different version of each data type. This may be necessary because of incompatible data types. For example I am including float2, float3, and float4 built in vector data types and while I could add an integer to a float3 I couldn't add a float3 to an integer.
It's kind of cool to step through the parsers as they execute a script. This is an example of the kind of code it can handle as of now:
int x = 20;
int y = 4;
int z = (2 * (x - y^2)) / y;