Hosted by
|
with Ada.Text_IO; use Ada.Text_IO;
with Strings; use Strings;
package Readers is
type Reader is tagged limited record
Filename : String_Access;
File : File_Type;
Line_Number : Positive := 1;
Column : Positive := 1;
Char : Character;
end record;
type Reader_Access is access Reader;
procedure Initialize_Reader
(This : access Reader'Class);
procedure Initialize_Reader
(This : access Reader'Class;
Filename : in String);
procedure Finalize_Reader
(This : access Reader'Class);
function Current_Input
return Reader_Access;
function Open
(Filename : in String)
return Reader_Access;
procedure Close
(This : in out Reader_Access);
function End_Of_Line
(This : access Reader'Class)
return Boolean;
function End_Of_File
(This : access Reader'Class)
return Boolean;
procedure Get
(This : access Reader'Class);
Syntax_Error : exception;
procedure Error
(This : access Reader'Class;
Message : in String);
function "/"
(A, B : in String)
return String;
procedure Expect_Error
(This : access Reader'Class;
Found : in String;
Choices : in String);
function Get_Char
(This : access Reader'Class)
return Character;
function Found_Char
(This : access Reader'Class;
Char : in Character)
return Boolean;
procedure Assert_Char
(This : access Reader'Class;
Char : in Character);
end Readers;
|