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

Info iconThis 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
Background image of page 1

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

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

This note was uploaded on 03/09/2008 for the course CSE 109 taught by Professor Kay during the Spring '08 term at Lehigh University .

Page1 / 4

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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online