Next: , Previous: Expressions, Up: Project File Reference


13.8 Attributes

An attribute declaration defines a property of a project or package. This property can later be queried by means of an attribute reference. Attribute values are strings or string lists.

Some attributes are associative arrays. These attributes are mappings whose domain is a set of strings. These attributes are declared one association at a time, by specifying a point in the domain and the corresponding image of the attribute. They may also be declared as a full associative array, getting the same associations as the corresponding attribute in an imported or extended project.

Attributes that are not associative arrays are called simple attributes.

Syntax:

     attribute_declaration ::=
       full_associative_array_declaration |
       for attribute_designator use expression ;
     
     full_associative_array_declaration ::=
       for <associative_array_attribute_>simple_name use
       <project_>simple_name [ . <package_>simple_Name ] ' <attribute_>simple_name ;
     
     attribute_designator ::=
       <simple_attribute_>simple_name |
       <associative_array_attribute_>simple_name ( string_literal )

Some attributes are project-specific, and can only appear immediately within a project declaration. Others are package-specific, and can only appear within the proper package.

The expression in an attribute definition must be a string or a string_list. The string literal appearing in the attribute_designator of an associative array attribute is case-insensitive.