{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lab6 - CSS 342 Mathematical Principles of Computing Lab 6...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSS 342: Mathematical Principles of Computing Lab 6: Stacks and Compilers Professor: Munehiro Fukuda Assigned: See Our Syllabus Purpose This laboratory work modifies the textbook's calculator program so as to accept binary C++ operators including (, ), *, /, %, -, +, <<, >>, <, <=, >, >=, ==, !=, &, ^, |, &&, and ||. Evaluator You can find the textbook's calculator program (as shown in Figures 12.14 - 12.22) in ~css342/code/stacks/evaluator/ . 1. evaluator.h : The calculator's, (i.e., Evaluator's) class interface. It corresponds to Figures 12.14 and 12.20. 2. evaluator.cpp : The calculator's, (i.e., Evaluator's) implementation that includes getValue( ), getTop( ), binaryOp( ), and processToken( ), each corresponding to Figure 12.17 12.18, 12.19 and 12.21 respectively. 3. token.h : the Token class interface. This corresponds to Figure 12.15. 4. tokenizer.h : The Tokenizer class interface. It corresponds to Figure 12.15. 5. tokenizer.cpp : It includes the getToken routine for returning the next token in the input stream. It corresponds to Figure 12.16. 6. driver.cpp : A simple main for evaluating expressions repeatedly. It corresponds to Figure 12.22. This calculator accepts only five binary operators such as *, /, -, + and ^ as well as parentheses ( and ). Note that ^ means exponential in the textbook rather than bit exclusive
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}