1
// This file is part of PUMA.
2
// Copyright (C) 1999-2003 The PUMA developer team.
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.
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.
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,
19
#ifndef __CSourceInfo_h__
20
#define __CSourceInfo_h__
22
// stores source file information
23
// knows the file and the start token where an entity
24
// was declared in a program
36
CT_Token *_StartToken;
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;
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;
56
bool operator ==(const Token *) const;
59
CFileInfo *FileInfo () const;
60
CT_Token *StartToken () const;
61
const char *FileName () const; // the file where it is located
63
Unit *SrcUnit () const;
66
void FileInfo (CFileInfo *);
67
void StartToken (CT_Token *);
70
inline CSourceInfo::CSourceInfo () :
71
_FileInfo ((CFileInfo*)0),
72
_StartToken ((CT_Token*)0)
75
inline CSourceInfo::~CSourceInfo ()
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); }
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); }
92
inline CFileInfo *CSourceInfo::FileInfo () const
94
inline CT_Token *CSourceInfo::StartToken () const
95
{ return _StartToken; }
97
inline void CSourceInfo::FileInfo (CFileInfo *info)
99
inline void CSourceInfo::StartToken (CT_Token *token)
100
{ _StartToken = token; }
105
#endif /* __CSourceInfo_h__ */