--  Warning: This file is automatically generated by AFLEX.
--           It is useless to modify it. Change the ".Y" & ".L" files instead.
--  Template: templates/body-reentrant-dfa.adb
package body ${NAME}_DFA is

   --  Nov 2002. Fixed insufficient buffer size bug causing
   --  damage to comments at about the 1000-th character

   function YYText (Context : in Context_Type) return String is
      J : Integer := Context.yytext_ptr;
   begin
      while J <= Context.yy_ch_buf'Last and then Context.yy_ch_buf (J) /= ASCII.NUL loop
         J := J + 1;
      end loop;

      declare
         subtype Sliding_Type is String (1 .. J - Context.yytext_ptr);
      begin
         return Sliding_Type (Context.yy_ch_buf (Context.yytext_ptr .. J - 1));
      end;
   end YYText;

   --  Returns the length of the matched text

   function YYLength (Context : in Context_Type) return Integer is
   begin
      return Context.yy_cp - Context.yy_bp;
   end YYLength;

   --  Done after the current pattern has been matched and before the
   --  corresponding action - sets up yytext

   procedure YY_DO_BEFORE_ACTION (Context : in out Context_Type) is
   begin
      Context.yytext_ptr := Context.yy_bp;
      Context.yy_hold_char := Context.yy_ch_buf (Context.yy_cp);
      Context.yy_ch_buf (Context.yy_cp) := ASCII.NUL;
      Context.yy_c_buf_p := Context.yy_cp;
   end YY_DO_BEFORE_ACTION;

end ${NAME}_DFA;
