University of Leicester

CO7206: Tutorial #6

Dec. 2nd, 2003

 

In this tutorial, you will use pair programming to write a TXL program to perform addition on two vectors.

 

1.     Choose your collaborator and read this brief on pair programming.

2.     Decide with your colleague who will be the driver and who will be the observer (switch your roles halfway).  

3.     A sample input file is here.

4.     Start by writing the grammar that accepts a “program” consisting of two vectors, separated by +.

5.     Then, write the rule(s) needed to transform this program into the addition of the two vectors. For the given input, the output will be:   11     102           1003      10004       100005

6.     Try the  “-Dapply”, “-Dparse”  and “-Dresult” for the TXL command interpreter.

7.     Even if you did not read a word on TXL, try to solve the given problem and read as you go. This tutorial is the right time to learn. All the resources needed are included below.

8.     There is no right and wrong program as long as it does the job (i.e., meets the requirements). A sample program is provided for your reference, in case you could not finish your own.

 

Resources:

q       Amble Resources are found on the TXL page

q       TXL Documentation

q       A brief guide on how to write a TXL program

q       A sample solution of the problem above

q       Another sample solution of the problem above (by M. Sharpe. Thanks Mick)