~ubuntu-branches/ubuntu/jaunty/adacontrol/jaunty

« back to all changes in this revision

Viewing changes to src/pfni.adb

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Brenta
  • Date: 2006-10-12 19:17:22 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061012191722-fo5bcn4k5r0iubgd
Tags: 1.5r24-1

* New upstream release.
* debian/control (Depends): add gnat-4.1.
  (Enhances): add gnat-gps.
* debian/adacontrol.gpr: build pfni.
* debian/rules: install the new gnat-gps plug-in, and pfni.
* debian/pfni.1: new.
* patches/gps-integration.patch: new.

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
   ----------------
114
114
 
115
115
   procedure Print_Help is
116
 
      use Ada.Wide_Text_IO;
117
116
   begin
 
117
      Put_Line ("PFNI : Print Full Name Image");
118
118
      Put_Line ("Usage: pfni [-sofd] [-p <project-file>] <unit>[:<line_number>[:<column_number>]] -- <ASIS options>");
119
119
      Put_Line ("   or: pfni -h");
 
120
      New_Line;
 
121
 
 
122
      Put_Line ("Options:");
 
123
      Put_Line ("   -d      enable debug mode");
 
124
      Put_Line ("   -f      full output (each occurrence of names)");
 
125
      Put_Line ("   -h      prints this help message");
 
126
      Put_Line ("   -o      output overloading information");
 
127
      Put_Line ("   -p file specify an emacs ada-mode project file (.adp)");
 
128
      Put_Line ("   -s      process specifications only");
120
129
   end Print_Help;
121
130
 
122
131
   ----------------
183
192
   is
184
193
      pragma Unreferenced (State);
185
194
      use Asis.Text;
 
195
      Pref : Asis.Expression;
186
196
   begin
187
197
      case Element_Kind (Element) is
188
198
         when An_Expression =>
189
199
            case Expression_Kind (Element) is
190
200
               when An_Attribute_Reference =>
191
201
                  if Full_Option then
192
 
                     Print_Name (Prefix (Element));
 
202
                     Pref := Prefix (Element);
 
203
                     if Expression_Kind (Pref) = A_Selected_Component then
 
204
                        Pref := Selector (Pref);
 
205
                     end if;
 
206
                     Print_Name (Pref);
193
207
                  end if;
194
208
                  -- Do not recurse into the attribute name itself
195
209
                  Control := Abandon_Children;
242
256
   The_Control    : Traverse_Control := Continue;
243
257
   The_Info       : Info;
244
258
 
245
 
   use Ada.Wide_Text_IO, Ada.Characters.Handling, Asis.Exceptions;
 
259
   use Ada.Characters.Handling, Asis.Exceptions;
246
260
   use Implementation_Options;
247
261
   use Ada.Strings.Wide_Unbounded;
248
262
begin
312
326
            User_Message ("Inconsistent tree, please remove *.adt files");
313
327
         when others =>
314
328
            Asis_Exception_Messages;
 
329
            if Debug_Option then
 
330
               raise;
 
331
            end if;
315
332
      end case;
316
333
   when ASIS_Inappropriate_Compilation_Unit =>
317
334
      User_Message ("Unit " & To_Wide_String (Unit_Spec.File_Name) & " not found in context");
318
335
   when
319
 
     ASIS_Inappropriate_Context          |
320
 
     ASIS_Inappropriate_Container        |
321
 
     ASIS_Inappropriate_Element          |
322
 
     ASIS_Inappropriate_Line             |
323
 
     ASIS_Inappropriate_Line_Number      =>
 
336
     ASIS_Inappropriate_Context
 
337
     | ASIS_Inappropriate_Container
 
338
     | ASIS_Inappropriate_Element
 
339
     | ASIS_Inappropriate_Line
 
340
     | ASIS_Inappropriate_Line_Number
 
341
     =>
324
342
      Asis_Exception_Messages;
 
343
      if Debug_Option then
 
344
         raise;
 
345
      end if;
325
346
 
326
347
end Pfni;