--  Warning: This file is automatically generated by AFLEX.
--           It is useless to modify it. Change the ".Y" & ".L" files instead.
--  Template: templates/spec-io.ads
with Ada.Text_IO;
with ${NAME}_DFA; use ${NAME}_DFA;
%if private
package ${NAME}_IO is
%else
package ${NAME}_IO is
%end

   user_input_file       : Ada.Text_IO.File_Type;
%if output
   user_output_file      : Ada.Text_IO.File_Type;
%end
   NULL_IN_INPUT         : exception;
   AFLEX_INTERNAL_ERROR  : exception;
   UNEXPECTED_LAST_MATCH : exception;
   PUSHBACK_OVERFLOW     : exception;
   AFLEX_SCANNER_JAMMED  : exception;
   type eob_action_type is (EOB_ACT_RESTART_SCAN,
                            EOB_ACT_END_OF_FILE,
                            EOB_ACT_LAST_MATCH);
   YY_END_OF_BUFFER_CHAR : constant Character := ASCII.NUL;
   yy_n_chars            : Integer;       --  number of characters read into yy_ch_buf

   --  true when we've seen an EOF for the current input file
   yy_eof_has_been_seen  : Boolean;

%if error
   --   In order to support YY_Get_Token_Line, we need
   --   a variable to hold current line.
   type String_Ptr is access String;
   Saved_Tok_Line1 : String_Ptr := Null;
   Line_Number_Of_Saved_Tok_Line1 : Integer := 0;
   Saved_Tok_Line2 : String_Ptr := Null;
   Line_Number_Of_Saved_Tok_Line2 : Integer := 0;
   -- Aflex will try to get next buffer before it processs the
   -- last token. Since now Aflex has been changed to accept
   -- one line by one line, the last token in the buffer is
   -- always end_of_line ( or end_of_buffer ). So before the
   -- end_of_line is processed, next line will be retrieved
   -- into the buffer. So we need to maintain two lines,
   -- which line will be returned in Get_Token_Line is
   -- determined according to the line number. It is the same
   -- reason that we can not reinitialize tok_end_col to 0 in
   -- Yy_Input, but we must do it in yylex after we process the
   -- end_of_line.
   Tok_Begin_Line : Integer := 1;
   Tok_End_Line   : Integer := 1;
   Tok_End_Col    : Integer := 0;
   Tok_Begin_Col  : Integer := 0;
   Token_At_End_Of_Line : Boolean := False;
   -- Indicates whether or not last matched token is end_of_line.

%end
   procedure YY_INPUT (buf      : out unbounded_character_array;
                       result   : out Integer;
                       max_size : in Integer);
   function yy_get_next_buffer return eob_action_type;
%if unput
   procedure yyUnput (c : Character; yy_bp : in out Integer);
   procedure Unput (c : Character);
%end
%if input
   function Input return Character;
%end
%if output
   procedure Output (c : Character);
   procedure Output_New_Line;
   function Output_Column return Ada.Text_IO.Count;
%end
%if error
   function Input_Line return Ada.Text_IO.Count;
%end
%if yywrap
   function yyWrap return Boolean;
%end
   procedure Open_Input (fname : in String);
   procedure Close_Input;
%if output
   procedure Create_Output (fname : in String := "");
   procedure Close_Output;
%end
%if error

   procedure Yy_Get_Token_Line ( Yy_Line_String : out String;
                                 Yy_Line_Length : out Natural );
   --  Returnes the entire line in the input, on which the currently
   --  matched token resides.

   function Yy_Line_Number return Natural;
   --  Returns the line number of the currently matched token.
   --  In case a token spans lines, then the line number of the first line
   --  is returned.

   function Yy_Begin_Column return Natural;
   function Yy_End_Column return Natural;
   --  Returns the beginning and ending column positions of the
   --  currently mathched token. If the token spans lines then the
   --  begin column number is the column number on the first line
   --  and the end columne number is the column number on the last line.
%end

end ${NAME}_IO;
