34
/** \class CSourceInfo CSourceInfo.h Puma/CSourceInfo.h
35
* Source file information for an entity. Stores the
36
* file information and start token of the entity in
34
38
class CSourceInfo {
35
39
CFileInfo *_FileInfo;
36
40
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;
48
/** Check if the source file locations are equal.
49
* \param si The source file location to compare with. */
50
bool operator ==(const CSourceInfo &si) const;
51
/** Check if the source file locations are not equal.
52
* \param si The source file location to compare with. */
53
bool operator !=(const CSourceInfo &si) const;
54
/** Check if this source file location is before the given location.
55
* \param si The source file location to compare with. */
56
bool operator <(const CSourceInfo &si) const;
57
/** Check if this source file location is behind the given location.
58
* \param si The source file location to compare with. */
59
bool operator >(const CSourceInfo &si) const;
60
/** Check if this source file location equals or is before the given location.
61
* \param si The source file location to compare with. */
62
bool operator <=(const CSourceInfo &si) const;
63
/** Check if this source file location equals or is behind the given location.
64
* \param si The source file location to compare with. */
65
bool operator >=(const CSourceInfo &si) const;
67
/** Check if the source file locations are equal.
68
* \param token The token in the source file to compare with. */
69
bool operator ==(const CT_Token *token) const;
70
/** Check if the source file locations are not equal.
71
* \param token The token in the source file to compare with. */
72
bool operator !=(const CT_Token *token) const;
73
/** Check if this source file location is before the given location.
74
* \param token The token in the source file to compare with. */
75
bool operator <(const CT_Token *token) const;
76
/** Check if this source file location is behind the given location.
77
* \param token The token in the source file to compare with. */
78
bool operator >(const CT_Token *token) const;
79
/** Check if this source file location equals or is before the given location.
80
* \param token The token in the source file to compare with. */
81
bool operator <=(const CT_Token *token) const;
82
/** Check if this source file location equals or is behind the given location.
83
* \param token The token in the source file to compare with. */
84
bool operator >=(const CT_Token *token) const;
86
/** Check if the source file locations are equal.
87
* \param token The token in the source file to compare with. */
88
bool operator ==(const Token *token) const;
90
/** Get the source file information. */
59
91
CFileInfo *FileInfo () const;
92
/** Get the start token of the entity in the source file. */
60
93
CT_Token *StartToken () const;
61
const char *FileName () const; // the file where it is located
94
/** Get name of the source file. */
95
const char *FileName () const;
96
/** Get the line number of the entity in the source file. */
98
/** Get the column number of the entity in the source file. */
100
/** Get the token unit of the source file. */
63
101
Unit *SrcUnit () const;
66
void FileInfo (CFileInfo *);
67
void StartToken (CT_Token *);
103
/** Set the source file information.
104
* \param file The source file. */
105
void FileInfo (CFileInfo *file);
106
/** Set the start token of the entity in the source file.
107
* \param token The start token. */
108
void StartToken (CT_Token *token);
70
111
inline CSourceInfo::CSourceInfo () :