#include <YBlock.h>
Inheritance diagram for YBlock:

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 () | |
| virtual bool | isBlock () const |
| virtual ykind | kind () const |
| 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 SymbolTable * | table () const |
| get our whole symbol table? | |
| virtual Y2Function * | createFunctionCall (const string name, constFunctionTypePtr type) |
| const Point * | point () const |
| const string | name () const |
| what namespace do we implement | |
| void | setName (const string &name) |
| const Y2Namespace * | nameSpace () const |
| Y2Namespace * | nameSpace () |
| void | setKind (blockkind_t kind) |
| blockkind_t | bkind () 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) |
| TableEntry * | newEntry (const char *name, SymbolEntry::category_t cat, constTypePtr type, unsigned int line) |
| TableEntry * | newNamespace (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_t * | m_tenvironment |
| yTElist_t * | m_last_tparm |
| const Point * | m_point |
| stmtlist_t * | m_statements |
| stmtlist_t * | m_last_statement |
| stringlist_t * | m_includes |
| constTypePtr | m_type |
| bool | m_running |
Classes | |
| struct | stmtlist |
| struct | yTElist |
typedef struct yTElist YBlock::yTElist_t [private] |
typedef struct stmtlist YBlock::stmtlist_t [private] |
typedef std::list<std::string> YBlock::stringlist_t [private] |
List of all included files so far.
| enum YBlock::blockkind_t |
| YBlock::YBlock | ( | const std::string & | filename, | |
| blockkind_t | kind = b_unknown | |||
| ) |
| YBlock::YBlock | ( | const Point * | point | ) |
| YBlock::YBlock | ( | bytecodeistream & | str | ) |
| YBlock::~YBlock | ( | ) |
| YBlock::REP_BODY | ( | YBlock | ) | [private] |
| virtual bool YBlock::isBlock | ( | ) | const [inline, virtual] |
yes
Reimplemented from YCode.
| constTypePtr YBlock::type | ( | ) | const [inline, virtual] |
return type (interesting mostly for function calls)
Reimplemented from YCode.
| void YBlock::setType | ( | constTypePtr | type | ) |
| void YBlock::finishBlock | ( | ) |
| YCPValue YBlock::evaluate | ( | bool | cse = false |
) | [virtual] |
| YCPValue YBlock::evaluateFrom | ( | int | statement_index | ) |
| YCPValue YBlock::evaluate | ( | int | statement_index, | |
| bool | skip_initial_imports = true | |||
| ) |
| const std::string YBlock::filename | ( | ) | const [virtual] |
| SymbolTable * YBlock::table | ( | ) | const [virtual] |
| 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.
| name | name of the required function | |
| type | the type of the function (needed for overloading) |
Implements Y2Namespace.
| const Point * YBlock::point | ( | ) | const |
| const string YBlock::name | ( | ) | const [virtual] |
| void YBlock::setName | ( | const string & | name | ) |
| const Y2Namespace* YBlock::nameSpace | ( | ) | const [inline] |
| Y2Namespace* YBlock::nameSpace | ( | ) | [inline] |
| void YBlock::setKind | ( | blockkind_t | kind | ) |
| YBlock::blockkind_t YBlock::bkind | ( | ) | const |
| bool YBlock::isModule | ( | ) | const [inline] |
| bool YBlock::isFile | ( | ) | const [inline] |
| bool YBlock::isStatement | ( | ) | const [inline, virtual] |
| bool YBlock::isDefinition | ( | ) | const [inline] |
| bool YBlock::isValue | ( | ) | const [inline] |
| bool YBlock::isNamespace | ( | ) | const [inline] |
| unsigned int YBlock::newValue | ( | constTypePtr | type, | |
| YCodePtr | code | |||
| ) |
| 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 | |||
| ) |
| void YBlock::attachEntry | ( | TableEntry * | entry | ) |
| void YBlock::detachEnvironment | ( | SymbolTable * | table | ) |
| void YBlock::attachStatement | ( | YStatementPtr | statement | ) |
| void YBlock::pretachStatement | ( | YStatementPtr | statement | ) |
| int YBlock::statementCount | ( | ) | const |
| YSReturnPtr YBlock::justReturn | ( | ) | const |
| void YBlock::endInclude | ( | ) |
| bool YBlock::isIncluded | ( | string | includename | ) | const |
Checks, if the given include name is already included in the current block.
| void YBlock::addIncluded | ( | string | includename | ) |
| string YBlock::toString | ( | ) | const [virtual] |
| string YBlock::environmentToString | ( | ) | const |
| std::ostream & YBlock::toStream | ( | std::ostream & | str | ) | const [virtual] |
blockkind_t YBlock::m_kind [private] |
string YBlock::m_name [private] |
yTElist_t* YBlock::m_tenvironment [private] |
yTElist_t* YBlock::m_last_tparm [private] |
const Point* YBlock::m_point [private] |
stmtlist_t* YBlock::m_statements [private] |
stmtlist_t* YBlock::m_last_statement [private] |
stringlist_t* YBlock::m_includes [private] |
constTypePtr YBlock::m_type [private] |
bool YBlock::m_running [private] |
1.5.0