"NOT ( ( b ) AND ( a )) ... This formula is terminated has AND is the root"
Are you sure? I would expect the resulting tree to look like this:
NOT
/ \
/ \
(null) AND
/ \
/ \
a b
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
Something like:
When the user selects the first operator that is the first node. When the use puts something in the ... to its left, that becomes the left sub-node of that node, similarly for the right ...
If one of those sub-nodes is another operator then that's a new node with its own left and right sub-nodes.
Maybe you just need to start coding something - eg just entering (a AND b) (no recursion needed here) then what you learn from doing that will help you towards the next step.
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073