Handout: How to prepare your own practice exam ---------------------------------------------- April 25, 1991 ----------------------------- In file $OO/exams/practice-exam-handout Many of the objectives we cover in this course, can also be performed by the Demeter tools. The objectives which can be handled by the tools include: Class dictionary graph recognition Class dictionary graph textual representation Class dictionary graph graphical representation Printing First sets Parsing Follow sets LL(1) checking etc. The Demeter tools not only give you an efficient environment to do your homework faster (imagine if you had to write all the parsers, printers, class definitions etc.), but also give you a nice environment to learn fundamental techniques of Computer Science. Here is how you can prepare your own exam: Write a class dictionary D and put it into file cd. Run sem-check -i cd Modify the cd, if there are error messages until the cd is accepted. (You will learn: Legal class dictionary graph and the LL(1) rules in this process) Then inspect the following files for the objectives you want to learn: cd-com-exp Class dictionary graph flattening cd-ffsets First sets, Follow sets cd-ll1-corrected LL(1) correction cd-param-exp Parameterization expansion To master the Parsing objective, cretae a class library with the Demeter commands. Write a few inputs for your cd and use run to test them. This will also teach you the Scanning objective. To master the Printing objective, call g_print() for any object. To master the Object construction objective, write a C++ statement sequence to build the object and then use g_draw() or g_print() to print it out. Did you get the right object? Alternatively, you can use g_code. To master the C++ translation objective, use the tools to generate a class library and inspect the C++ code provided. To master the Propagation pattern in C++ objective, write a propagation in file x.pp, call make and inspect the generated C++ code in x-DEM.c. You may also want to inspect the propagation graph files. To master the Growth plan objective, write a growth plan and check it with gp-check. To master the Class dictionary graph graphical representation objective, use the xcddraw program to draw a class dictionary graph. This will teach you interactively most of the Legal class dictionary graph objective.