Interpreter typing in C
- by typus
I'm developing an interpreter and I have some questions to it.
I recently saw a small C interpreter that used a very simple struct like the below for all its objects/values in the language:
struct Object
{
ubyte type;
ubyte value;
};
This struct can hold strings, integers, bools and lists (I think) used in the language the interpreter is working with.
How can you get this Object struct to hold all these types?