Function ReferencedIdentifiers(searchIdentSet, searchAttrSet, recursive)

ReferencedIdentifiers

The function ReferencedIdentifiers determines which identifiers are used in the specified attributes of a subset of AllIdentifiers.

ReferencedIdentifiers(
     searchIdentSet       ! (input) subset of AllIdentifiers
     searchAttrSet        ! (input) subset of AllAttributeNames
     recursive            ! (optional) numerical expression
     )

Arguments

searchIdentSet

The set of identifiers to search in for referenced identifiers. This is a subsetof AllIdentifiers.

searchAttrSet

The set of attributes to search in for referenced identifiers. This is a subset of AllAttributeNames.

recursive

Optional argument, default 0, if 1 this function will also search in the referenced identifiers for identifier references.

Return Value

This function returns a subset of AllIdentifiers containing all the identifiers that are referenced in the attributes in searchAttrSet in one of the identifiers in searchIdentSet.

Example

Given the declarations:

Parameter p1;
Parameter p2;
Parameter pd {
    Definition: p1 + P2;
}

The following code, checks the definition of pd to determine that the identifiers p1 and p2 are referenced.

 1_ep_pd := StringToElement(AllIdentifiers,
 2    "chapterModel::sectionModelQuery::funcReferencedIdentifiers::pd",
 3    create:0);
 4_s_ids += _ep_pd ;
 5_s_refIds := ReferencedIdentifiers(
 6    searchIdentSet :  _s_ids,
 7    searchAttrSet  :  AllAttributeNames,
 8    recursive      :  1);
 9block where single_column_display := 1, listing_number_precision := 6 ;
10    display _s_refIds ;
11endblock ;

produces in the listing file:

_s_refIds := data
{ 'chapterModel::sectionModelQuery::funcReferencedIdentifiers::p1',
  'chapterModel::sectionModelQuery::funcReferencedIdentifiers::p2' } ;

References