Q0 Set up : svn export http://unbox.org/wisp/var/timm/10/310/src/st/3/b : svn add b : svn commit -m "3b ready to go" : For each of the following questions, add lines like this to "run" printf "\n===== 3/b/q1 ========================\n\n" cat myGrammarFilesUsedInThisExample.rules cat myCodeThatAnswersThisQuestion.st execute : where "execute" is the "test" command shown below. Q1 Write : Port your science fiction grammar from Proj1 to this : Smalltalk system. Show you can generate 5 stories from : this grammar. Test : |g| g := Grammar new. g file: 'scifi.rules'. : 10 timesRepeat: [g generate. '' oo. ]. ! Q2 Write : Add comment lines to the scifi rules. Comments begin with "#" : and are skipped by the grammar. Hint : TagBlank in Tag.st Test : |g| g:= Grammar new. g file: 'scifiWithComments.rules'. g generate. ! : Q3 Write : Write a smalltalk program that prints out (one per line) all the : right-hand-side "variables" (i.e. any right-hand symbol : that starts with upper case) that are missing on the : left-hand-side. Hints: : st> 'Astring' first isUppercase. : true : st> #Asymbol first isUppercase. : true Test : |g| g:= Grammar new. g file: 'scifi.rules'. g badRight. ! Q4 Write : Write a smalltalk program that prints out (one per line) all the : left "variables" that are missing on the right-hand-side Test : |g| g:= Grammar new. g file: 'scifi.rules'. g badRight. !