next up previous contents index
Next: Simple functions Up: Fits functions Previous: Constants

Loop descriptors

Most of the transformations applicable to loops require contextual informations. Rather than to recompute them each time, they are stored in descriptors. Several descriptors stored in a AST structure can be used to describe the structure of a nest of loops. Each transformation updates the AST as well as the associated descriptors. A loop descriptor is stored in an undocumented type of name LOOPDESC. The additional module name is LoopDesc (i.e. the full module name is Fits:LoopDesc).

The loop descriptors are created by the following functions:

  $\blacktriangleright$ Fits:LoopDesc:Create(LOOP)
 
This function create a loop descriptor associated to the loop LOOP.
  $\blacktriangleright$ Fits:LoopDesc:RecursiveInit(DESC,DEPTH)
 
This statement analyses the nest of loops defined by the loop descriptor DESC (i.e. the outer loop). For each inner loop, a descriptor is created and added in the AST structure. DESC is the root of the AST.

Some functions are provided to find nodes in a AST of descriptors.

  $\blacktriangleright$ Fits:LoopDesc:Parent(DESC)
 
This function returns the element on top of DESC in the AST of descriptors. If the parent does not exist, a new descriptor is created with a loop equal to FALSE.
  $\blacktriangleright$ Fits:LoopDesc:NbChildren(DESC)
 
This attribute returns the number of children of DESC.
  $\blacktriangleright$ Fits:LoopDesc:Rank(DESC)
 
This attribute returns the rank of the loop descriptor DESC in the children list of its parent.
  $\blacktriangleright$ Fits:LoopDesc:Child(DESC,NUM)
 
This attribute returns the child of rank NUM of the loop descriptor DESC.

Several informations are stored in a loop descriptor. They can be accessed by the following functions and statements:


next up previous contents index
Next: Simple functions Up: Fits functions Previous: Constants
Yann Mevel
1999-04-30