next up previous contents
Next: Signatures Up: The Macro COSY Environment Previous: The Macro COSY Environment

Introduction

In this section, we will talk about the programs for setting up the Macro COSY environment. The structure of the system is shown in Figure 1.1 in chapter 1. During the first stage, the program will do the lexical analysis. If it found error(s) at this stage, the program would prompt an error message and stop running. Otherwise, it will output a token list and go into the second stage.

During the second stage, the program will do the parsing according to the given grammar of the COSY program. If it found error(s) during the parsing, the program would display an error message and stop running. Otherwise, it will produce a context-free syntax tree of the Macro COSY program and pass it to the third stage.

During the third stage, the program will check this syntax tree according to the context-sensitive restrictions (see [JL92]pp.460-461). If the tree does not satisfy all the restrictions, the program will display all error messages and cease running. Otherwise, the program will output a syntax tree and pass it to the last stage.

During the last stage, the program will do the expansion. Before expanding the COSY program, the program will put all the paths in front of the processes. Then, the program will scan the tree from top to bottom in order to change all distributor subtrees into concatenator subtrees. After that, the program will do the expansion and output a string, the expanded COSY program, which is in the form of a Basic COSY program. After expansion, we can use the displayer the display the expanded COSY program on the screen. We also can pass the result (expanded COSY program) back to the first stage to re-process it again.

We will use the modularization technique to design our system.



Peter Lauer
Mon Jul 22 17:29:46 EDT 1996