file_info.hh

Go to the documentation of this file.
00001 /*
00002    The lestes compiler suite
00003    Copyright (C) 2002, 2003, 2004, 2005 Miroslav Tichy
00004    Copyright (C) 2002, 2003, 2004, 2005 Petr Zika
00005    Copyright (C) 2002, 2003, 2004, 2005 Vojtech Hala
00006    Copyright (C) 2002, 2003, 2004, 2005 Jiri Kosina
00007    Copyright (C) 2002, 2003, 2004, 2005 Pavel Sanda
00008    Copyright (C) 2002, 2003, 2004, 2005 Jan Zouhar
00009    Copyright (C) 2002, 2003, 2004, 2005 Rudolf Thomas
00010 
00011    This program is free software; you can redistribute it and/or modify
00012    it under the terms of the GNU General Public License as published by
00013    the Free Software Foundation; version 2 of the License.
00014 
00015    This program is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018    GNU General Public License for more details.
00019 
00020    See the full text of the GNU General Public License version 2, and
00021    the limitations in the file doc/LICENSE.
00022 
00023    By accepting the license the licensee waives any and all claims
00024    against the copyright holder(s) related in whole or in part to the
00025    work, its use, and/or the inability to use it.
00026  
00027  */
00028 #ifndef lestes__std___file_info_hh___included
00029 #define lestes__std___file_info_hh___included
00030 
00031 /*! \file
00032   \brief Source file information.
00033   
00034   Declaration of file_info class representing information about source file.
00035 */
00036 #include <lestes/std/object.hh>
00037 
00038 package(lestes);
00039 package(std);
00040 
00041 // forward declaration to break cycle
00042 class source_location;
00043 
00044 /*!
00045   \brief Source file information.
00046   
00047   Represents information about file inside the inclusion chain.
00048   The first source has NULL origin.
00049 */  
00050 class file_info: public object {
00051 public:
00052         //! Type of file name.
00053         typedef lstring name_type;   
00054         //! Returns file name.
00055         name_type name_get(void) const;
00056         //! Returns inclusion origin.
00057         ptr<source_location> origin_get(void) const;
00058         //! Tests equality.
00059         bool equals(const ptr<file_info> &rhs) const;
00060         //! Returns file info initialized with file name and origin.
00061         static ptr<file_info> create(const name_type &a_name,
00062                                 const ptr<source_location> &a_origin);
00063 protected:   
00064         //! Creates the object, initializes with file name and origin.
00065         file_info(const lstring &a_name, const ptr<source_location> &a_origin);
00066         //! Marking routine.
00067         void gc_mark();
00068 private:
00069         //! Name of the file.
00070         lstring name;
00071         //! Origin of inclusion.
00072         srp<source_location> origin;
00073         //! Hides copy constructor.
00074         file_info(const file_info &);
00075         //! Hides assingment operator.
00076         file_info &operator=(const file_info &);
00077 };
00078 
00079 end_package(std);
00080 end_package(lestes);
00081 
00082 #endif
00083 /* vim: set ft=lestes : */

Generated on Mon Feb 12 18:22:33 2007 for lestes by doxygen 1.5.1-20070107