File: exercises.yo

package info (click to toggle)
bisonc%2B%2B 6.09.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,984 kB
  • sloc: cpp: 9,375; ansic: 1,505; fortran: 1,134; makefile: 1,062; sh: 526; yacc: 84; lex: 60
file content (21 lines) | stat: -rw-r--r-- 1,098 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Here are some suggestions for you to consider to improve tt(mfcalc)'s
implementation and operating mode:
    itemization(
    it() Add some additional functions from `tt(cmath)' to the
        tt(Parser::s_functions);
    it() Define a class tt(Symbol) in which the symbol type, and an
appropriate value for the symbol is stored. Define only one map tt(d_symbols)
in the Parser, and provide the tt(Symbol) class with means to obtain the
appropriate values for the various token types.
    it() Remove the tt(%union) directive, and change it into tt(%stype
Symbol). Hint: use the tt(%preinclude-header) directive to make
tt(Symbol) known to the parser's base class.
    it() Define a token tt(CONST) for numerical constants (like tt(PI), (E)),
and pre-define some numerical constants;
    it() Make the program report an error if the user refers to an
uninitialized variable in any way except to store a value in it. Hints: use a
tt(get()) and tt(set()) member pair in tt(Symbol), and use the appropriate
member in the appropriate tt(expr) rule; use tt(ERROR()) to initiate error
recovery.
    )