#include <Point.h>
Public Member Functions | |
size_t | mem_size () const |
Point (std::string filename, int line=0, const Point *point=0) | |
Point (SymbolEntryPtr sentry, int line=0, const Point *point=0) | |
Point (bytecodeistream &str) | |
~Point (void) | |
SymbolEntryPtr | sentry (void) const |
std::string | filename (void) const |
int | line (void) const |
const Point * | point (void) const |
std::string | toString (void) const |
std::ostream & | toStream (std::ostream &str) const |
std::ostream & | toXml (std::ostream &str, int indent) const |
Private Attributes | |
SymbolEntryPtr | m_entry |
int | m_line |
const Point * | m_point |
This helps in issuing proper error messages like "identifier <name> defined in <file1> at <line1> included from <file2> at <line2> included from <toplevel> at <line>"
A TableEntry (identifier <name>) has a Point which stores the definition point (Point) of this identifier. If its Point is in an include file, the m_point member points to the inclusion point (where the 'include ".."' statement is) of the include file.
Point works as a linked list (file1 -> file2 -> toplevel in the above example) for definition points inside include files. The real structure is a tree since for the next include of file3 inside file2, the list is file3 -> file2 -> toplevel and the latter two nodes are shared.
An identifier has a definition point. A file has a filename and an inclusion point (if its an included file).
Point::Point | ( | std::string | filename, | |
int | line = 0 , |
|||
const Point * | point = 0 | |||
) |
Point::Point | ( | SymbolEntryPtr | sentry, | |
int | line = 0 , |
|||
const Point * | point = 0 | |||
) |
References toString(), and y2debug.
Point::Point | ( | bytecodeistream & | str | ) |
References m_point, Point(), Bytecode::readBool(), toString(), and y2debug.
Point::~Point | ( | void | ) |
std::string Point::filename | ( | void | ) | const |
int Point::line | ( | void | ) | const |
size_t Point::mem_size | ( | ) | const [inline] |
const Point * Point::point | ( | void | ) | const |
SymbolEntryPtr Point::sentry | ( | void | ) | const |
std::ostream & Point::toStream | ( | std::ostream & | str | ) | const |
References m_entry, m_line, m_point, toStream(), toString(), Bytecode::writeBool(), Bytecode::writeEntry(), Bytecode::writeInt32(), and y2debug.
Referenced by YBlock::toStream(), TableEntry::toStream(), and toStream().
std::string Point::toString | ( | void | ) | const |
References m_entry, m_line, m_point, and toString().
Referenced by YBlock::endInclude(), TableEntry::makeDefinition(), Point(), toStream(), toString(), and toXml().
std::ostream & Point::toXml | ( | std::ostream & | str, | |
int | indent | |||
) | const |
References m_entry, m_line, m_point, Xmlcode::spaces(), toString(), toXml(), Xmlcode::writeEntry(), and y2debug.
Referenced by YBlock::toXml(), TableEntry::toXml(), and toXml().
SymbolEntryPtr Point::m_entry [private] |
Referenced by filename(), sentry(), toStream(), toString(), and toXml().
int Point::m_line [private] |
Referenced by line(), toStream(), toString(), and toXml().
const Point* Point::m_point [private] |
Referenced by Point(), point(), toStream(), toString(), and toXml().