next up previous contents index
Next: The clean enddo transformation Up: TSF: A Tool Set Previous: Loop descriptors

Simple functions

The following functions are used internally by the FITS transformations.

  $\blacktriangleright$ Fits:Util:LastStatOfDoLoop(LOOP)
 
This function returns the last statement of the do-loop statement LOOP. This is often an node of variant enddo or continue.
  $\blacktriangleright$ Fits:Util:OuterDoLoop(NODE)
 
This function returns the do-loop statement that contains the statement or the expression NODE. The falue FALSE is returned if a such do-loop is not found.
  $\blacktriangleright$ Fits:Util:StatementName(STAT)
 
This function returns the name of a DO, IF, FORALL or WHERE statement.
  $\blacktriangleright$ Fits:Util:RemoveStatementName(STAT)
 
This statement replaces the statement STAT of variant labstat by the statement which it names (i.e. its child of rank 1 is a DO, IF, FORALL or WHERE statement). $\vartriangleright$ Example 60:Removing of the name of the loop 'l1'



 
  n=4 
  l1: DO i=1,n
    PRINT *,i
  ENDDO



$\longrightarrow$

  n=4 
  DO i=1,n
    PRINT *,i
  ENDDO



  $\blacktriangleright$ Fits:Util:GetTarget(STAT)
 
This function returns the target of a GOTO, EXIT or CYCLE statement.
  $\blacktriangleright$ Fits:Util:MakeLabelContinue(LABEL)
 
This function creates a CONTINUE statement labeled with the specified value. The label must be declared in the fortran symbol table.
  $\blacktriangleright$ Fits:Util:MakeGotoLabel(LABEL)
 
This function creates a GOTO statement to the specified label.
  $\blacktriangleright$ Fits:Util:RemoveCycleOfLoop(LOOP,UNIT)
 
This statement transforms all CYCLE statements associated to the specified do-loop statement LOOP into GOTO statements. Some labels may be created by this transformation so an unit UNIT must be specified. The unit can be omited by using the value FALSE when the loop is contained in an unit AST.
  $\blacktriangleright$ Fits:Util:RemoveExitOfLoop(LOOP,UNIT)
 
This statement transforms all EXIT statements associated to the specified do-loop statement LOOP into GOTO statements. Some labels may be created by this transformation so an unit UNIT must be specified. The unit can be omited by using the value FALSE when the loop is contained in an unit AST. A labeled CONTINUE statement can be inserted after LOOP.
  $\blacktriangleright$ Fits:Util:ChangeLabel(AST,OLD,NEW)
 
This statement replaces each occurence in AST of the label OLD by NEW.
  $\blacktriangleright$ Fits:Util:NewLabelValue(UNIT)
 
This function returns a label value unused in the specified unit UNIT. The created label is then declared in this unit.
  $\blacktriangleright$ Fits:Util:LabelNodesUsedInAst(AST)
 
This function returns the list label nodes used in the specified AST AST. Each element of the list (see the attribute GET)



 
next up previous contents index
Next: The clean enddo transformation Up: TSF: A Tool Set Previous: Loop descriptors
Yann Mevel
1999-04-30