yast2-core
|
#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 |
Definition of "definition point" which stores
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 |
||
) |
References line(), toString(), and y2debug.
Referenced by mem_size(), and Point().
Point::Point | ( | SymbolEntryPtr | sentry, |
int | line = 0 , |
||
const Point * | point = 0 |
||
) |
References line(), toString(), and y2debug.
Point::Point | ( | bytecodeistream & | str | ) |
References m_point, Point(), Bytecode::readBool(), toString(), and y2debug.
Point::~Point | ( | void | ) |
Referenced by mem_size().
std::string Point::filename | ( | void | ) | const |
References m_entry.
Referenced by YBlock::filename(), mem_size(), yyerror_with_tableentry(), and yywarning_with_tableentry().
int Point::line | ( | void | ) | const |
References m_line.
Referenced by mem_size(), Point(), TableEntry::toString(), and yyerror_with_tableentry().
|
inline |
References filename(), line(), Point(), point(), sentry(), str, toStream(), toString(), toXml(), and ~Point().
const Point * Point::point | ( | void | ) | const |
References m_point.
Referenced by YBlock::endInclude(), TableEntry::makeDefinition(), mem_size(), yyerror_with_tableentry(), and yywarning_with_tableentry().
SymbolEntryPtr Point::sentry | ( | void | ) | const |
References m_entry.
Referenced by TableEntry::makeDefinition(), and mem_size().
std::ostream & Point::toStream | ( | std::ostream & | str | ) | const |
References m_entry, m_line, m_point, str, toStream(), toString(), Bytecode::writeBool(), Bytecode::writeEntry(), Bytecode::writeInt32(), and y2debug.
Referenced by mem_size(), toStream(), TableEntry::toStream(), and YBlock::toStream().
std::string Point::toString | ( | void | ) | const |
References m_entry, m_line, m_point, and toString().
Referenced by YBlock::endInclude(), TableEntry::makeDefinition(), mem_size(), 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 mem_size(), toXml(), TableEntry::toXml(), and YBlock::toXml().
|
private |
Referenced by filename(), sentry(), toStream(), toString(), and toXml().
|
private |
Referenced by line(), toStream(), toString(), and toXml().
|
private |
Referenced by Point(), point(), toStream(), toString(), and toXml().