with the beta version 4.5.3b2265, libraries,procedures, functions and types are
correctly identified. Variable/Constant definition and usage is not. Here are
some sample code pieces.
PACKAGE My_Int_Io IS NEW Text_Io.Integer_Io (Integer);
RowBound : Constant INTEGER := 9;
ColBound : Constant CHARACTER := 'O';
LayerBound : Constant INTEGER := 5;
FileName : Constant STRING (1..7) := "test.sav"; -- the OS filename
package stack_package is
type stack (max_size : positive) is limited private;
stack_empty : exception;
stack_full : exception;
function number_of_objects (the_stack : stack) return natural;
generic
with procedure process (the_object : object_type);
procedure iterate (the_stack : stack);
procedure copy (the_stack : stack; the_copy : in out stack);
generic
with function delete_this_object (the_object : object_type)
return boolean;
procedure prune_stack (the_stack : in out stack);
private
type array_of_objects is array (positive range <>) of object_type;
type stack (max_size : positive) is record
latest : natural := 0;
objects : array_of_objects (1 .. max_size);
end record;
end stack_package;
package body stack_package is
procedure push (the_stack : in out stack; the_object : object_type) is
begin
the_stack.objects(the_stack.latest + 1) := the_object;
the_stack.latest := the_stack.latest + 1;
exception
when constraint_error => raise stack_full;
end push;
procedure pop (the_stack : in out stack) is
begin
the_stack.latest := the_stack.latest - 1;
exception
when constraint_error | numeric_error => raise stack_empty;
end pop;
function top (the_stack : stack) return object_type is
begin
return the_stack.objects(the_stack.latest);
exception
when constraint_error => raise stack_empty;
end top;
procedure clear (the_stack : in out stack) is
begin
the_stack.latest := 0;
end Clear;
function number_of_objects (the_stack : stack) return natural is
begin
return the_stack.latest;
end number_of_objects;
procedure iterate (the_stack : stack) is
begin
for index in 1 .. the_stack.latest loop
process (the_stack.objects(index));
end loop;
end iterate;
procedure copy (the_stack : stack; the_copy : in out stack) is
begin
if the_copy.max_size < the_stack.latest then
raise stack_full;
else
the_copy.objects(1 .. the_stack.latest) :=
the_stack.objects(1 .. the_stack.latest);
the_copy.latest := the_stack.latest;
end if;
end copy;
procedure prune_stack (the_stack : in out stack) is
destination : natural := 0;
begin
for k in 1 .. the_stack.latest loop
if not delete_this_object(the_stack.objects(k)) then
destination := destination + 1;
the_stack.objects(destination) := the_stack.objects(k);
end if;
end loop;
the_stack.latest := destination;
end prune_stack;
end stack_package;
--
<http://forum.pspad.com/read.php?2,41364,41379>
PSPad freeware editor http://www.pspad.com