File: screen_output.adb

package info (click to toggle)
gnat-gps 4.3-5
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 49,096 kB
  • ctags: 20,461
  • sloc: ada: 274,120; ansic: 154,849; python: 9,890; tcl: 9,812; sh: 8,192; xml: 7,970; cpp: 4,737; yacc: 3,520; makefile: 2,136; lex: 2,043; java: 1,638; perl: 302; awk: 265; sed: 161; asm: 14; fortran: 2; lisp: 1
file content (95 lines) | stat: -rw-r--r-- 1,801 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
with Ada.Text_IO; use Ada.Text_IO;
with Input;

package body Screen_Output is

   ----------------
   -- Local Data --
   ----------------

   Debug_On : constant Boolean := False;
   --  When set, debugging information messages are output on the screen.

   ---------
   -- Msg --
   ---------

   procedure Msg
     (S1       : String;
      S2       : String  := "";
      End_Line : Boolean := True)
   is
   begin
      Put (S1);
      Put (S2);
      if End_Line then
         New_Line;
      end if;
   end Msg;

   ---------------
   -- Debug_Msg --
   ---------------

   procedure Debug_Msg (S : String) is
   begin
      if not Debug_On then
         return;
      end if;

      Put ("DEBUG: ");
      Put (S);
      New_Line;
   end Debug_Msg;

   ---------------
   -- Error_Msg --
   ---------------

   procedure Error_Msg (S1 : String; S2 : String := ""; S3 : String := "") is
   begin
      Put ("sdc error at line");
      Put (Natural'Image (Input.Line_Number) & ": ");
      Put (S1);
      Put (S2);
      Put (S3);
      New_Line;
   end Error_Msg;

   ------------------
   -- Syntax_Error --
   ------------------

   procedure Syntax_Error (S : String; Error_Pos : Natural := 0) is
      Pos : Natural := Error_Pos;

   begin
      if Pos = 0 then
         Pos := Input.Column_Number;
      end if;

      Put ("sdc:");
      Put_Line (Input.Current_Line);

      Put ("sdc:");
      for I in 1 .. Pos - 1 loop
         Put ("-");
      end loop;

      Put_Line ("!");
      Put ("sdc input error at line");
      Put (Natural'Image (Input.Line_Number) & ": " & S);
      New_Line;
   end Syntax_Error;

   -----------
   -- Pause --
   -----------

   procedure Pause is
   begin
      Put ("Press a key to continue...");
      Skip_Line;
   end Pause;

end Screen_Output;