include_template( 'topper.html' ); ?>
CS 3304 semester(); ?> Homework Assignment 3
include_template( 'page-start.html' ); ?>
25 Points
Due: 09/18 at the start of class
Note: The following instructions are repeated from the
Homework Dates/Guidelines page:
Your solutions for each homework assignment
must be prepared with a word processor
(e.g., LaTeX or Word), and are due at the beginning
of class on the due date specified unless otherwise noted on the
assignment itself.
Note that all homework problems taken from the text are in
the Problem Sets. Do not turn in solutions to Review
Questions by mistake!
Complete each of the following problems in the Chapter 3 Problem Set
(p. 149-151 of the 5E text, 152-154 in 4E)::
- Using the virtual machine instructions given in Section 3.5.1.1
(in the 4th edition, Section 3.6.1.1), give an operational semantic
definition of the following:
- Pascal for-downto
- Pascal if-then-else
- C switch
[ This question is based on Chapter 3, Problem 12, parts b, d, and f;
it is rephrased here because of the typographical error in part (b)
of the 5th edition text book, which should read
"Ada for". ]
- Chapter 3, Problem 14
- For the last problem in this homework assignment, complete
the lexer/tokenizer for your program 1 assignment and
include a complete source listing for a Pascal program
that includes your tokenizer variables, data structures, and
subprograms. The body of the main program should call
your tokenizer repeatedly in a loop, printing out each
individual token read from standard input on a separate line
by itself on standard output.
include_template( 'page-end.html' ); ?>