





--------------------------------
--                            --
-- Parser generated by Coco/R --
--                            --
--------------------------------

with  Sets;
with  FileIO;


package CRP is

   procedure Parse;

   --
   -- Returns TRUE if no errors have been recorded while parsing
   --
   function Successful return Boolean;

   --
   -- Report syntax error errNo
   --
   procedure Syntax_Error (errNo: in     Integer);

   --
   -- Report semantic error errNo
   --
   procedure Semantic_Error (errNo: in     Integer);

   --
   -- Retrieves Lex as exact spelling of current token
   --
   procedure Lex_String (Lex:    out FileIO.String_Ptr);

   --
   -- Retrieves Lex as name of current token (capitalized if IGNORE CASE)
   --
   procedure Lex_Name (Lex:    out FileIO.String_Ptr);

   --
   -- Retrieves Lex as exact spelling of lookahead token
   --
   procedure Look_Ahead_Name (Lex:    out FileIO.String_Ptr);

   --
   -- Retrieves Lex as name of lookahead token (capitalized if IGNORE CASE)
   --
   procedure Look_Ahead_String (Lex:    out FileIO.String_Ptr);


private

   subtype CARDINAL  is FileIO.CARDINAL;
   subtype INT32     is FileIO.INT32;

   maxT : constant := 41;
   maxP : constant := 42;
   minErrDist  : constant :=  2; -- minimal distance (good tokens) between two errors
   setsize     : constant := 16; -- sets are stored in 16 bits


   subtype  SymbolSet   is Sets.BitArray (0 .. maxT / setsize);


  symSet    : array (Integer range 0 ..  18) of SymbolSet;  -- symSet (0) = allSyncSyms
  errDist   : CARDINAL;    -- number of symbols recognized since last error
  sym       : CARDINAL;    -- current input symbol

end CRP;





