home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / gnat-2.06-src.tgz / tar.out / fsf / gnat / ada / scans.adb < prev    next >
Text File  |  1996-09-28  |  4KB  |  64 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --                                S C A N S                                 --
  6. --                                                                          --
  7. --                                 B o d y                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.8 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25. package body Scans is
  26.  
  27.    ---------------------
  28.    -- Save_Scan_State --
  29.    ---------------------
  30.  
  31.    procedure Save_Scan_State (Saved_State : out Saved_Scan_State) is
  32.    begin
  33.       Saved_State.Save_Scan_Ptr                 := Scan_Ptr;
  34.       Saved_State.Save_Token                    := Token;
  35.       Saved_State.Save_Token_Ptr                := Token_Ptr;
  36.       Saved_State.Save_Current_Line_Start       := Current_Line_Start;
  37.       Saved_State.Save_Start_Column             := Start_Column;
  38.       Saved_State.Save_First_Non_Blank_Location := First_Non_Blank_Location;
  39.       Saved_State.Save_Token_Node               := Token_Node;
  40.       Saved_State.Save_Token_Name               := Token_Name;
  41.       Saved_State.Save_Prev_Token               := Prev_Token;
  42.       Saved_State.Save_Prev_Token_Ptr           := Prev_Token_Ptr;
  43.    end Save_Scan_State;
  44.  
  45.    ------------------------
  46.    -- Restore_Scan_State --
  47.    ------------------------
  48.  
  49.    procedure Restore_Scan_State (Saved_State : in Saved_Scan_State) is
  50.    begin
  51.       Scan_Ptr                 := Saved_State.Save_Scan_Ptr;
  52.       Token                    := Saved_State.Save_Token;
  53.       Token_Ptr                := Saved_State.Save_Token_Ptr;
  54.       Current_Line_Start       := Saved_State.Save_Current_Line_Start;
  55.       Start_Column             := Saved_State.Save_Start_Column;
  56.       First_Non_Blank_Location := Saved_State.Save_First_Non_Blank_Location;
  57.       Token_Node               := Saved_State.Save_Token_Node;
  58.       Token_Name               := Saved_State.Save_Token_Name;
  59.       Prev_Token               := Saved_State.Save_Prev_Token;
  60.       Prev_Token_Ptr           := Saved_State.Save_Prev_Token_Ptr;
  61.    end Restore_Scan_State;
  62.  
  63. end Scans;
  64.