---------------------------------------------------------- ---------------------- -- -- -- OCARINA COMPONENTS -- -- -- -- O C A R I N A . P A R S E R -- -- -- -- S p e c -- -- -- -- Copyright (C) 2005-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) -- -- -- ------------------------------------------------------------------------------ with Types; package Ocarina.Parser is use Types; type Process_Function_Access is access function (File_Name : String; AADL_Root : Node_Id) return Node_Id; type Standard_Property_Sets is (S_AADL_Properties, S_AADL_Project); -- The AADL standard property sets function Image (S : Standard_Property_Sets) return String; -- Return the base name of the AADL file containing the standard -- property set correspodning to the given enumerator. type Ocarina_Property_Sets is ( O_ARAO, O_Cheddar_Properties, O_ASSERT_Properties); -- The Ocarina predefined property sets function Image (O : Ocarina_Property_Sets) return String; -- Return the base name of the AADL file containing the predefined -- Ocarina property set correspodning to the given enumerator. function Custom (S : Standard_Property_Sets) return Boolean; function Custom (O : Ocarina_Property_Sets) return Boolean; function Default (S : Standard_Property_Sets) return Boolean; function Default (O : Ocarina_Property_Sets) return Boolean; -- The functions above are used to ensure the following behavior -- of Ocarina: If the user provided his own standard property sets -- (or one of them) then the parser will not parse the Ocarina -- corresponding standard property files. If the user did not -- provide one standard property set, Ocarina will parse its -- corresponding standard property file. Only custom standard -- property sets are printed by the AADL printer. procedure Set_Property_Set_Flags (Identifier : Node_Id); -- Set properly the result of the 4 functions above according to -- the given identifier: If the given identifier corresponds to a -- standard (resp. Ocarina predefined) property set and the result -- of the corresponding 'Default' function is False, then, set the -- result of the corresponding 'Custom' function to True. function Parse (File_Name : String; AADL_Root : Node_Id) return Node_Id; -- Parse the file File_Name and return the Node_Id or the root of -- the resulting AADL tree, or No_Node if the parsing failed. If -- AADL_Root is not No_Node, then add the parsed entities to -- AADL_Root. This function automatically selects the appropriate -- parser, according to the file name. function Search_And_Parse (Entity_Name : String; AADL_Root : Node_Id; Display_Debug_Messages : Boolean) return Node_Id; -- Do the same thing as Parse, but take the name of the entity -- that should be looked for. Search the file that should contain -- the entity and then parse it. Return No_Node if the entity was -- not found. If the Display_Debug_Messages flag is True, then -- output some debugging messages on the standard error procedure Add_Search_Path (Path_Name : String); -- Add a directory name in which Search_And_Parse should look for -- description files. procedure Register_Parser (File_Extension : String; Parser : Process_Function_Access); procedure Reset_Parsers; -- Unregister all the registered parsers function Parse_Standard_Property_Sets (AADL_Root : Node_Id) return Node_Id; -- Parse the AADL files which contain the AADL standard property -- sets and append the declaration to the given AADL -- specification. function Parse_Ocarina_Property_Sets (AADL_Root : Node_Id) return Node_Id; -- Parse the AADL files which contain the Ocarina predefined -- property sets and append the declaration to the given AADL -- specification. end Ocarina.Parser;