adayaml_0.3.0_ab19e387/Parser_Tools/src/interface/lexer-source-text_io.ads

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--  part of ParserTools, (c) 2017 Felix Krause
--  released under the terms of the MIT license, see the file "copying.txt"

with Ada.Text_IO;

package Lexer.Source.Text_IO is
   --  this package provides a source type that is backed by Ada.Text_IO's file
   --  type. the primary use-case is to read from stdin. use Yaml.Sources.Files
   --  for standard files, it is more efficient.

   type Instance is new Source.Instance with private;

   overriding procedure Read_Data (S : in out Instance; Buffer : out String;
                                   Length : out Natural);

   function As_Source (File : Ada.Text_IO.File_Access) return Pointer
     with Pre => Ada.Text_IO.Is_Open (File.all);

private
   type Instance is new Source.Instance with record
      File_Pointer : Ada.Text_IO.File_Access;
   end record;
end Lexer.Source.Text_IO;