How to get these 2 things together?
Let's say we have a line
001 FALSE
After reading it and getting words to different variables (I don't know yet how to do it, but let's say I do) we have a 001 integer then string FALSE. With strcmp I can check if the string is FALSE/TRUE/AND/... etc. (Wait a second, will I have write somewhere like 6 ifs about checking what's that string?)
Well, let say I detect FALSE - and if it's FALSE then it gets set up as gate_type[0]=gFalse=0.
Okay I thought I got this kinda all together but at this point I got a little lost. What does it give me? We have a line with 001 gFalse=0 but what about inputs and outputs of this line? Should I add enumerated logic value constans? Maybe something like
Code:
typedef enum logic_state
{
lUnknown = 2, // I wanted to set it 0 as first, but prolly true and low would be confusing for me
lLow = 0, // low as 0 is more clearer to me
lTrue = 1, //same about 1 as true
} logic_state;
Okay, if my way of thinking is at least a little correct, this enumerated constants can help me a little. From 001 FALSE I have something like
001 gFalse lUnknown lUnknown lUnknown (as nr/type/input1/input2/output)
But I can do something like, when
gate_type = g_False then
output = lLow.
So I have
001 gFalse lUnknown lUnknown lLow
And the unknowns will stay as they are. Although I am not sure if this would be a good solution...
Okay, I've been writing this post for a while and I got confused a little. Not sure if this all made any sense. Please tell me what you think.