Decide the parser archteciture
Currently we have flex/bison to deal with the input. All the calculation are done with built-in double type. As many in KDE pointed out, use double for precise calculation is a mistake. To meet the standards of KDE review, we have to switch infinite-precision numeric type. Luckily, knumber class from KCalc can be re-used.
Now the problem is, KCalc takes one or two input and one operator, calculate the result and display it. Kalk keeps the user entered math expression and evaluation the expression on input. Thus, we have to construct a parse tree from expression. To incorporate knumber into Kalk. The easiest way is to let flex return string, and construct knumber from string in bison. Though totally acceptable for practical reasons, we pay the price of extra regex matching (one in flex and one in knumber constructor), which is undesirable.
The other solution is to drop flex, let UI side to notify the type of input element (operator or number). In this way we parse the operators ourselves.
The upcoming binary/programmer mode also needs to take into consideration. @arenagrenade What do you think about this?