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:
tas/Tiger-Desugar.r
)
tc/*.r
) and interpreter (eval/Tiger-Eval.r
)
Implement both ways.