| 
 | 
 
 | 
General Information
 Tutorials
 Reference Manuals
 Libraries
 Translation Tasks
 Tools
 
 
 
 
 
 
 
 
 Administration
  
 
 | 
 | 
Association of properties to definitionsSet a Property at the First Object Occurrence
This module associates values of type  The module instantiation differs from the usual pattern for this library: 
 $/Prop/SetFirst.gnrc+instance=NAME +referto=TYPE :inst 
Note: This module is not applicable to symbol occurrences that
do not have an attribute named  
Values are associated in the first  
The role  
If we want to associate the source coordinates
of defining identifier occurrences to object keys in our running example
we instantiate this module using the coordinate type  
 $/Prop/SetFirst.gnrc+instance=DefPt +referto=CoordPtr :inst Then the roles of this module are associated to our grammar symbols: 
 
   SYMBOL DefPoint      INHERITS DefPtSetFirst COMPUTE
      SYNT.DefPt = COORDREF;
   END;
   SYMBOL DefIdent      INHERITS DefPoint END;
   SYMBOL ClassDefIdent INHERITS DefPoint END;
   SYMBOL ModDefIdent   INHERITS DefPoint END;
The property computed this way may for example be used to check
whether an identifier occurs in an applied context before its
definition, as required e.g. in Pascal.
For that purpose a function  
 
   SYMBOL ChkBeforeDef COMPUTE
      IF (CoordLess (COORDREF, GetDefPt (THIS.Key, COORDREF)),
      message (ERROR,
               CatStrInd ("identifier occurs before its definition: ",
                          THIS.Sym),
               0, COORDREF))
      DEPENDS_ON INCLUDING DefPtRangeSetFirst.GotDefPt;
   END;
The role   |