<![if !supportEmptyParas]> <![endif]>
University of Leicester
Dec. 2nd, 2003
<![if !supportEmptyParas]> <![endif]>
In this tutorial, you will use pair programming to write a TXL program to perform addition on two vectors.
<![if !supportEmptyParas]> <![endif]>
<![if !supportLists]>1. <![endif]>Choose your collaborator and read this brief on pair programming.
<![if !supportLists]>2. <![endif]>Decide with your colleague who will be the driver and who will be the observer (switch your roles halfway).
<![if !supportLists]>3. <![endif]>A sample input file is here.
<![if !supportLists]>4. <![endif]>Start by writing the grammar that accepts a “program” consisting of two vectors, separated by +.
<![if !supportLists]>5. <![endif]>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
<![if !supportLists]>6. <![endif]>Try the “-Dapply”, “-Dparse” and “-Dresult” for the TXL command interpreter.
<![if !supportLists]>7. <![endif]>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.
<![if !supportLists]>8. <![endif]>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.
<![if !supportEmptyParas]> <![endif]>
<![if !supportLists]>q <![endif]>Amble Resources are found on the
TXL page
<![if !supportLists]>q <![endif]>TXL Documentation
<![if !supportLists]>q <![endif]>A brief guide on how to write a TXL program
<![if !supportLists]>q
<![endif]>A
sample solution of the problem above
<![if !supportLists]>q
<![endif]>Another sample
solution of the problem above (by M. Sharpe. Thanks Mick)
<![if !supportEmptyParas]> <![endif]>