University of Leicester – Department of Computer Science

CO7206 - Fall 2003 - Lab 9: Program Restructuring Using TXL

4 Dec. / 2003  

Congratulations J: You made it through the hard times in this course and you are close to the end.

Objective: To further practice programming in TXL

In lab 7 we had our first hands on experience using TXL. In lab 8 we used TXL for a small restructuring task. In this lab we will further experiment with TXL by writing another small restructuring program.


1-     Download and compile the Commands grammar with 'Case' and 'If'.

2-     Examine this example of a program written in this command language.

3-     Download, compile and run this if-to-case TXL converter on the example above.

4-     Read and comprehend the if-to-case TXL converter program.

5-     Write a TXL program to transform a case-statement in a list of contiguous if-statements.

6-     Write your own programs with if and case statements that follow the given grammar and run the two converters (case-to-if and if-to-case) on them.


q       An example case-to-if transformer

q       Amble Resources are found on the TXL page

q       TXL Documentation

q       A brief guide on how to write a TXL program

q       More TXL examples