| 1 |
Here are some suggestions for you to consider to improve tt(mfcalc)'s |
| 2 |
implementation and operating mode: |
| 3 |
itemization( |
| 4 |
it() Add some additional functions from `tt(cmath)' to the |
| 5 |
tt(Parser::s_functions); |
| 6 |
it() Define a class tt(Symbol) in which the symbol type, and an |
| 7 |
appropriate value for the symbol is stored. Define only one map tt(d_symbols) |
| 8 |
in the Parser, and provide the tt(Symbol) class with means to obtain the |
| 9 |
appropriate values for the various token types. |
| 10 |
it() Remove the tt(%union) directive, and change it into tt(%stype |
| 11 |
Symbol). Hint: use the tt(%preinclude-header) directive to make |
| 12 |
tt(Symbol) known to the parser's base class. |
| 13 |
it() Define a token tt(CONST) for numerical constants (like tt(PI), (E)), |
| 14 |
and pre-define some numerical constants; |
| 15 |
it() Make the program report an error if the user refers to an |
| 16 |
uninitialized variable in any way except to store a value in it. Hints: use a |
| 17 |
tt(get()) and tt(set()) member pair in tt(Symbol), and use the appropriate |
| 18 |
member in the appropriate tt(expr) rule; use tt(ERROR()) to initiate error |
| 19 |
recovery. |
| 20 |
) |
| 21 |
|