YBlock Class Reference

#include <YBlock.h>

Inheritance diagram for YBlock:

YCode Y2Namespace Rep List of all members.

Public Types

enum  blockkind_t {
  b_unknown = 0, b_module, b_file, b_statement,
  b_definition, b_value, b_namespace, b_using
}

Public Member Functions

 YBlock (const std::string &filename, blockkind_t kind=b_unknown)
 YBlock (const Point *point)
 YBlock (bytecodeistream &str)
 ~YBlock ()
constTypePtr type () const
void setType (constTypePtr type)
void finishBlock ()
virtual YCPValue evaluate (bool cse=false)
 called when evaluating the import statement
YCPValue evaluateFrom (int statement_index)
YCPValue evaluate (int statement_index, bool skip_initial_imports=true)
virtual const std::string filename () const
 used for error reporting
virtual SymbolTabletable () const
 get our whole symbol table?
virtual Y2FunctioncreateFunctionCall (const string name, constFunctionTypePtr type)
const Pointpoint () const
const string name () const
 what namespace do we implement
void setName (const string &name)
const Y2NamespacenameSpace () const
Y2NamespacenameSpace ()
void setKind (blockkind_t kind)
blockkind_t kind () const
bool isModule () const
bool isFile () const
bool isStatement () const
bool isDefinition () const
bool isValue () const
bool isNamespace () const
unsigned int newValue (constTypePtr type, YCodePtr code)
TableEntrynewEntry (const char *name, SymbolEntry::category_t cat, constTypePtr type, unsigned int line)
TableEntrynewNamespace (const string &name, Y2Namespace *name_space, int line)
void attachEntry (TableEntry *entry)
void detachEnvironment (SymbolTable *table)
void attachStatement (YStatementPtr statement)
void pretachStatement (YStatementPtr statement)
int statementCount () const
YSReturnPtr justReturn () const
void endInclude ()
bool isIncluded (string includename) const
void addIncluded (string includename)
string toString () const
 unparse. useful for debugging
string environmentToString () const
string toStringSwitch (map< YCPValue, int, ycpless > cases, int defaultcase) const
std::ostream & toStream (std::ostream &str) const

Private Types

typedef yTElist yTElist_t
typedef stmtlist stmtlist_t
typedef std::list< std::string > stringlist_t

Private Member Functions

 REP_BODY (YBlock)

Private Attributes

blockkind_t m_kind
string m_name
yTElist_tm_tenvironment
yTElist_tm_last_tparm
const Pointm_point
stmtlist_tm_statements
stmtlist_tm_last_statement
stringlist_tm_includes
constTypePtr m_type
bool m_running

Classes

struct  stmtlist
struct  yTElist

Detailed Description

block (-> list of statements, list of symbols)


Member Typedef Documentation

typedef struct stmtlist YBlock::stmtlist_t [private]
 

typedef std::list<std::string> YBlock::stringlist_t [private]
 

List of all included files so far.

typedef struct yTElist YBlock::yTElist_t [private]
 


Member Enumeration Documentation

enum YBlock::blockkind_t
 

Enumerator:
b_unknown 
b_module 
b_file 
b_statement 
b_definition 
b_value 
b_namespace 
b_using 


Constructor & Destructor Documentation

YBlock::YBlock const std::string &  filename,
blockkind_t  kind = b_unknown
 

YBlock::YBlock const Point point  ) 
 

YBlock::YBlock bytecodeistream str  ) 
 

YBlock::~YBlock  ) 
 


Member Function Documentation

void YBlock::addIncluded string  includename  ) 
 

void YBlock::attachEntry TableEntry entry  ) 
 

void YBlock::attachStatement YStatementPtr  statement  ) 
 

Y2Function * YBlock::createFunctionCall const string  name,
constFunctionTypePtr  type
[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:
name name of the required function
type the type of the function (needed for overloading)
Returns:
an object, that can be used to call the function, or NULL on error

Implements Y2Namespace.

void YBlock::detachEnvironment SymbolTable table  ) 
 

void YBlock::endInclude  ) 
 

string YBlock::environmentToString  )  const
 

YCPValue YBlock::evaluate int  statement_index,
bool  skip_initial_imports = true
 

YCPValue YBlock::evaluate bool  cse = false  )  [virtual]
 

called when evaluating the import statement

Implements Y2Namespace.

YCPValue YBlock::evaluateFrom int  statement_index  ) 
 

const std::string YBlock::filename  )  const [virtual]
 

used for error reporting

Implements Y2Namespace.

void YBlock::finishBlock  ) 
 

bool YBlock::isDefinition  )  const [inline]
 

bool YBlock::isFile  )  const [inline]
 

bool YBlock::isIncluded string  includename  )  const
 

Checks, if the given include name is already included in the current block.

bool YBlock::isModule  )  const [inline]
 

bool YBlock::isNamespace  )  const [inline]
 

bool YBlock::isStatement  )  const [inline]
 

returns true if the YCode represents a statement

Reimplemented from YCode.

bool YBlock::isValue  )  const [inline]
 

YSReturnPtr YBlock::justReturn  )  const
 

YBlock::blockkind_t YBlock::kind  )  const
 

Returns the YCode kind

Reimplemented from YCode.

const string YBlock::name  )  const [virtual]
 

what namespace do we implement

Reimplemented from Y2Namespace.

Y2Namespace* YBlock::nameSpace  )  [inline]
 

const Y2Namespace* YBlock::nameSpace  )  const [inline]
 

TableEntry * YBlock::newEntry const char *  name,
SymbolEntry::category_t  cat,
constTypePtr  type,
unsigned int  line
 

TableEntry * YBlock::newNamespace const string &  name,
Y2Namespace name_space,
int  line
 

unsigned int YBlock::newValue constTypePtr  type,
YCodePtr  code
 

const Point * YBlock::point  )  const
 

void YBlock::pretachStatement YStatementPtr  statement  ) 
 

YBlock::REP_BODY YBlock   )  [private]
 

void YBlock::setKind blockkind_t  kind  ) 
 

void YBlock::setName const string &  name  ) 
 

void YBlock::setType constTypePtr  type  ) 
 

int YBlock::statementCount  )  const
 

SymbolTable * YBlock::table  )  const [virtual]
 

get our whole symbol table?

Reimplemented from Y2Namespace.

std::ostream & YBlock::toStream std::ostream &  str  )  const [virtual]
 

writes YCode to a stream see Bytecode for read

Implements YCode.

string YBlock::toString  )  const [virtual]
 

unparse. useful for debugging

Reimplemented from Y2Namespace.

string YBlock::toStringSwitch map< YCPValue, int, ycpless cases,
int  defaultcase
const
 

constTypePtr YBlock::type  )  const [inline, virtual]
 

return type (interesting mostly for function calls)

Reimplemented from YCode.


Member Data Documentation

stringlist_t* YBlock::m_includes [private]
 

blockkind_t YBlock::m_kind [private]
 

Reimplemented from YCode.

stmtlist_t* YBlock::m_last_statement [private]
 

yTElist_t* YBlock::m_last_tparm [private]
 

string YBlock::m_name [private]
 

const Point* YBlock::m_point [private]
 

bool YBlock::m_running [private]
 

stmtlist_t* YBlock::m_statements [private]
 

yTElist_t* YBlock::m_tenvironment [private]
 

constTypePtr YBlock::m_type [private]
 


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 18:07:46 2006 for yast2-core by  doxygen 1.4.6