yast2-core
|
#include <Y2Namespace.h>
Public Member Functions | |
Y2Namespace () | |
virtual | ~Y2Namespace () |
void | finish () |
virtual const string | name () const |
what namespace do we implement More... | |
virtual const string | filename () const =0 |
used for error reporting More... | |
virtual unsigned int | symbolCount () const |
gives the number of symbol declarations More... | |
virtual SymbolEntryPtr | symbolEntry (unsigned int position) const |
access to definitions of this namespace More... | |
virtual string | toString () const |
unparse. useful for debugging More... | |
string | symbolsToString () const |
virtual YCPValue | evaluate (bool cse=false)=0 |
called when evaluating the import statement More... | |
virtual SymbolTable * | table () const |
get our whole symbol table? More... | |
void | createTable () |
virtual Y2Function * | createFunctionCall (const string name, constFunctionTypePtr type)=0 |
void | pushToStack () |
void | popFromStack () |
virtual void | initialize () |
Protected Types | |
typedef vector< SymbolEntryPtr > | symbols_t |
Protected Member Functions | |
unsigned int | addSymbol (SymbolEntryPtr sentry) |
void | enterSymbol (SymbolEntryPtr sentry, Point *point=0) |
SymbolEntryPtr | lookupSymbol (const char *name) const |
void | releaseSymbol (unsigned int position) |
Protected Attributes | |
SymbolTable * | m_table |
unsigned int | m_symbolcount |
symbols_t | m_symbols |
bool | m_initialized |
Friends | |
class | SymbolTable |
class | Debugger |
Y2Namespace implements a hash(?) table of nested(?) SymbolEntries and allows to look them up
|
protected |
Y2Namespace::Y2Namespace | ( | ) |
|
protected |
References m_symbolcount, m_symbols, and y2debug.
Referenced by enterSymbol(), YBlock::newEntry(), YBlock::newValue(), and YBlock::YBlock().
|
pure virtual |
Creates a function call instance, which can be used to call a function from this namespace. The object is NOT owned anymore by this instance, the caller can (and should) delete it.
name | name of the required function |
type | the type of the function (needed for overloading) |
Implemented in YBlock.
Referenced by YEFunctionPointer::evaluate(), and initialize().
void Y2Namespace::createTable | ( | ) |
References m_table, and SymbolTable.
Referenced by StaticDeclaration::registerDeclarations(), and YBlock::YBlock().
|
protected |
References addSymbol(), SymbolTable::enter(), m_table, and SymbolTable.
Referenced by SymbolTable::tableCopy().
|
pure virtual |
|
pure virtual |
used for error reporting
Implemented in YBlock.
void Y2Namespace::finish | ( | ) |
References SymbolEntry::setPosition(), and y2debug.
|
virtual |
References createFunctionCall(), SymbolTable::disableUsage(), SymbolTable::enableUsage(), evaluate(), Y2Function::evaluateCall(), SymbolTable::find(), m_initialized, name(), and table().
Referenced by YSImport::evaluate().
|
protected |
References m_symbolcount, m_symbols, and name().
Referenced by Debugger::findSymbol(), and YBlock::newEntry().
|
virtual |
what namespace do we implement
Reimplemented in YBlock.
Referenced by initialize(), lookupSymbol(), Bytecode::readEntry(), YSymbolEntry::toString(), SymbolEntry::toString(), YSymbolEntry::toXml(), and Xmlcode::writeEntry().
void Y2Namespace::popFromStack | ( | ) |
References m_symbolcount, and m_symbols.
Referenced by YBlock::evaluate(), and YBlock::evaluateFrom().
void Y2Namespace::pushToStack | ( | ) |
References m_symbolcount, and m_symbols.
Referenced by YBlock::evaluate(), and YBlock::evaluateFrom().
|
protected |
References m_symbolcount, and m_symbols.
|
virtual |
gives the number of symbol declarations
References m_symbols.
Referenced by YBlock::newEntry(), YBlock::newValue(), YBlock::toStream(), and YBlock::toXml().
|
virtual |
access to definitions of this namespace
References m_symbolcount, and m_symbols.
Referenced by Bytecode::readEntry(), YBlock::toStream(), YBlock::toXml(), and YBlock::YBlock().
string Y2Namespace::symbolsToString | ( | ) | const |
References m_symbolcount, and m_symbols.
Referenced by YBlock::environmentToString(), and toString().
|
virtual |
get our whole symbol table?
Reimplemented in YBlock.
References m_table.
Referenced by Import::import(), Parser::init(), initialize(), Xmlcode::popNamespace(), Bytecode::popNamespace(), Xmlcode::popUptoNamespace(), Bytecode::popUptoNamespace(), Xmlcode::pushNamespace(), Bytecode::pushNamespace(), Bytecode::readEntry(), switch(), and while().
|
virtual |
unparse. useful for debugging
Reimplemented in YBlock.
References m_table, symbolsToString(), and SymbolTable::toString().
Referenced by YBlock::newEntry().
|
friend |
|
friend |
Referenced by createTable(), enterSymbol(), and YBlock::YBlock().
|
protected |
Referenced by initialize().
|
protected |
Referenced by addSymbol(), YBlock::createFunctionCall(), lookupSymbol(), popFromStack(), pushToStack(), releaseSymbol(), symbolEntry(), and symbolsToString().
|
protected |
|
protected |
Referenced by createTable(), enterSymbol(), table(), YBlock::table(), toString(), YBlock::YBlock(), and ~Y2Namespace().