Reminder: You may work on homework with other people, but (1) indicate with whom you worked and (2) please use your own words when writing up the results.
On a ``grid'' machine (or any machine using gcc 3.1 or up) run the C++ preprocessor (g++ -E) on the following program:
#include <iostream>
int main()
{
std::cout << "Hello, world!" << std::endl;
}
g++ -E hello.cc | grep '\# 1 ' to
find the lines where an included file starts in the result.
Ignore the first three lines of output.)
Use wc to
estimate how many characters the preprocessor must look at, broken
down by file. (Some files are read twice; don't forget to add up
all the characters read.)
Solve Exercise 2.3(b) on page 99 of the textbook
(2.1(b) on page 96 of new textbook).
Make sure your solution accepts (**) and (***) (but not (*) or (* *) *)).
Turn in both the automaton and the regular expression along with your explanation of how they handle the test cases given above.
As a programmer, what would you like a scanner do when it encounters errors such as
$ in Cool),
_x in Cool,