yast2-core
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
Y2Namespace Class Referenceabstract

#include <Y2Namespace.h>

Inheritance diagram for Y2Namespace:
YBlock

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 SymbolTabletable () const
 get our whole symbol table? More...
 
void createTable ()
 
virtual Y2FunctioncreateFunctionCall (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

SymbolTablem_table
 
unsigned int m_symbolcount
 
symbols_t m_symbols
 
bool m_initialized
 

Friends

class SymbolTable
 
class Debugger
 

Detailed Description

Y2Namespace implements a hash(?) table of nested(?) SymbolEntries and allows to look them up

Member Typedef Documentation

typedef vector<SymbolEntryPtr> Y2Namespace::symbols_t
protected

Constructor & Destructor Documentation

Y2Namespace::Y2Namespace ( )
Y2Namespace::~Y2Namespace ( )
virtual

References m_symbols, m_table, and y2debug.

Member Function Documentation

unsigned int Y2Namespace::addSymbol ( SymbolEntryPtr  sentry)
protected
virtual Y2Function* Y2Namespace::createFunctionCall ( const string  name,
constFunctionTypePtr  type 
)
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.

Parameters
namename of the required function
typethe type of the function (needed for overloading)
Returns
an object, that can be used to call the function, or NULL on error

Implemented in YBlock.

Referenced by YEFunctionPointer::evaluate(), and initialize().

void Y2Namespace::createTable ( )
void Y2Namespace::enterSymbol ( SymbolEntryPtr  sentry,
Point point = 0 
)
protected
virtual YCPValue Y2Namespace::evaluate ( bool  cse = false)
pure virtual

called when evaluating the import statement

Implemented in YBlock.

Referenced by initialize().

virtual const string Y2Namespace::filename ( ) const
pure virtual

used for error reporting

Implemented in YBlock.

void Y2Namespace::finish ( )
void Y2Namespace::initialize ( )
virtual
SymbolEntryPtr Y2Namespace::lookupSymbol ( const char *  name) const
protected
const string Y2Namespace::name ( ) const
virtual
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().

void Y2Namespace::releaseSymbol ( unsigned int  position)
protected

References m_symbolcount, and m_symbols.

unsigned int Y2Namespace::symbolCount ( ) const
virtual

gives the number of symbol declarations

References m_symbols.

Referenced by YBlock::newEntry(), YBlock::newValue(), YBlock::toStream(), and YBlock::toXml().

SymbolEntryPtr Y2Namespace::symbolEntry ( unsigned int  position) const
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().

SymbolTable * Y2Namespace::table ( ) const
virtual
string Y2Namespace::toString ( ) const
virtual

unparse. useful for debugging

Reimplemented in YBlock.

References m_table, symbolsToString(), and SymbolTable::toString().

Referenced by YBlock::newEntry().

Friends And Related Function Documentation

friend class Debugger
friend
friend class SymbolTable
friend

Member Data Documentation

bool Y2Namespace::m_initialized
protected

Referenced by initialize().

unsigned int Y2Namespace::m_symbolcount
protected
symbols_t Y2Namespace::m_symbols
protected
SymbolTable* Y2Namespace::m_table
protected

The documentation for this class was generated from the following files:

Generated on a sunny day for yast2-core by doxygen 1.8.6