Hosted by
|
with Readers; use Readers;
with Real_Numbers; use Real_Numbers;
with Strings; use Strings;
with Ada.Strings.Maps; use Ada.Strings.Maps;
package Token_Readers is
HT : Character := Character'Val(9);
CR : Character := Character'Val(13);
SP : Character := Character'Val(32);
type Token_Reader is
new Reader with
record
Whitespace : Character_Set := To_Set(HT & CR & SP);
Word_Separators : Character_Set := To_Set(HT & CR & SP);
String_Quote : Character := '"';
Token : String_Access;
end record;
type Token_Reader_Access is access Token_Reader;
procedure Initialize_Token_Reader
(This : access Token_Reader'Class);
procedure Initialize_Token_Reader
(This : access Token_Reader'Class;
Filename : in String);
procedure Finalize_Token_Reader
(This : access Token_Reader'Class);
function Current_Input
return Token_Reader_Access;
function Open
(Filename : in String)
return Token_Reader_Access;
procedure Close
(This : in out Token_Reader_Access);
function Found_Whitespace
(This : access Token_Reader'Class)
return Boolean;
procedure Skip_Whitespace
(This : access Token_Reader'Class);
function Read_Word
(This : access Token_Reader'Class)
return String;
function Read_Real
(This : access Token_Reader'Class)
return Real;
function Read_String
(This : access Token_Reader'Class)
return String;
procedure Read_Token
(This : access Token_Reader'Class);
function Read_Token
(This : access Token_Reader'Class)
return String;
function Get_Token
(This : access Token_Reader'Class)
return String;
procedure Set_Token
(This : access Token_Reader'Class;
Token : in String);
function Found
(This : access Token_Reader'Class;
Token : in String)
return Boolean;
end Token_Readers;
|