-------------------------------------------------- ------------------------------ -- -- -- OCARINA COMPONENTS -- -- -- -- O C A R I N A . A N N O T A T I O N S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2007, GET-Telecom Paris. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- -- Free Software Foundation; either version 2, or (at your option) any -- -- later version. Ocarina is distributed in the hope that it will be -- -- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- -- Public License for more details. You should have received a copy of the -- -- GNU General Public License distributed with Ocarina; see file COPYING. -- -- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth -- -- Floor, Boston, MA 02111-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Ocarina is maintained by the Ocarina team -- -- (ocarina-users@listes.enst.fr) -- -- -- ------------------------------------------------------------------------------ -- This package implements the annotation mechanism of the AADL -- syntax and instance tree. Annotations is a list of information -- associated to a node to be used for several purposes. -- Each node has a list called Annotations (initially empty). The -- user may fill this list with some information (Annotation_Item's) -- and after, check whether a particular information has been -- associated to a particular node. with Types; use Types; package Ocarina.Annotations is procedure Annotate (N : node_id; A : node_id; I : node_id := No_Node); procedure Annotate (N : node_id; A : name_id; I : node_id := No_Node); -- Add a new annotation (A) to the 'Annotations' list of N -- (Initializes the list if this is the first added -- annotation). If I is given the added annotation extra -- information will be I. If there is already an annotation -- identified by 'A' in the annotation list of N, override its -- extra information value with the given one. function Annotation_Present (N : node_id; A : node_id) return Boolean; function Annotation_Present (N : node_id; A : name_id) return Boolean; -- Return True if annotation identified by 'A' exists in the -- annotation list of N. function Get_Extra_Info (N : node_id; A : node_id) return node_id; function Get_Extra_Info (N : node_id; A : name_id) return node_id; -- Return the Extra_Info relative to the Annotation identified by -- A if it exists in the annotation list of node N. Raise a -- program error if A is not present in the N annotations. procedure Remove_Annotation (N : node_id; A : node_id); procedure Remove_Annotation (N : node_id; A : name_id); -- Removed A from the N annotation if it is present and do nothing -- otherwise. procedure Empty_Annotations (N : node_id); -- Empty the Annotations' list of node N end Ocarina.Annotations;