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

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

private with Ada.Streams.Stream_IO;
private with Ada.Directories;

package Lexer.Source.File is
   --  this provides streams which are backed by files on the file system.

   type Instance is new Source.Instance with private;

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

   overriding procedure Finalize (Object : in out Instance);

   function As_Source (File_Path : String) return Pointer;

private
   type Instance is new Source.Instance with record
      File   : Ada.Streams.Stream_IO.File_Type;
      Stream : Ada.Streams.Stream_IO.Stream_Access;
      Input_At, Input_Length : Ada.Directories.File_Size;
   end record;
end Lexer.Source.File;