I am in the process of introducing an 'if then else' operator.
I have managed to get ngspice to recognise the '?' token by adding the
el.token = TOK_IFTHENELSE;
where in inptree.h :
#define TOK_IFTHENELSE 11
It is also aware of the opertor
#define PT_IFTHENELSE 11
I have also begun to implement the code in the 'PTdifferentiate'
The idea is to be able to write :
Bite 1 0 v=v(cond)?casesHere
which will evaluate which 'casesHere' to return depending on the state
of v(cond) ... this is identical to the C 'cond?then:else' operator.
My problem is that when I compile and run ngspice, it evaluates the Bite
line as returns :
Error on line 3 : bite 1 0 v=v(2)?40
parameter value out of range or the wrong type
It appears that there is something I am missing ???
I know it recognises the 'TOK_IFTHENELSE' token, but I don't think I am
doing the parameter estimation correctly ...
Public Projects :