c109s07t1 - CSE 109 Test 1 Wednesday 21 February 2007...

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

View Full Document Right Arrow Icon
CSE 109 Test 1 Wednesday 21 February 2007 <<<<<<<<<<<<<<<<<<<SUGGESTED ANSWERS>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 1. Below is an outline of the classes you will be using for assignment p6, where the declarations are stored in the corresponding files parse.h, lex.h, etc., and the definitions (code) are stored in the files parse.cc, lex.cc, etc. The various methods do not have any variables of any class type. The main program is stored in p6.cc. Write a makefile for compiling the various classes and storing the executable program in p6. All the relationships among the classes are shown in the outline. Include a command "clean:" for "cleaning up" the directory where the files are loocated. f int main(){ .... Parse a(fin,fout); ..... } class Parse{ .... private: Lex lex; Tree t; ..... }; class Lex{ .... private: Scan sc; Word wd; Tree t; ...}; class Tree{ ... private: Word wd; .... }; class Word{...} class Scan{...} <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< #makefile for test 1 #spring 2007 # p6: p6.o parse.o lex.o tree.o word.o scan.o <tab> g++ -o p6 p6.o parse.o lex.o tree.o word.o scan.o < p6.o: p6.cc word.h lex.h tree.h scan.h parse.h <tab> g++ -c -Wall -Werror p6.cc < parse.o: parse.cc word.h lex.h tree.h scan.h parse.h
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 ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern