~ubuntu-branches/ubuntu/wily/aspectc++/wily

« back to all changes in this revision

Viewing changes to Puma/src/infos/CSourceInfo.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2005-12-23 10:49:40 UTC
  • Revision ID: james.westby@ubuntu.com-20051223104940-ig4klhoi991zs7km
Tags: upstream-0.99+1.0pre2
ImportĀ upstreamĀ versionĀ 0.99+1.0pre2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// This file is part of PUMA.
 
2
// Copyright (C) 1999-2003  The PUMA developer team.
 
3
//                                                                
 
4
// This program is free software;  you can redistribute it and/or 
 
5
// modify it under the terms of the GNU General Public License as 
 
6
// published by the Free Software Foundation; either version 2 of 
 
7
// the License, or (at your option) any later version.            
 
8
//                                                                
 
9
// This program is distributed in the hope that it will be useful,
 
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
 
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
 
12
// GNU General Public License for more details.                   
 
13
//                                                                
 
14
// You should have received a copy of the GNU General Public      
 
15
// License along with this program; if not, write to the Free     
 
16
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
 
17
// MA  02111-1307  USA                                            
 
18
 
 
19
#ifndef __CSourceInfo_h__
 
20
#define __CSourceInfo_h__
 
21
 
 
22
// stores source file information
 
23
// knows the file and the start token where an entity
 
24
// was declared in a program
 
25
 
 
26
namespace Puma {
 
27
 
 
28
 
 
29
class CFileInfo;
 
30
class CT_Token;
 
31
class Token;
 
32
class Unit;
 
33
 
 
34
class CSourceInfo {
 
35
  CFileInfo *_FileInfo; 
 
36
  CT_Token *_StartToken;
 
37
 
 
38
public: 
 
39
  CSourceInfo ();
 
40
  ~CSourceInfo ();
 
41
  
 
42
  bool operator ==(const CSourceInfo &) const;
 
43
  bool operator !=(const CSourceInfo &) const;
 
44
  bool operator <(const CSourceInfo &) const;
 
45
  bool operator >(const CSourceInfo &) const;
 
46
  bool operator <=(const CSourceInfo &) const;
 
47
  bool operator >=(const CSourceInfo &) const;
 
48
 
 
49
  bool operator ==(const CT_Token *) const;
 
50
  bool operator !=(const CT_Token *) const;
 
51
  bool operator <(const CT_Token *) const;
 
52
  bool operator >(const CT_Token *) const;
 
53
  bool operator <=(const CT_Token *) const;
 
54
  bool operator >=(const CT_Token *) const;
 
55
 
 
56
  bool operator ==(const Token *) const;
 
57
 
 
58
  // Get ...
 
59
  CFileInfo *FileInfo () const;
 
60
  CT_Token *StartToken () const;
 
61
  const char *FileName () const; // the file where it is located
 
62
  int Line () const;
 
63
  Unit *SrcUnit () const;
 
64
 
 
65
  // Set ... 
 
66
  void FileInfo (CFileInfo *);
 
67
  void StartToken (CT_Token *);
 
68
};
 
69
 
 
70
inline CSourceInfo::CSourceInfo () :
 
71
  _FileInfo ((CFileInfo*)0),
 
72
  _StartToken ((CT_Token*)0)
 
73
 {}
 
74
 
 
75
inline CSourceInfo::~CSourceInfo ()
 
76
 {}
 
77
 
 
78
inline bool CSourceInfo::operator !=(const CSourceInfo &info) const 
 
79
 { return ! (*this == info); }
 
80
inline bool CSourceInfo::operator <=(const CSourceInfo &info) const 
 
81
 { return ! (*this > info); }
 
82
inline bool CSourceInfo::operator >=(const CSourceInfo &info) const 
 
83
 { return ! (*this < info); }
 
84
 
 
85
inline bool CSourceInfo::operator !=(const CT_Token *token) const 
 
86
 { return ! (*this == token); }
 
87
inline bool CSourceInfo::operator <=(const CT_Token *token) const 
 
88
 { return ! (*this > token); }
 
89
inline bool CSourceInfo::operator >=(const CT_Token *token) const 
 
90
 { return ! (*this < token); }
 
91
 
 
92
inline CFileInfo *CSourceInfo::FileInfo () const
 
93
 { return _FileInfo; }
 
94
inline CT_Token *CSourceInfo::StartToken () const
 
95
 { return _StartToken; }
 
96
 
 
97
inline void CSourceInfo::FileInfo (CFileInfo *info)
 
98
 { _FileInfo = info; }
 
99
inline void CSourceInfo::StartToken (CT_Token *token)
 
100
 { _StartToken = token; }
 
101
 
 
102
 
 
103
} // namespace Puma
 
104
 
 
105
#endif /* __CSourceInfo_h__ */