----------------------------------------------- --------------------------------- -- -- -- OCARINA COMPONENTS -- -- -- -- O C A R I N A . A A D L . P A R S E R . I D E N T I F I E R S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2005-2006, 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) -- -- -- ------------------------------------------------------------------------------ package Ocarina.AADL.Parser.Identifiers is type refinement_type is (rt_refinement, rt_refinable, rt_not_refinable); -- This type is used for parsing functions parameter -- RT_Refinement : parse only Refinement -- RT_Refinable : parse Refinement or Non_Refinement -- RT_Not_Refinable : Refinement is not allowed Refinable_To_RT : constant array (Boolean) of refinement_type := (True => rt_refinable, False => rt_not_refinable); function Make_Current_Identifier (Entity : node_id) return node_id; -- Make an identifier from current token function P_Expected_Identifier (Expected_Id : node_id) return Boolean; -- Parse Identifier -- Return TRUE if parsed identifier name equals to Expected_Id name function P_Expected_Identifiers (Identifiers : list_id; Delimiter : Ocarina.AADL.Tokens.token_type) return Boolean; -- Parse ( { Identifier Delimiter }* Identifier ) -- These parsed identifiers must be the same as in list L -- These parsed identifiers will NOT be added in list L -- This function is useful for parsing 'end' clause for example -- Return TRUE if everything is OK function P_Identifier (Container : Types.node_id) return node_id; procedure P_Identifier_Refined_To (Option : refinement_type; Optional_Identifier : Boolean; Code : parsing_code; Refinement_Code : parsing_code; Skip_Until_Token : Ocarina.AADL.Tokens.token_type; Identifier : out node_id; Is_Refinement : out Boolean; OK : out Boolean); -- Parse ( Identifier : [ refined to ] ) -- Input parameters: -- Option - Refinement is alowed, not allowed or imperative -- Optional_Identifier - If TRUE, ( Identifier : ) is optional -- Code - Parsing code of current item -- Refinement_Code - Parsing code of current item refinement -- Skip_Until_Token - When an error occurs, -- skip tokens until this token is reached -- Output parameters: -- Identifier - defining identifier -- Is_Refinement - 'refined to' is parsed ? -- OK - OK = TRUE if no error function P_Entity_Reference (Code : parsing_code) return node_id; -- [ package_name :: ] identifier [.identifier] -- Parse Unique_..._Identifier, etc. end Ocarina.AADL.Parser.Identifiers;