1------------------------------------------------------------------------------
2--                                                                          --
3--                            Matreshka Project                             --
4--                                                                          --
5--                               XML Processor                              --
6--                                                                          --
7--                        Runtime Library Component                         --
8--                                                                          --
9------------------------------------------------------------------------------
10--                                                                          --
11-- Copyright © 2010-2014, Vadim Godunko <vgodunko@gmail.com>                --
12-- All rights reserved.                                                     --
13--                                                                          --
14-- Redistribution and use in source and binary forms, with or without       --
15-- modification, are permitted provided that the following conditions       --
16-- are met:                                                                 --
17--                                                                          --
18--  * Redistributions of source code must retain the above copyright        --
19--    notice, this list of conditions and the following disclaimer.         --
20--                                                                          --
21--  * Redistributions in binary form must reproduce the above copyright     --
22--    notice, this list of conditions and the following disclaimer in the   --
23--    documentation and/or other materials provided with the distribution.  --
24--                                                                          --
25--  * Neither the name of the Vadim Godunko, IE nor the names of its        --
26--    contributors may be used to endorse or promote products derived from  --
27--    this software without specific prior written permission.              --
28--                                                                          --
29-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS      --
30-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT        --
31-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR    --
32-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT     --
33-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,   --
34-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
35-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR   --
36-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF   --
37-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING     --
38-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS       --
39-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.             --
40--                                                                          --
41------------------------------------------------------------------------------
42--  $Revision: 4777 $ $Date: 2014-03-29 11:52:24 +0400 (Sat, 29 Mar 2014) $
43------------------------------------------------------------------------------
44pragma Ada_2012;
45
46private package XML.SAX.Simple_Readers.Parser.Actions is
47
48   procedure On_Attribute_Default_Declaration
49    (Self    : in out Simple_Reader'Class;
50     Default : Matreshka.Internals.Strings.Shared_String_Access);
51   --  Handles declaration of default value of the attribute.
52
53   procedure On_CDATA_Attribute_Declaration
54    (Self   : in out Simple_Reader'Class;
55     Symbol : Matreshka.Internals.XML.Symbol_Identifier);
56   --  Process attribute declaration of CDATA type.
57
58   procedure On_CDATA_Open (Self : in out Simple_Reader'Class);
59   --  Process open of CDATA section.
60
61   procedure On_CDATA_Close (Self : in out Simple_Reader'Class);
62   --  Process close of CDATA section.
63
64   procedure On_Character_Data
65    (Self          : in out Simple_Reader'Class;
66     Text          : not null Matreshka.Internals.Strings.Shared_String_Access;
67     Is_Whitespace : Boolean);
68   --  Process segment of character data.
69
70   procedure On_Element_Attribute
71    (Self   : in out Simple_Reader'Class;
72     Symbol : Matreshka.Internals.XML.Symbol_Identifier;
73     Value  : not null Matreshka.Internals.Strings.Shared_String_Access);
74   --  Handles attribute of the element.
75
76   procedure On_Element_Attribute_Name
77    (Self   : in out Simple_Reader'Class;
78     Symbol : Matreshka.Internals.XML.Symbol_Identifier);
79   --  Handles name of the attribute in the element. Now it olny switch scanner
80   --  into appopriate attribute value normalization mode.
81
82   procedure On_End_Of_Document (Self : in out Simple_Reader'Class);
83   --  Handles end of document.
84
85   procedure On_End_Of_Document_Type_Declaration
86    (Self : in out Simple_Reader'Class);
87   --  Handles end of document type declaration.
88
89   procedure On_End_Tag
90    (Self   : in out Simple_Reader'Class;
91     Symbol : Matreshka.Internals.XML.Symbol_Identifier);
92   --  Handles end tag, rule [42].
93
94   procedure On_Empty_Element_Tag (Self : in out Simple_Reader'Class);
95   --  Process start tag, rule [44].
96
97   procedure On_Entity_Attribute_Declaration
98    (Self   : in out Simple_Reader'Class;
99     Symbol : Matreshka.Internals.XML.Symbol_Identifier);
100   --  Process attribute declaration of CDATA type.
101
102   procedure On_Entities_Attribute_Declaration
103    (Self   : in out Simple_Reader'Class;
104     Symbol : Matreshka.Internals.XML.Symbol_Identifier);
105   --  Process attribute declaration of CDATA type.
106
107   procedure On_Enumeration_Attribute_Declaration
108    (Self   : in out Simple_Reader'Class;
109     Symbol : Matreshka.Internals.XML.Symbol_Identifier);
110   --  Process attribute declaration of enumeration type.
111
112   procedure On_Fixed_Attribute_Default_Declaration
113    (Self    : in out Simple_Reader'Class;
114     Default : Matreshka.Internals.Strings.Shared_String_Access);
115   --  Handles declaration of fixed value of the attribute.
116
117   procedure On_General_Entity_Declaration
118    (Self        : in out Simple_Reader'Class;
119     Symbol      : Matreshka.Internals.XML.Symbol_Identifier;
120     Is_External : Boolean;
121     Value       : League.Strings.Universal_String;
122     Notation    : Matreshka.Internals.XML.Symbol_Identifier);
123   --  Process general entity declaration, rule [71].
124
125   procedure On_Id_Attribute_Declaration
126    (Self   : in out Simple_Reader'Class;
127     Symbol : Matreshka.Internals.XML.Symbol_Identifier);
128   --  Process attribute declaration of CDATA type.
129
130   procedure On_IdRef_Attribute_Declaration
131    (Self   : in out Simple_Reader'Class;
132     Symbol : Matreshka.Internals.XML.Symbol_Identifier);
133   --  Process attribute declaration of CDATA type.
134
135   procedure On_IdRefs_Attribute_Declaration
136    (Self   : in out Simple_Reader'Class;
137     Symbol : Matreshka.Internals.XML.Symbol_Identifier);
138   --  Process attribute declaration of CDATA type.
139
140   procedure On_Implied_Attribute_Default_Declaration
141    (Self : in out Simple_Reader'Class);
142   --  Handles declaration of implied value of the attribute.
143
144   procedure On_Empty_Declaration
145    (Self : in out Simple_Reader'Class);
146   --  Handles declaration of empty of the element.
147
148   procedure On_Any_Declaration
149    (Self : in out Simple_Reader'Class);
150   --  Handles declaration of any of the element.
151
152   procedure On_Mixed_Content_Declaration
153    (Self   : in out Simple_Reader'Class;
154     Is_Any : Boolean);
155   --  Handles declaration of mixed content of the element.
156
157   procedure On_Name_In_Mixed_Content_Declaration
158    (Self : in out Simple_Reader'Class);
159   --  Handles element name in the list of children element in mixed content
160   --  declration.
161
162   procedure On_NmToken_Attribute_Declaration
163    (Self   : in out Simple_Reader'Class;
164     Symbol : Matreshka.Internals.XML.Symbol_Identifier);
165   --  Process attribute declaration of CDATA type.
166
167   procedure On_NmTokens_Attribute_Declaration
168    (Self   : in out Simple_Reader'Class;
169     Symbol : Matreshka.Internals.XML.Symbol_Identifier);
170   --  Process attribute declaration of CDATA type.
171
172   procedure On_No_Document_Type_Declaration
173    (Self : in out Simple_Reader'Class);
174   --  Handles case when document type declaration is missing.
175
176   procedure On_Notation_Attribute_Declaration
177    (Self   : in out Simple_Reader'Class;
178     Symbol : Matreshka.Internals.XML.Symbol_Identifier);
179   --  Process attribute declaration of NOTATION type.
180
181   procedure On_Notation_Declaration
182    (Self      : in out Simple_Reader'Class;
183     Name      : Matreshka.Internals.XML.Symbol_Identifier;
184     Public_Id : not null Matreshka.Internals.Strings.Shared_String_Access;
185     System_Id : not null Matreshka.Internals.Strings.Shared_String_Access);
186   --  Handles declaration of notation.
187
188   procedure On_Open_Of_Tag
189    (Self   : in out Simple_Reader'Class;
190     Symbol : Matreshka.Internals.XML.Symbol_Identifier);
191   --  Handles open of element's tag. The only purpose now is to resolve
192   --  element and set identifier of the declaration of currently
193   --  processed element.
194
195   procedure On_Parameter_Entity_Declaration
196    (Self        : in out Simple_Reader'Class;
197     Symbol      : Matreshka.Internals.XML.Symbol_Identifier;
198     Is_External : Boolean;
199     Value       : League.Strings.Universal_String);
200   --  Process parameter entity declaration, rule [72].
201
202   procedure On_Required_Attribute_Default_Declaration
203    (Self : in out Simple_Reader'Class);
204   --  Handles declaration of required value of the attribute.
205
206   procedure On_Start_Of_Attribute_List_Declaration
207    (Self   : in out Simple_Reader'Class;
208     Symbol : Matreshka.Internals.XML.Symbol_Identifier);
209   --  Handles start of attribute list declaration.
210
211   procedure On_Start_Of_Document
212    (Self : in out Simple_Reader'Class);
213   --  Handles start of document.
214
215   procedure On_Start_Of_Document_Type_Declaration
216    (Self     : in out Simple_Reader'Class;
217     Name     : Matreshka.Internals.XML.Symbol_Identifier;
218     External : Boolean);
219   --  Handles start of document type declaration.
220
221   procedure On_Start_Of_Element_Declaration
222    (Self   : in out Simple_Reader'Class;
223     Symbol : Matreshka.Internals.XML.Symbol_Identifier);
224   --  Handles start of element declaration.
225
226   procedure On_Start_Tag (Self : in out Simple_Reader'Class);
227   --  Handles start tag of element.
228
229   procedure On_XML_Declaration
230    (Self     : in out Simple_Reader'Class;
231     Version  : not null Matreshka.Internals.Strings.Shared_String_Access;
232     Encoding : not null Matreshka.Internals.Strings.Shared_String_Access);
233   --  Handles XML version information and entity's encoding by switching
234   --  scanner to the corresponding processing mode.
235
236   procedure On_Text_Declaration
237    (Self     : in out Simple_Reader'Class;
238     Version  : not null Matreshka.Internals.Strings.Shared_String_Access;
239     Encoding : not null Matreshka.Internals.Strings.Shared_String_Access);
240   --  Handles XML version information and entity's encoding in external
241   --  entity.
242
243   procedure On_Standalone
244    (Self : in out Simple_Reader'Class;
245     Text : not null Matreshka.Internals.Strings.Shared_String_Access);
246   --  Handles 'standalone' element of XML declaration.
247
248   procedure On_Processing_Instruction
249    (Self   : in out Simple_Reader'Class;
250     Target : Matreshka.Internals.XML.Symbol_Identifier;
251     Data   : not null Matreshka.Internals.Strings.Shared_String_Access);
252   --  Process processing instruction.
253
254end XML.SAX.Simple_Readers.Parser.Actions;
255