Project

General

Profile

Revision 81e2ad2f src/backends/Ada/ada_backend_ads.ml

View differences:

src/backends/Ada/ada_backend_ads.ml
128 128
    (*(Utils.fprintf_list ~sep:"@," pp_var_decl) machine.mmemory*)
129 129

  
130 130
end
131

  
132
(*
133
package Example is
134
     type Number is range 1 .. 11;
135
     procedure Print_and_Increment (j: in out Number);
136
end Example;
137

  
138
Package body (example.adb)
139

  
140
with Ada.Text_IO;
141
package body Example is
142

  
143
  i : Number := Number'First;
144

  
145
  procedure Print_and_Increment (j: in out Number) is
146

  
147
    function Next (k: in Number) return Number is
148
    begin
149
      return k + 1;
150
    end Next;
151

  
152
  begin
153
    Ada.Text_IO.Put_Line ( "The total is: " & Number'Image(j) );
154
    j := Next (j);
155
  end Print_and_Increment;
156

  
157
-- package initialization executed when the package is elaborated
158
begin
159
  while i < Number'Last loop
160
    Print_and_Increment (i);
161
  end loop;
162
end Example;
163
*)

Also available in: Unified diff