MIDTERM CSU670 Spring 2004 Monday, February 23 Karl Lieberherr YOUR NAME: Open book and open notes. Question 1: 40 points Question 2: 21 points Question 3. 36 points Question 4: 20 points 117 points Question 1: ================================================== UNKNOWN1 = List(Enhancement) UNKNOWN2 = "add" "to" UNKNOWN3 = ClassBody | PartCoordinate | CollectionCoordinate common ":" SyntaxToken UNKNOWN4 = Where UNKNOWN5 = "." UNKNOWN6 = NOTHING UNKNOWN7 = Where UNKNOWN8 = NOTHING UNKNOWN9 = Where CurlyBracket UNKNOWN10 = {S} Question 2: ================================================== UNKNOWN1 = Main.cg UNKNOWN2 = traverse UNKNOWN3 = this UNKNOWN4 = "from Example to Tree" UNKNOWN5 = new Visitor UNKNOWN6 = Tree UNKNOWN7 = host.get_subtrees() Question 3: ================================================== UNKNOWN1 = Inner UNKNOWN2 = Inner UNKNOWN3 = Leaf UNKNOWN4 = mnl UNKNOWN5 = Leaf UNKNOWN6 = abc UNKNOWN7 = Inner UNKNOWN8 = Inner UNKNOWN9 = Leaf UNKNOWN10 = ghi UNKNOWN11 = def UNKNOWN12 = abc UNKNOWN13 = def UNKNOWN14 = xyz UNKNOWN15 = Leaf UNKNOWN16 = ghi UNKNOWN17 = Main.cg.traverse(this,"from Example to Leaf", new Visitor() { void before(Leaf host){ System.out.println(host.get_ident()); } }); Question 4: ==================================================== UNKNOWN1 = { ( leaf mnl leaf abc ( leaf ghi) def) abc , leaf ghi }