~ubuntu-branches/ubuntu/oneiric/gnat-gps/oneiric

« back to all changes in this revision

Viewing changes to templates_parser/src/templates_parser-debug.adb

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna
  • Date: 2008-08-18 12:35:49 UTC
  • mfrom: (10.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20080818123549-dp25qi8lg9f0x14t
Tags: 4.3~2008.08.09ubuntu1
Add lpia to supported architectures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
------------------------------------------------------------------------------
2
 
------------------------------------------------------------------------------
3
 
 
4
 
with Ada.Text_IO;
5
 
with Ada.Strings.Fixed;
6
 
 
7
 
package body Templates_Parser.Debug is
8
 
 
9
 
   use Ada.Text_IO;
10
 
   use Ada.Strings.Fixed;
11
 
 
12
 
   -----------
13
 
   -- Print --
14
 
   -----------
15
 
 
16
 
   procedure Print (T : in Tag) is
17
 
 
18
 
      procedure Print (T : in Tag; K : Natural);
19
 
      --  Print tag T, K is the indent level
20
 
 
21
 
      -----------
22
 
      -- Print --
23
 
      -----------
24
 
 
25
 
      procedure Print (T : in Tag; K : Natural) is
26
 
         Indent : constant String := K * ' ';
27
 
         N      : Tag_Node_Access := T.Data.Head;
28
 
      begin
29
 
         Put (Indent);
30
 
         Put_Line
31
 
           ("(N=" & Natural'Image (T.Data.Count)
32
 
            & ", Min=" & Natural'Image (T.Data.Min)
33
 
            & ", Max=" & Natural'Image (T.Data.Max)
34
 
            & ", Nested_Level=" & Natural'Image (T.Data.Nested_Level));
35
 
 
36
 
         while N /= null loop
37
 
            if N.Kind = Value then
38
 
               Put_Line (Indent & Indent & To_String (N.V));
39
 
            else
40
 
               Print (N.VS.all, K + 1);
41
 
            end if;
42
 
            N := N.Next;
43
 
         end loop;
44
 
 
45
 
         Put_Line (Indent & ")");
46
 
      end Print;
47
 
 
48
 
   begin
49
 
      Print (T, 1);
50
 
   end Print;
51
 
 
52
 
   ----------------
53
 
   -- Print_Tree --
54
 
   ----------------
55
 
 
56
 
   procedure Print_Tree (Filename : in String) is
57
 
   begin
58
 
      Templates_Parser.Print_Tree (Filename);
59
 
   end Print_Tree;
60
 
 
61
 
end Templates_Parser.Debug;