The output of our compiler will be the input to the "machine." In C, the compiler generates an object file, the familiar .o file, that is then linked into the a.out file. To actually run the program you must still cause the operating system to load a.out file into memory for the machine to execute.
For our project, we will instead use the program gforth. gforth is almost completely opposite of Lisp. The syntactic format for gforth is postorder. While Lisp has some syntax, gforth only has spelling rules. As an example,
our 1+2 expression in C would be entered as
1 2 +
Objective 1 is to introduce you to gforth. Gforth will be the machine that we code to.
Objective 2 is to emphasize the crucial role of generalized trees and generalized postorder traversal.
Objective 3 is to get you to formulate a generalized expression tree data structure.
The professional will learn to use many programming languages and paradigms throughout her/his professional career. The hallmark of the professional in this venue is the ability to quickly master a new programming language or paradigm and to relate the new to the old.
The below exercises are simple "Hello World" type exercises. These short program segments or small programs are designed to get you to understand how to learn a new language: you pretty much just sit down and try some standard things that you already know must work.
In this milestone, you have several clear performance objectives.
Your milestone report will include hand written answers to 3 and 4 above.
In addition, your milestone report must include a data structure for an n-ary tree and a pseudo-code recursive algorithm to translate an arbitrary instance of these trees into postorder.
Use handin on the TEACH website to submit the gforth input file, makefile, and milestone report.
We will generate the output file.
Click on these links to see a template for the Milestone Report and Makefile we will use in this class.