Extend Tiger With Do While

Tiger in Stratego -- Compilation by Program Transformation
Extend TigerLanguage with a do-while construct.

This requires updating the following components from the TigerFront package:

Note that the exercise is not difficult; the do-while construct is a straightforward variation on the while-do construct. The point of this assignment is to get an overview of the components of the TigerFront package and to refresh your Stratego knowledge. See HowToInstallTheTigerCompiler (note that you only need TigerFront for now) and HowToTestTheTigerCompiler.

The first step is to be able to parse do-while constructs. Take a look at the *.sdf files in syn/. Decide on a concrete syntax (add a test case to xmpl/!) and add it to the grammar.

There are two ways of implementing the new construct:

  • By eliminating it during desugaring (cf. tas/Tiger-Desugar.r)
  • By extending the typechecker (tc/*.r) and interpreter (eval/Tiger-Eval.r)

Implement both ways.


CategoryAssignment