COP 4620 - Programming Language Translators Project Zero - Getting Started Project 0 consists of getting familiarized with the Tiny Compiler/Interpreter from the language user's point of view, i.e as a Tiny programmer. In your Tiny directory there are are number of files, briefly explained as follows: CodeGenerator.c: This is the source file for the code gener- ator. More on this creature later. Constrainer.c: This is the source file for the contextual constrainer. More on this later. lex.tiny, parse.tiny. These are lexical and parsing specifi- cations for Tiny. The only one that matters at this point is "parse.tiny". It describes Tiny's syntax. You'll need it for this assignment. Constrain, CodeGen: These are the ready-to-run compiler com- ponents. tests/p1, p2, p3, p4, p5, p6, p7: Seven test programs, writ- ten in Tiny. tc: This is the Tiny Compiler/Interpreter. It's nothing more than a shell script, that invokes the scanner/parser, then the constrainer, then the code generator, and finally the interpreter. As these as executed, their effect is as follows: 1) The parser produces a file called _TREE, in your cur- rent directory (typically the 'tiny' directory). 2) The constrainer reads in the _TREE file, traverses the tree, adds constraining information to it, and writes it back out. 3) The code generator reads in the tree, traverses it to generate code, and produces a file called _CODE in your current directory. It also updates the new (slightly) modified tree. 4) The interpreter reads in the _CODE file, and simulates the execution of the program in it. The sooner you learn to read target code files, the better. Some documentation files are available in {your_path}/tws/manual. They are: abs_machine code_generator constrainer dcln_module parse pgen print_tree text_table tree_module Your assignment zero consists of writing, coding, and run- ning a single Tiny program. The Tiny program should take as input two positive numbers N and M, and print the product of all numbers between N and M, i.e. N*(N+1)*(N+2)*...*M, if N<=M, or the other way around, if N>M. In coding the pro- gram, you should keep in mind that you are dealing with a very small language. As you can see in the parser specifi- cation (in parse.tiny), Tiny has a very limited number of operators. There is no division, no subtraction, no multi- plication, no comparison operators other than "<=", and although boolean variables can be declared, the values "true" and "false" are nonexistent. You must work around these limitations. A good way to see how things are done in Tiny is to mimic existing programs. Taking a look at p1 through p7 is a good idea, especially p4, which is a facto- rial program. This first assignment (and the second one) MUST be done individually. The deadline for this assignment is Friday, August 31. No paper needs to be handed in in class. Send your Tiny program (a text file) as an email attachment to your professor's email address: manuel@cise.ufl.edu.