Debian Codegraph @

progs/arm_frmd.adb

raw
1 with Ada.Characters.Handling,
2 Ada.Strings.Fixed;
3 package body ARM_Format.Data is
4
5 --
6 -- Ada reference manual formatter (ARM_Form).
7 --
8 -- This package contains various data used by the input file parser.
9 --
10 -- ---------------------------------------
11 -- Copyright 2011, 2012 AXE Consultants. All rights reserved.
12 -- P.O. Box 1512, Madison WI 53701
13 -- E-Mail: [email protected]
14 --
15 -- ARM_Form is free software: you can redistribute it and/or modify
16 -- it under the terms of the GNU General Public License version 3
17 -- as published by the Free Software Foundation.
18 --
19 -- AXE CONSULTANTS MAKES THIS TOOL AND SOURCE CODE AVAILABLE ON AN "AS IS"
20 -- BASIS AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY,
21 -- CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR FUNCTIONING OF THIS TOOL.
22 -- IN NO EVENT WILL AXE CONSULTANTS BE LIABLE FOR ANY GENERAL,
23 -- CONSEQUENTIAL, INDIRECT, INCIDENTAL, EXEMPLARY, OR SPECIAL DAMAGES,
24 -- EVEN IF AXE CONSULTANTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
25 -- DAMAGES.
26 --
27 -- A copy of the GNU General Public License is available in the file
28 -- gpl-3-0.txt in the standard distribution of the ARM_Form tool.
29 -- Otherwise, see <http://www.gnu.org/licenses/>.
30 --
31 -- If the GPLv3 license is not satisfactory for your needs, a commercial
32 -- use license is available for this tool. Contact Randy at AXE Consultants
33 -- for more information.
34 --
35 -- ---------------------------------------
36 --
37 -- Edit History:
38 --
39 -- 8/ 8/11 - RLB - Split from base package, mainly to reduce the
40 -- size of that package.
41 -- - RLB - Added aspect index commands.
42 -- 10/18/11 - RLB - Changed to GPLv3 license.
43 -- 10/19/11 - RLB - Added AspectDefn command.
44 -- 10/20/11 - RLB - Added DeletedPragmaSyn command.
45 -- 10/26/11 - RLB - Added versioned break commands.
46 -- 3/27/12 - RLB - Added more versioned break commands.
47 -- 12/17/12 - RLB - Added Ada 2012 AARM headings.
48
49
50 function Command (Name : in ARM_Input.Command_Name_Type) return Command_Type is
51 -- Return the command value for a particular command name:
52 Canonical_Name : constant String :=
53 Ada.Characters.Handling.To_Lower (Ada.Strings.Fixed.Trim (Name, Ada.Strings.Right));
54 begin
55 if Canonical_Name = "begin" then
56 return Text_Begin;
57 elsif Canonical_Name = "end" then
58 return Text_End;
59 elsif Canonical_Name = "redundant" then
60 return Redundant;
61 elsif Canonical_Name = "comment" then
62 return Comment;
63 elsif Canonical_Name = "noprefix" then
64 return No_Prefix;
65 elsif Canonical_Name = "noparanum" then
66 return No_Para_Num;
67 elsif Canonical_Name = "keepnext" then
68 return Keep_with_Next;
69 elsif Canonical_Name = "leading" then
70 return Leading;
71 elsif Canonical_Name = "trailing" then
72 return Trailing;
73 elsif Canonical_Name = "+" then -- Can't happen directly, but can happen through stacking.
74 return Up;
75 elsif Canonical_Name = "-" then -- Can't happen directly, but can happen through stacking.
76 return Down;
77 elsif Canonical_Name = "thinline" then
78 return Thin_Line;
79 elsif Canonical_Name = "thickline" then
80 return Thick_Line;
81 elsif Canonical_Name = "tabclear" then
82 return Tab_Clear;
83 elsif Canonical_Name = "tabset" then
84 return Tab_Set;
85 elsif Canonical_Name = "table" then
86 return Table;
87 elsif Canonical_Name = "picturealone" then
88 return Picture_Alone;
89 elsif Canonical_Name = "pictureinline" then
90 return Picture_Inline;
91 elsif Canonical_Name = "last" then
92 return Table_Last;
93 elsif Canonical_Name = "part" then
94 return Part;
95 elsif Canonical_Name = "newpage" then
96 return New_Page;
97 elsif Canonical_Name = "rmnewpage" then
98 return RM_New_Page;
99 elsif Canonical_Name = "softpage" then
100 return Soft_Page;
101 elsif Canonical_Name = "newcolumn" then
102 return New_Column;
103 elsif Canonical_Name = "newpagever" then
104 return New_Page_for_Version;
105 elsif Canonical_Name = "rmnewpagever" then
106 return RM_New_Page_for_Version;
107 elsif Canonical_Name = "notisormnewpagever" then
108 return Not_Iso_RM_New_Page_for_Version;
109 elsif Canonical_Name = "isoonlyrmnewpagever" then
110 return Iso_Only_RM_New_Page_for_Version;
111 elsif Canonical_Name = "newcolumnver" then
112 return New_Column_for_Version;
113 elsif Canonical_Name = "b" or else Canonical_Name = "bold" then
114 return Bold;
115 elsif Canonical_Name = "i" or else Canonical_Name = "italics" then
116 return Italic;
117 elsif Canonical_Name = "r" or else Canonical_Name = "roman" then
118 return Roman;
119 elsif Canonical_Name = "s" or else Canonical_Name = "swiss" then
120 return Swiss;
121 elsif Canonical_Name = "f" or else Canonical_Name = "fixed" then
122 return Fixed;
123 elsif Canonical_Name = "ri" then
124 return Roman_Italic;
125 elsif Canonical_Name = "shrink" then
126 return Shrink;
127 elsif Canonical_Name = "grow" then
128 return Grow;
129 elsif Canonical_Name = "black" then
130 return Black;
131 elsif Canonical_Name = "red" then
132 return Red;
133 elsif Canonical_Name = "green" then
134 return Green;
135 elsif Canonical_Name = "blue" then
136 return Blue;
137 elsif Canonical_Name = "key" then
138 return Keyword;
139 elsif Canonical_Name = "nt" then
140 return Non_Terminal;
141 elsif Canonical_Name = "ntf" then
142 return Non_Terminal_Format;
143 elsif Canonical_Name = "exam" then
144 return Example_Text;
145 elsif Canonical_Name = "examcom" then
146 return Example_Comment;
147 elsif Canonical_Name = "indexlist" then
148 return Index_List;
149 elsif Canonical_Name = "defn" then
150 return Defn;
151 elsif Canonical_Name = "defn2" then
152 return Defn2;
153 elsif Canonical_Name = "rootdefn" then
154 return RootDefn;
155 elsif Canonical_Name = "rootdefn2" then
156 return RootDefn2;
157 elsif Canonical_Name = "pdefn" then
158 return PDefn;
159 elsif Canonical_Name = "pdefn2" then
160 return PDefn2;
161 elsif Canonical_Name = "indexsee" then
162 return Index_See;
163 elsif Canonical_Name = "indexseealso" then
164 return Index_See_Also;
165 elsif Canonical_Name = "seeother" then
166 return See_Other;
167 elsif Canonical_Name = "seealso" then
168 return See_Also;
169 elsif Canonical_Name = "rootlibunit" then
170 return Index_Root_Unit;
171 elsif Canonical_Name = "childunit" then
172 return Index_Child_Unit;
173 elsif Canonical_Name = "subchildunit" then
174 return Index_Subprogram_Child_Unit;
175 elsif Canonical_Name = "adatypedefn" then
176 return Index_Type;
177 elsif Canonical_Name = "adasubtypedefn" then
178 return Index_Subtype;
179 elsif Canonical_Name = "adasubdefn" then
180 return Index_Subprogram;
181 elsif Canonical_Name = "adaexcdefn" then
182 return Index_Exception;
183 elsif Canonical_Name = "adaobjdefn" then
184 return Index_Object;
185 elsif Canonical_Name = "adapackdefn" then
186 return Index_Package;
187 elsif Canonical_Name = "adadefn" then
188 return Index_Other;
189 elsif Canonical_Name = "indexcheck" then
190 return Index_Check;
191 elsif Canonical_Name = "attr" then
192 return Index_Attr;
193 elsif Canonical_Name = "prag" then
194 return Index_Pragma;
195 elsif Canonical_Name = "aspectdefn" then
196 return Index_Aspect;
197 elsif Canonical_Name = "syn" then
198 return Syntax_Rule;
199 elsif Canonical_Name = "syn2" then
200 return Syntax_Term;
201 elsif Canonical_Name = "synf" then
202 return Syntax_Term_Undefined;
203 elsif Canonical_Name = "syni" then
204 return Syntax_Prefix;
205 elsif Canonical_Name = "syntaxsummary" then
206 return Syntax_Summary;
207 elsif Canonical_Name = "syntaxxref" then
208 return Syntax_Xref;
209 elsif Canonical_Name = "addedsyn" then
210 return Added_Syntax_Rule;
211 elsif Canonical_Name = "deletedsyn" then
212 return Deleted_Syntax_Rule;
213 elsif Canonical_Name = "toglossary" then
214 return To_Glossary;
215 elsif Canonical_Name = "toglossaryalso" then
216 return To_Glossary_Also;
217 elsif Canonical_Name = "chgtoglossary" then
218 return Change_To_Glossary;
219 elsif Canonical_Name = "chgtoglossaryalso" then
220 return Change_To_Glossary_Also;
221 elsif Canonical_Name = "glossarylist" then
222 return Glossary_List;
223 elsif Canonical_Name = "prefixtype" then
224 return Prefix_Type;
225 elsif Canonical_Name = "chgprefixtype" then
226 return Change_Prefix_Type;
227 elsif Canonical_Name = "endprefixtype" then
228 return Reset_Prefix_Type;
229 elsif Canonical_Name = "attribute" then
230 return Attribute;
231 elsif Canonical_Name = "attributeleading" then
232 return Attribute_Leading;
233 elsif Canonical_Name = "chgattribute" then
234 return Change_Attribute;
235 elsif Canonical_Name = "attributelist" then
236 return Attribute_List;
237 elsif Canonical_Name = "pragmasyn" then
238 return Pragma_Syntax;
239 elsif Canonical_Name = "pragmalist" then
240 return Pragma_List;
241 elsif Canonical_Name = "addedpragmasyn" then
242 return Added_Pragma_Syntax;
243 elsif Canonical_Name = "deletedpragmasyn" then
244 return Deleted_Pragma_Syntax;
245 elsif Canonical_Name = "impldef" then
246 return Implementation_Defined;
247 elsif Canonical_Name = "chgimpldef" then
248 return Change_Implementation_Defined;
249 elsif Canonical_Name = "impldeflist" then
250 return Implementation_Defined_List;
251 elsif Canonical_Name = "chgimpladvice" then
252 return Change_Implementation_Advice;
253 elsif Canonical_Name = "addedimpladvicelist" then
254 return Added_Implementation_Advice_List;
255 elsif Canonical_Name = "chgdocreq" then
256 return Change_Documentation_Requirement;
257 elsif Canonical_Name = "addeddocreqlist" then
258 return Added_Documentation_Requirements_List;
259 elsif Canonical_Name = "chgaspectdesc" then
260 return Change_Aspect_Description;
261 elsif Canonical_Name = "addedaspectlist" then
262 return Added_Aspect_Description_List;
263 elsif Canonical_Name = "packagelist" then
264 return Package_List;
265 elsif Canonical_Name = "typelist" then
266 return Type_List;
267 elsif Canonical_Name = "subprogramlist" then
268 return Subprogram_List;
269 elsif Canonical_Name = "exceptionlist" then
270 return Exception_List;
271 elsif Canonical_Name = "objectlist" then
272 return Object_List;
273 elsif Canonical_Name = "labeledsection" then
274 return Labeled_Section;
275 elsif Canonical_Name = "labeledsectionnobreak" then
276 return Labeled_Section_No_Break;
277 elsif Canonical_Name = "labeledclause" then
278 return Labeled_Clause;
279 elsif Canonical_Name = "labeledsubclause" then
280 return Labeled_Subclause;
281 elsif Canonical_Name = "labeledsubsubclause" then
282 return Labeled_Subsubclause;
283 elsif Canonical_Name = "labeledannex" then
284 return Labeled_Annex;
285 elsif Canonical_Name = "labeledinformativeannex" then
286 return Labeled_Informative_Annex;
287 elsif Canonical_Name = "labelednormativeannex" then
288 return Labeled_Normative_Annex;
289 elsif Canonical_Name = "unnumberedsection" then
290 return Unnumbered_Section;
291 elsif Canonical_Name = "labeledrevisedannex" then
292 return Labeled_Revised_Annex;
293 elsif Canonical_Name = "labeledrevisedinformativeannex" then
294 return Labeled_Revised_Informative_Annex;
295 elsif Canonical_Name = "labeledrevisednormativeannex" then
296 return Labeled_Revised_Normative_Annex;
297 elsif Canonical_Name = "labeledaddedannex" then
298 return Labeled_Added_Annex;
299 elsif Canonical_Name = "labeledaddedinformativeannex" then
300 return Labeled_Added_Informative_Annex;
301 elsif Canonical_Name = "labeledaddednormativeannex" then
302 return Labeled_Added_Normative_Annex;
303 elsif Canonical_Name = "labeledrevisedsection" then
304 return Labeled_Revised_Section;
305 elsif Canonical_Name = "labeledrevisedclause" then
306 return Labeled_Revised_Clause;
307 elsif Canonical_Name = "labeledrevisedsubclause" then
308 return Labeled_Revised_Subclause;
309 elsif Canonical_Name = "labeledrevisedsubsubclause" then
310 return Labeled_Revised_Subsubclause;
311 elsif Canonical_Name = "labeledaddedsection" then
312 return Labeled_Added_Section;
313 elsif Canonical_Name = "labeledaddedclause" then
314 return Labeled_Added_Clause;
315 elsif Canonical_Name = "labeledaddedsubclause" then
316 return Labeled_Added_Subclause;
317 elsif Canonical_Name = "labeledaddedsubsubclause" then
318 return Labeled_Added_Subsubclause;
319 elsif Canonical_Name = "labeleddeletedclause" then
320 return Labeled_Deleted_Clause;
321 elsif Canonical_Name = "labeleddeletedsubclause" then
322 return Labeled_Deleted_Subclause;
323 elsif Canonical_Name = "labeleddeletedsubsubclause" then
324 return Labeled_Deleted_Subsubclause;
325 elsif Canonical_Name = "subheading" then
326 return Subheading;
327 elsif Canonical_Name = "addedsubheading" then
328 return Added_Subheading;
329 elsif Canonical_Name = "heading" then
330 return Heading;
331 elsif Canonical_Name = "center" then
332 return Center;
333 elsif Canonical_Name = "right" then
334 return Right;
335 elsif Canonical_Name = "prefacesection" then
336 return Preface_Section;
337 elsif Canonical_Name = "refsec" then
338 return Ref_Section;
339 elsif Canonical_Name = "refsecnum" then
340 return Ref_Section_Number;
341 elsif Canonical_Name = "refsecbynum" then
342 return Ref_Section_By_Number;
343 elsif Canonical_Name = "locallink" then
344 return Local_Link;
345 elsif Canonical_Name = "localtarget" then
346 return Local_Target;
347 elsif Canonical_Name = "urllink" then
348 return URL_Link;
349 elsif Canonical_Name = "ailink" then
350 return AI_Link;
351 elsif Canonical_Name = "chg" then
352 return Change;
353 elsif Canonical_Name = "chgadded" then
354 return Change_Added;
355 elsif Canonical_Name = "chgdeleted" then
356 return Change_Deleted;
357 elsif Canonical_Name = "chgref" then
358 return Change_Reference;
359 elsif Canonical_Name = "chgnote" then
360 return Change_Note;
361 elsif Canonical_Name = "introname" then
362 return Intro_Name;
363 elsif Canonical_Name = "syntaxname" then
364 return Syntax_Name;
365 elsif Canonical_Name = "resolutionname" then
366 return Resolution_Name;
367 elsif Canonical_Name = "legalityname" then
368 return Legality_Name;
369 elsif Canonical_Name = "staticsemname" then
370 return Static_Name;
371 elsif Canonical_Name = "linktimename" then
372 return Link_Name;
373 elsif Canonical_Name = "runtimename" then
374 return Run_Name;
375 elsif Canonical_Name = "boundedname" then
376 return Bounded_Name;
377 elsif Canonical_Name = "erronname" then
378 return Erroneous_Name;
379 elsif Canonical_Name = "implreqname" then
380 return Req_Name;
381 elsif Canonical_Name = "docreqname" then
382 return Doc_Name;
383 elsif Canonical_Name = "metricsname" then
384 return Metrics_Name;
385 elsif Canonical_Name = "implpermname" then
386 return Permission_Name;
387 elsif Canonical_Name = "impladvicename" then
388 return Advice_Name;
389 elsif Canonical_Name = "notesname" then
390 return Notes_Name;
391 elsif Canonical_Name = "singlenotename" then
392 return Single_Note_Name;
393 elsif Canonical_Name = "examplesname" then
394 return Examples_Name;
395 elsif Canonical_Name = "metarulesname" then
396 return Meta_Name;
397 elsif Canonical_Name = "inconsistent83name" then
398 return Inconsistent83_Name;
399 elsif Canonical_Name = "incompatible83name" then
400 return Incompatible83_Name;
401 elsif Canonical_Name = "extend83name" then
402 return Extend83_Name;
403 elsif Canonical_Name = "diffword83name" then
404 return Wording83_Name;
405 elsif Canonical_Name = "inconsistent95name" then
406 return Inconsistent95_Name;
407 elsif Canonical_Name = "incompatible95name" then
408 return Incompatible95_Name;
409 elsif Canonical_Name = "extend95name" then
410 return Extend95_Name;
411 elsif Canonical_Name = "diffword95name" then
412 return Wording95_Name;
413 elsif Canonical_Name = "inconsistent2005name" then
414 return Inconsistent2005_Name;
415 elsif Canonical_Name = "incompatible2005name" then
416 return Incompatible2005_Name;
417 elsif Canonical_Name = "extend2005name" then
418 return Extend2005_Name;
419 elsif Canonical_Name = "diffword2005name" then
420 return Wording2005_Name;
421 elsif Canonical_Name = "inconsistent2012name" then
422 return Inconsistent2012_Name;
423 elsif Canonical_Name = "incompatible2012name" then
424 return Incompatible2012_Name;
425 elsif Canonical_Name = "extend2012name" then
426 return Extend2012_Name;
427 elsif Canonical_Name = "diffword2012name" then
428 return Wording2012_Name;
429 elsif Canonical_Name = "syntaxtitle" then
430 return Syntax_Title;
431 elsif Canonical_Name = "resolutiontitle" then
432 return Resolution_Title;
433 elsif Canonical_Name = "legalitytitle" then
434 return Legality_Title;
435 elsif Canonical_Name = "staticsemtitle" then
436 return Static_Title;
437 elsif Canonical_Name = "linktimetitle" then
438 return Link_Title;
439 elsif Canonical_Name = "runtimetitle" then
440 return Run_Title;
441 elsif Canonical_Name = "boundedtitle" then
442 return Bounded_Title;
443 elsif Canonical_Name = "errontitle" then
444 return Erroneous_Title;
445 elsif Canonical_Name = "implreqtitle" then
446 return Req_Title;
447 elsif Canonical_Name = "docreqtitle" then
448 return Doc_Title;
449 elsif Canonical_Name = "metricstitle" then
450 return Metrics_Title;
451 elsif Canonical_Name = "implpermtitle" then
452 return Permission_Title;
453 elsif Canonical_Name = "impladvicetitle" then
454 return Advice_Title;
455 elsif Canonical_Name = "notestitle" then
456 return Notes_Title;
457 elsif Canonical_Name = "singlenotetitle" then
458 return Single_Note_Title;
459 elsif Canonical_Name = "examplestitle" then
460 return Examples_Title;
461 elsif Canonical_Name = "metarulestitle" then
462 return Meta_Title;
463 elsif Canonical_Name = "inconsistent83title" then
464 return Inconsistent83_Title;
465 elsif Canonical_Name = "incompatible83title" then
466 return Incompatible83_Title;
467 elsif Canonical_Name = "extend83title" then
468 return Extend83_Title;
469 elsif Canonical_Name = "diffword83title" then
470 return Wording83_Title;
471 elsif Canonical_Name = "inconsistent95title" then
472 return Inconsistent95_Title;
473 elsif Canonical_Name = "incompatible95title" then
474 return Incompatible95_Title;
475 elsif Canonical_Name = "extend95title" then
476 return Extend95_Title;
477 elsif Canonical_Name = "diffword95title" then
478 return Wording95_Title;
479 elsif Canonical_Name = "inconsistent2005title" then
480 return Inconsistent2005_Title;
481 elsif Canonical_Name = "incompatible2005title" then
482 return Incompatible2005_Title;
483 elsif Canonical_Name = "extend2005title" then
484 return Extend2005_Title;
485 elsif Canonical_Name = "diffword2005title" then
486 return Wording2005_Title;
487 elsif Canonical_Name = "inconsistent2012title" then
488 return Inconsistent2012_Title;
489 elsif Canonical_Name = "incompatible2012title" then
490 return Incompatible2012_Title;
491 elsif Canonical_Name = "extend2012title" then
492 return Extend2012_Title;
493 elsif Canonical_Name = "diffword2012title" then
494 return Wording2012_Title;
495 elsif Canonical_Name = "em" then
496 return EM_Dash;
497 elsif Canonical_Name = "en" then
498 return EN_Dash;
499 elsif Canonical_Name = "lt" then
500 return LT;
501 elsif Canonical_Name = "leq" then
502 return LE;
503 elsif Canonical_Name = "gt" then
504 return GT;
505 elsif Canonical_Name = "geq" then
506 return GE;
507 elsif Canonical_Name = "neq" then
508 return NE;
509 elsif Canonical_Name = "pi" then
510 return PI;
511 elsif Canonical_Name = "times" then
512 return Times;
513 elsif Canonical_Name = "porm" then
514 return PorM;
515 elsif Canonical_Name = "singlequote" then
516 return Single_Quote;
517 elsif Canonical_Name = "latin1" then
518 return LATIN_1;
519 elsif Canonical_Name = "unicode" then
520 return Unicode;
521 elsif Canonical_Name = "ceiling" then
522 return Ceiling;
523 elsif Canonical_Name = "floor" then
524 return Floor;
525 elsif Canonical_Name = "abs" then
526 return Absolute;
527 elsif Canonical_Name = "log" then
528 return Log;
529 elsif Canonical_Name = "thin" then
530 return Thin_Space;
531 elsif Canonical_Name = "lquote" then
532 return Left_Quote;
533 elsif Canonical_Name = "lquotes" then
534 return Left_Quote_Pair;
535 elsif Canonical_Name = "ldquote" then
536 return Left_Double_Quote;
537 elsif Canonical_Name = "rquote" then
538 return Right_Quote;
539 elsif Canonical_Name = "rquotes" then
540 return Right_Quote_Pair;
541 elsif Canonical_Name = "rdquote" then
542 return Right_Double_Quote;
543 elsif Canonical_Name = "smldotlessi" then
544 return Small_Dotless_I;
545 elsif Canonical_Name = "capdottedi" then
546 return Capital_Dotted_I;
547 else
548 return Unknown;
549 end if;
550 end Command;
551
552 end ARM_Format.Data;