/*
 "The House That Jack Built" by Jonathan Swift.
*/

*$MST_FROM_ENTRY;
$EXTRN Prout;

$ENTRY Go { 
  = <Title> <JonathanSwift>;
}

Title {  
  = <Out ('     The House That Jack Built')
         ('          Jonathan Swift'      )>;
}

Paragraph {
 = <NL> <NL>;
}

NL {
 = <Prout >;
}

Scene { = 
("This is"           'the farmer sowing the corn,'  " "  )
("That"    "kept"    'the cock that crowed in the morn,' )
("That"    "waked"   'the priest all shaven and shorn,'  )
("That"    "married" 'the man all tattered and torn,'    )
("That"    "kissed"  'the maiden all forlorn,'           )
("That"    "milked"  'the cow with the crumpled horn,'   )
("That"    "tossed"  'the dog,'                          )
("That"    "worried" 'the cat,'                          )
("That"    "killed"  'the rat,'                          )
("That"    "ate"     'the malt'                          )
("That"    "lay"     'in the house that Jack built.'     )
}

JonathanSwift {
  = <Loop <Scene>>;
}

Loop {
 ("This is" 'in the house that Jack built.') =
         <Paragraph>
         <Out ("This is" 'the house that Jack built.')>;

 e.Couplet = <Next e.Couplet>
             <Paragraph>
             <Out e.Couplet>;
}

Next {
   (e.first) ("That" s.1 e.2) e.text =
       <Loop ("This is"  e.2) e.text>;
}

Out {
   = ;
  (e.first) e.text = <Prout e.first>
                     <Out e.text>;
}