------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Cheddar is a GNU GPL real time scheduling analysis tool. -- This program provides services to automatically check performances -- of real time architectures. -- -- Copyright (C) 2002-2010, by Frank Singhoff, Alain Plantec, Jerome Legrand -- -- The Cheddar project was started in 2002 by -- the LISyC Team, University of Western Britanny. -- -- Since 2008, Ellidiss technologies also contributes to the development of -- Cheddar and provides industrial support. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program 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 -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- -- Contact : cheddar@listes.univ-brest.fr -- ----------------------------------------------------------------------------- -- Last update : -- $Rev: 395 $ -- $Date: 2011-04-11 20:43:38 +0200 (lun., 11 avr. 2011) $ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Sax.Exceptions; with Sax.Locators; with Sax.Readers; with Sax.Attributes; with Unicode.CES; with Systems; use Systems; with Processor_Set; use Processor_Set; use Processor_Set.Generic_Processor_Set; with scheduling_analysis; use scheduling_analysis; with multiprocessor_services_interface; use multiprocessor_services_interface; use multiprocessor_services_interface.Scheduling_Result_Per_Processor_Package; package v2_Xml_Parsers is ---------------------------------------------------------------------------- ------ ---------------------------------------------------------------------------- ------ ---------------- Mandatory code for all XML parser of Cheddar ---------------------------------------------------------------------------- ------ ---------------------------------------------------------------------------- ------ -- Exception raised by clients of Xml_Parses when something goes -- wrong during XML parsing -- Xml_Read_Error : exception; -- Generic XML parser -- type Xml_Generic_Parser is new Sax.Readers.Reader with private; -- Methods for all Cheddar XML parsers -- procedure Characters (Handler : in out Xml_Generic_Parser; Ch : Unicode.CES.Byte_Sequence); procedure Set_Document_Locator (Handler : in out Xml_Generic_Parser; Loc : access Sax.Locators.Locator'Class); procedure Error (Handler : in out Xml_Generic_Parser; Except : Sax.Exceptions.Sax_Parse_Exception'Class); procedure Fatal_Error (Handler : in out Xml_Generic_Parser; Except : Sax.Exceptions.Sax_Parse_Exception'Class); procedure Warning (Handler : in out Xml_Generic_Parser; Except : Sax.Exceptions.Sax_Parse_Exception'Class); ---------------------------------------------------------------------------- ------ ---------------------------------------------------------------------------- ------ ---------------- Necessary code to parse XML Cheddar project files ---------------------------------------------------------------------------- ------ ---------------------------------------------------------------------------- ------ -- This tagged type is the parser ... -- type Xml_Project_Parser is new Xml_Generic_Parser with private; -- Override methods of the Reader to custom the treatement the -- parser have to do -- procedure Start_Document (Handler : in out Xml_Project_Parser); procedure Start_Element (Handler : in out Xml_Project_Parser; Namespace_Uri : Unicode.CES.Byte_Sequence := ""; Local_Name : Unicode.CES.Byte_Sequence := ""; Qname : Unicode.CES.Byte_Sequence := ""; Atts : Sax.Attributes.Attributes'Class); procedure End_Element (Handler : in out Xml_Project_Parser; Namespace_Uri : Unicode.CES.Byte_Sequence := ""; Local_Name : Unicode.CES.Byte_Sequence := ""; Qname : Unicode.CES.Byte_Sequence := ""); procedure Initialize_Project_Parser (Handler : in out Xml_Project_Parser); function Get_Parsed_System (Handler : in Xml_Project_Parser) return System; ---------------------------------------------------------------------------- ------ ---------------------------------------------------------------------------- ------ ---------------- Necessary code to parse XML Cheddar project files ---------------------------------------------------------------------------- ------ ---------------------------------------------------------------------------- ------ -- This tagged type is the parser ... -- type Xml_Event_Table_Parser is new Xml_Generic_Parser with private; -- Override methods of the Reader to custom the treatement the -- parser have to do -- procedure Start_Document (Handler : in out Xml_Event_Table_Parser); procedure Start_Element (Handler : in out Xml_Event_Table_Parser; Namespace_Uri : Unicode.CES.Byte_Sequence := ""; Local_Name : Unicode.CES.Byte_Sequence := ""; Qname : Unicode.CES.Byte_Sequence := ""; Atts : Sax.Attributes.Attributes'Class); procedure End_Element (Handler : in out Xml_Event_Table_Parser; Namespace_Uri : Unicode.CES.Byte_Sequence := ""; Local_Name : Unicode.CES.Byte_Sequence := ""; Qname : Unicode.CES.Byte_Sequence := ""); procedure Initialize_Event_Table_Parser (Handler : in out Xml_Event_Table_Parser); procedure Read_Time_Value (Handler : in out Xml_Event_Table_Parser); procedure Set_Scheduled_System (Handler : in out Xml_Event_Table_Parser; Scheduled_System : in System); function Get_Parsed_Event_Table (Handler : in Xml_Event_Table_Parser) return Scheduling_Table_Ptr; private type Xml_Generic_Parser is new Sax.Readers.Reader with record Locator : Sax.Locators.Locator_Access; end record; type Xml_Project_Parser is new Xml_Generic_Parser with record -- At the end of the parser execution, the project -- is store in the objet below -- Parsed_System : System; end record; type Xml_Event_Table_Parser is new Xml_Generic_Parser with record -- At the end of the parser execution, the event table -- is store in the objet below -- Parsed_Event_Table : Scheduling_Table_Ptr; -- At the end of the parser execution, the project -- is store in the objet below -- Scheduled_System : System; end record; end v2_Xml_Parsers;