Base class
Base class.This class is the main class of the Base library. All the other classes of the library inherit (directly or undirectly) this class. It provides virtual methods to get the type of a derived object and some error methods. Each child class redefines the virtual method type. It permits to know the actual type of an object, even if we only know its NstTree part (or another ancestor of the class). Here is an example, with the NstStatementContinue class that is defined further:
NstStatementContinue test_object; NstTree* tree = (NstTree*)&test_object; int rt = tree->type();The variable rt will contain NST_STATEMENT_CONTINUE, because the object tree is in fact an instance of the class NstStatementContinue.The method dynamic_cast<T>(t) should be used to cast an object. Example:
if(NstStatement* st = dynamic_cast<NstStatement*>(t)) { // some operation on st }
Example: let t be a NstStatementDo object:
The first value of current is the index of the loop, the second the
range and the third the list of statements in the loop.
Example: let t be a NstStatementDo object:
The first value of current is the index of the loop, the second the
range and the third the list of statements in the loop.
long tree_id
int type() const
char* class_type() const
char* class_name() const
int base_type() const
NstTree* create_default()
NstTree* cut_buffer() const
void copy(const NstTree& s)
NstTree* clone() const
NstTree& operator= (const NstTree& s)
NstUserInfo user_info
void error(const char* st) const
void warning(const char* st) const
ostream& operator << (ostream& s, const NstTree& t)
NstTree* init()
NstTree* current = t->init();
while (current)
{
cout << *current << endl;
current = t->next();
}
NstTree* init(NstTrees::iterator &it)
NstTrees::iterator it;
NstTree* current = t->init(it);
while (current)
{
cout << *current << endl;
current = t->next(it);
}
NstTree* next()
NstTree* next(NstTrees::iterator &it)
void traversal(int (*action)(NstTree*, void*), void* extra = NULL)
NstTree* upsearch(int (*comptest)(NstTree*, void*), void* extra = NULL)
NstTree* cut()
NstDefinition* search(const NstIdentifier& i, int tp = -1) const
void replace(NstTree& n)
NstTree* in() const
fathers() const
string whoami() const
Alphabetic index HTML hierarchy of classes or Java