in reply to Re: To make the Model WORK
in thread To make the Model WORK

The function evaluating the parse tree can be simplified if you eliminate elsif at compile time. Keep in mind that

if cond1 then action1 elsif cond2 then action2 elsif cond3 then action3 else action4 endif

is equivalent to

if cond1 then action1 else if cond2 then action2 else if cond3 then action3 else action4 endif endif endif

except the latter is easier to evaluate because the parse tree is simply

[ if => cond1, action1, [ if => cond2, action2, [ if => cond3, action3, action4 ] ] ]

See my reply below (under the heading "The following returns a nice tree for expr to evaluate") for an implementation.