#include <StaticDeclaration.h>
Public Member Functions | |
StaticDeclaration () | |
~StaticDeclaration () | |
SymbolTable * | symbolTable () |
const std::list< std::pair < std::string, Y2Namespace * > > & | active_predefined () const |
void | registerDeclarations (const char *filename, declaration_t *declarations) |
declaration_t * | findDeclaration (const char *name) const |
declaration_t * | findDeclaration (const char *name, constTypePtr type, bool partial=false) const |
declaration_t * | findDeclaration (declaration_t *decl, constTypePtr type, bool partial=false) const |
void | dumpDeclarations () const |
std::ostream & | writeDeclaration (std::ostream &str, const declaration_t *decl) const |
std::ostream & | writeXmlDeclaration (std::ostream &str, const declaration_t *decl) const |
declaration_t * | readDeclaration (bytecodeistream &str) const |
Static Public Member Functions | |
static string | Decl2String (const declaration_t *declaration, bool full=false) |
static void | errorNoMatch (Logger *problem_logger, constFunctionTypePtr orig, declaration_t *first_decl) |
Private Attributes | |
SymbolTable * | m_declTable |
std::list< std::pair < std::string, Y2Namespace * > > | m_active_predefined |
StaticDeclaration::StaticDeclaration | ( | ) |
References SymbolEntry::c_predefined, SymbolTable::enter(), m_declTable, predefined, Type::Unspec, and y2debug.
StaticDeclaration::~StaticDeclaration | ( | ) |
References m_declTable.
const std::list<std::pair<std::string, Y2Namespace *> >& StaticDeclaration::active_predefined | ( | ) | const [inline] |
References m_active_predefined.
Referenced by Parser::init().
string StaticDeclaration::Decl2String | ( | const declaration_t * | declaration, | |
bool | full = false | |||
) | [static] |
References declaration::name, declaration::name_space, and declaration::type.
Referenced by errorNoMatch(), YEBuiltin::evaluate(), YEBuiltin::finalize(), findDeclaration(), YEBuiltin::toString(), YEBinary::toString(), and YEUnary::toString().
void StaticDeclaration::dumpDeclarations | ( | ) | const |
void StaticDeclaration::errorNoMatch | ( | Logger * | problem_logger, | |
constFunctionTypePtr | orig, | |||
declaration_t * | first_decl | |||
) | [static] |
References Decl2String(), Logger::error(), declaration::name, TableEntry::next_overloaded(), TableEntry::sentry(), and declaration::tentry.
Referenced by YEBuiltin::finalize().
declaration_t * StaticDeclaration::findDeclaration | ( | declaration_t * | decl, | |
constTypePtr | type, | |||
bool | partial = false | |||
) | const |
declaration_t * StaticDeclaration::findDeclaration | ( | const char * | name, | |
constTypePtr | type, | |||
bool | partial = false | |||
) | const |
References findDeclaration(), and y2debug.
declaration_t * StaticDeclaration::findDeclaration | ( | const char * | name | ) | const |
References SymbolTable::find(), m_declTable, TableEntry::sentry(), TableEntry::table(), and y2debug.
Referenced by YEBuiltin::attachSymVariable(), YEBuiltin::finalize(), findDeclaration(), readDeclaration(), and YSymbolEntry::YSymbolEntry().
declaration_t * StaticDeclaration::readDeclaration | ( | bytecodeistream & | str | ) | const |
References findDeclaration(), Bytecode::readCharp(), Bytecode::readType(), y2debug, and ycp2error.
Referenced by YEBinary::YEBinary(), YEBuiltin::YEBuiltin(), and YEUnary::YEUnary().
void StaticDeclaration::registerDeclarations | ( | const char * | filename, | |
declaration_t * | declarations | |||
) |
References YBlock::b_namespace, Y2Namespace::createTable(), DECL_FLEX, DECL_NAMESPACE, DECL_SYMBOL, DECL_WILD, SymbolTable::enter(), SymbolTable::find(), declaration::flags, Type::fromSignature(), m_active_predefined, m_declTable, declaration::name, declaration::name_space, namespaceTable, SymbolTable::remove(), TableEntry::sentry(), YBlock::setName(), declaration::signature, YBlock::table(), declaration::tentry, declaration::type, Type::Unspec, y2debug, y2error, and y2internal.
Referenced by SCR::SCR(), WFM::WFM(), YCPBuiltinBoolean::YCPBuiltinBoolean(), YCPBuiltinByteblock::YCPBuiltinByteblock(), YCPBuiltinFloat::YCPBuiltinFloat(), YCPBuiltinInteger::YCPBuiltinInteger(), YCPBuiltinList::YCPBuiltinList(), YCPBuiltinMap::YCPBuiltinMap(), YCPBuiltinMisc::YCPBuiltinMisc(), YCPBuiltinMultiset::YCPBuiltinMultiset(), YCPBuiltinPath::YCPBuiltinPath(), YCPBuiltinString::YCPBuiltinString(), YCPBuiltinSymbol::YCPBuiltinSymbol(), YCPBuiltinTerm::YCPBuiltinTerm(), and YCPBuiltinVoid::YCPBuiltinVoid().
SymbolTable* StaticDeclaration::symbolTable | ( | ) | [inline] |
References m_declTable.
Referenced by Scanner::Scanner().
std::ostream & StaticDeclaration::writeDeclaration | ( | std::ostream & | str, | |
const declaration_t * | decl | |||
) | const |
References declaration::name, declaration::name_space, declaration::type, Bytecode::writeCharp(), and y2debug.
Referenced by YEBuiltin::toStream(), YEBinary::toStream(), and YEUnary::toStream().
std::ostream & StaticDeclaration::writeXmlDeclaration | ( | std::ostream & | str, | |
const declaration_t * | decl | |||
) | const |
References declaration::name, declaration::name_space, declaration::type, and Xmlcode::xmlify().
Referenced by YEBinary::toXml(), and YEUnary::toXml().
std::list<std::pair<std::string, Y2Namespace *> > StaticDeclaration::m_active_predefined [private] |
Referenced by active_predefined(), and registerDeclarations().
SymbolTable* StaticDeclaration::m_declTable [private] |
Referenced by findDeclaration(), registerDeclarations(), StaticDeclaration(), symbolTable(), and ~StaticDeclaration().