/* gramm: cmm.g -> cmm_data.cpp */ #include "cmm_data.hpp" #include "cmm_data.hpp" OPEN_NAMESPACE /* CmmBasic */ CmmBasic::~CmmBasic () { } CmmBasic::CmmBasic () : next_usage (NULL) { } /* CmmDecl */ void CmmDecl::insertBefore (CmmDecl * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmDecl::insertAfter (CmmDecl * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmDecl::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmDecl::~CmmDecl () { if (up != NULL) remove (); } CmmDecl::CmmDecl () : prev (NULL), next (NULL), up (NULL) { } /* CmmMemberVisibility */ CmmMemberVisibility::CmmMemberVisibility () : access (NoAccess), location () { for (int i = 0; i < 4; i ++) location [i] = NULL; } /* CmmBaseItem */ void CmmBaseItem::insertBefore (CmmBaseItem * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmBaseItem::insertAfter (CmmBaseItem * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmBaseItem::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmBaseItem::CmmBaseItem () : access (NoAccess), a_virtual (false), from (NULL), prev (NULL), next (NULL), up (NULL), location () { for (int i = 0; i < 10; i ++) location [i] = NULL; } CmmBaseItem::~CmmBaseItem () { if (up != NULL) remove (); } /* CmmExpr */ void CmmExpr::insertBefore (CmmExpr * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmExpr::insertAfter (CmmExpr * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmExpr::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmExpr::CmmExpr () : prev (NULL), next (NULL), up (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } CmmExpr::~CmmExpr () { if (up != NULL) remove (); } /* CmmName */ void CmmName::link_item (CmmContName * item, CmmContName * bef, CmmContName * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmName::insertFirst (CmmContName * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmName::add (CmmContName * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmName::removeAll () { CmmContName * p = first; while (p != NULL) { CmmContName * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmName::CmmName () : name_ref (NULL), base_ref (NULL), replace (), id (), spec (NULL), template_args (NULL), a_global (false), first (NULL), last (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } CmmName::~CmmName () { removeAll (); } /* CmmContName */ void CmmContName::insertBefore (CmmContName * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmContName::insertAfter (CmmContName * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmContName::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmContName::CmmContName () : cont_ref (NULL), id (), a_destructor (false), a_template (false), spec (NULL), template_args (NULL), prev (NULL), next (NULL), up (NULL), location () { for (int i = 0; i < 4; i ++) location [i] = NULL; } CmmContName::~CmmContName () { if (up != NULL) remove (); } /* CmmDeclarator */ void CmmDeclarator::insertBefore (CmmDeclarator * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmDeclarator::insertAfter (CmmDeclarator * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmDeclarator::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmDeclarator::CmmDeclarator () : save (NULL), access_val (NoAccess), separate_decl (false), actual_decl (NULL), short_name (), long_name (NULL), function_param_ref (NULL), name (NULL), cont (NULL), ptr (NULL), inner (NULL), empty_branch (false), width (NULL), init (NULL), prev (NULL), next (NULL), up (NULL), location () { for (int i = 0; i < 7; i ++) location [i] = NULL; } CmmDeclarator::~CmmDeclarator () { if (up != NULL) remove (); } /* CmmContSpecifier */ void CmmContSpecifier::insertBefore (CmmContSpecifier * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmContSpecifier::insertAfter (CmmContSpecifier * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmContSpecifier::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmContSpecifier::~CmmContSpecifier () { if (up != NULL) remove (); } CmmContSpecifier::CmmContSpecifier () : prev (NULL), next (NULL), up (NULL) { } /* CmmFunctionSpecifier */ CmmFunctionSpecifier::CmmFunctionSpecifier () : param_ref (NULL), parameters (NULL), cv_const (false), cv_volatile (false), exception_spec (NULL), location () { for (int i = 0; i < 4; i ++) location [i] = NULL; } /* CmmNumValue */ CmmNumValue::CmmNumValue () : value (), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } /* CmmCharValue */ CmmCharValue::CmmCharValue () : value (), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } /* CmmStringCont */ void CmmStringCont::insertBefore (CmmStringCont * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmStringCont::insertAfter (CmmStringCont * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmStringCont::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmStringCont::CmmStringCont () : value (), prev (NULL), next (NULL), up (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } CmmStringCont::~CmmStringCont () { if (up != NULL) remove (); } /* CmmStringValue */ void CmmStringValue::link_item (CmmStringCont * item, CmmStringCont * bef, CmmStringCont * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmStringValue::insertFirst (CmmStringCont * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmStringValue::add (CmmStringCont * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmStringValue::removeAll () { CmmStringCont * p = first; while (p != NULL) { CmmStringCont * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmStringValue::CmmStringValue () : value (), first (NULL), last (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } CmmStringValue::~CmmStringValue () { removeAll (); } /* CmmThisExpr */ CmmThisExpr::CmmThisExpr () : location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } /* CmmSubexprExpr */ CmmSubexprExpr::CmmSubexprExpr () : param (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } /* CmmModernCastExpr */ CmmModernCastExpr::CmmModernCastExpr () : kind (DynamicCast), type (NULL), param (NULL), location () { for (int i = 0; i < 8; i ++) location [i] = NULL; } /* CmmTypeidExpr */ CmmTypeidExpr::CmmTypeidExpr () : param1 (NULL), param2 (NULL), location () { for (int i = 0; i < 3; i ++) location [i] = NULL; } /* CmmTypenameExpr */ CmmTypenameExpr::CmmTypenameExpr () : name (NULL), list (NULL), location () { for (int i = 0; i < 3; i ++) location [i] = NULL; } /* CmmTypechangeExpr */ CmmTypechangeExpr::CmmTypechangeExpr () : a_signed (false), a_unsigned (false), a_short (false), a_long (false), a_long_long (false), a_bool (false), a_char (false), a_wchar (false), a_int (false), a_float (false), a_double (false), a_void (false), list (NULL), location () { for (int i = 0; i < 14; i ++) location [i] = NULL; } /* CmmIndexExpr */ CmmIndexExpr::CmmIndexExpr () : left (NULL), right (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } /* CmmCallExpr */ CmmCallExpr::CmmCallExpr () : param (NULL), list (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } /* CmmFieldExpr */ CmmFieldExpr::CmmFieldExpr () : param (NULL), destructor_name (false), template_name (false), name (NULL), location () { for (int i = 0; i < 3; i ++) location [i] = NULL; } /* CmmPtrFieldExpr */ CmmPtrFieldExpr::CmmPtrFieldExpr () : param (NULL), destructor_name (false), template_name (false), name (NULL), location () { for (int i = 0; i < 3; i ++) location [i] = NULL; } /* CmmPostIncExpr */ CmmPostIncExpr::CmmPostIncExpr () : param (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } /* CmmPostDecExpr */ CmmPostDecExpr::CmmPostDecExpr () : param (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } /* CmmExprList */ void CmmExprList::link_item (CmmExpr * item, CmmExpr * bef, CmmExpr * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmExprList::insertFirst (CmmExpr * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmExprList::add (CmmExpr * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmExprList::removeAll () { CmmExpr * p = first; while (p != NULL) { CmmExpr * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmExprList::CmmExprList () : first (NULL), last (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } CmmExprList::~CmmExprList () { removeAll (); } /* CmmUnaryExpr */ CmmUnaryExpr::CmmUnaryExpr () : kind (IncExp), param (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } /* CmmSizeofExp */ CmmSizeofExp::CmmSizeofExp () : param1 (NULL), param2 (NULL), location () { for (int i = 0; i < 3; i ++) location [i] = NULL; } /* CmmNewExpr */ CmmNewExpr::CmmNewExpr () : placement (NULL), type1 (NULL), type2 (NULL), init (NULL), location () { for (int i = 0; i < 5; i ++) location [i] = NULL; } /* CmmNewPlacement */ CmmNewPlacement::CmmNewPlacement () : list (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } /* CmmNewTypeId */ void CmmNewTypeId::link_item (CmmNewArrayLimit * item, CmmNewArrayLimit * bef, CmmNewArrayLimit * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmNewTypeId::insertFirst (CmmNewArrayLimit * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmNewTypeId::add (CmmNewArrayLimit * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmNewTypeId::removeAll () { CmmNewArrayLimit * p = first; while (p != NULL) { CmmNewArrayLimit * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmNewTypeId::~CmmNewTypeId () { removeAll (); } CmmNewTypeId::CmmNewTypeId () : spec (NULL), ptr (NULL), first (NULL), last (NULL) { } /* CmmNewArrayLimit */ void CmmNewArrayLimit::insertBefore (CmmNewArrayLimit * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmNewArrayLimit::insertAfter (CmmNewArrayLimit * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmNewArrayLimit::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmNewArrayLimit::CmmNewArrayLimit () : value (NULL), prev (NULL), next (NULL), up (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } CmmNewArrayLimit::~CmmNewArrayLimit () { if (up != NULL) remove (); } /* CmmDeleteExpr */ CmmDeleteExpr::CmmDeleteExpr () : a_array (false), param (NULL), location () { for (int i = 0; i < 3; i ++) location [i] = NULL; } /* CmmCastFormula */ CmmCastFormula::CmmCastFormula () : type (NULL), param (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } /* CmmBinaryExpr */ CmmBinaryExpr::CmmBinaryExpr () : kind (DotMemberExp), left (NULL), right (NULL) { } /* CmmCondExpr */ CmmCondExpr::CmmCondExpr () : cond_expr (NULL), then_expr (NULL), else_expr (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } /* CmmStat */ void CmmStat::insertBefore (CmmStat * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmStat::insertAfter (CmmStat * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmStat::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmStat::~CmmStat () { if (up != NULL) remove (); } CmmStat::CmmStat () : prev (NULL), next (NULL), up (NULL) { } /* CmmStatSect */ void CmmStatSect::link_item (CmmStat * item, CmmStat * bef, CmmStat * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmStatSect::insertFirst (CmmStat * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmStatSect::add (CmmStat * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmStatSect::removeAll () { CmmStat * p = first; while (p != NULL) { CmmStat * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmStatSect::~CmmStatSect () { removeAll (); } CmmStatSect::CmmStatSect () : first (NULL), last (NULL) { } /* CmmDeclStat */ CmmDeclStat::CmmDeclStat () : decl (NULL) { } /* CmmLabeledStat */ CmmLabeledStat::CmmLabeledStat () : lab (), body (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } /* CmmCaseStat */ CmmCaseStat::CmmCaseStat () : case_expr (NULL), body (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } /* CmmDefaultStat */ CmmDefaultStat::CmmDefaultStat () : body (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } /* CmmExprStat */ CmmExprStat::CmmExprStat () : inner_expr (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } /* CmmEmptyStat */ CmmEmptyStat::CmmEmptyStat () : location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } /* CmmCompoundStat */ CmmCompoundStat::CmmCompoundStat () : body (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } /* CmmCondition */ CmmCondition::CmmCondition () : cond_decl (NULL), cond_expr (NULL) { } /* CmmIfStat */ CmmIfStat::CmmIfStat () : cond (NULL), then_stat (NULL), else_stat (NULL), location () { for (int i = 0; i < 4; i ++) location [i] = NULL; } /* CmmSwitchStat */ CmmSwitchStat::CmmSwitchStat () : cond (NULL), body (NULL), location () { for (int i = 0; i < 3; i ++) location [i] = NULL; } /* CmmWhileStat */ CmmWhileStat::CmmWhileStat () : cond (NULL), body (NULL), location () { for (int i = 0; i < 3; i ++) location [i] = NULL; } /* CmmDoStat */ CmmDoStat::CmmDoStat () : body (NULL), cond_expr (NULL), location () { for (int i = 0; i < 5; i ++) location [i] = NULL; } /* CmmForStat */ CmmForStat::CmmForStat () : from_expr (NULL), to_expr (NULL), cond_expr (NULL), body (NULL), location () { for (int i = 0; i < 5; i ++) location [i] = NULL; } /* CmmBreakStat */ CmmBreakStat::CmmBreakStat () : location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } /* CmmContinueStat */ CmmContinueStat::CmmContinueStat () : location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } /* CmmReturnStat */ CmmReturnStat::CmmReturnStat () : return_expr (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } /* CmmGotoStat */ CmmGotoStat::CmmGotoStat () : goto_lab (), location () { for (int i = 0; i < 3; i ++) location [i] = NULL; } /* CmmDeclSect */ void CmmDeclSect::link_item (CmmDecl * item, CmmDecl * bef, CmmDecl * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmDeclSect::insertFirst (CmmDecl * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmDeclSect::add (CmmDecl * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmDeclSect::removeAll () { CmmDecl * p = first; while (p != NULL) { CmmDecl * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmDeclSect::~CmmDeclSect () { removeAll (); } CmmDeclSect::CmmDeclSect () : first (NULL), last (NULL) { } /* CmmSimpleDecl */ void CmmSimpleDecl::link_item (CmmDeclarator * item, CmmDeclarator * bef, CmmDeclarator * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmSimpleDecl::insertFirst (CmmDeclarator * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmSimpleDecl::add (CmmDeclarator * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmSimpleDecl::removeAll () { CmmDeclarator * p = first; while (p != NULL) { CmmDeclarator * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmSimpleDecl::CmmSimpleDecl () : spec (NULL), first (NULL), last (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } CmmSimpleDecl::~CmmSimpleDecl () { removeAll (); } /* CmmComplexDecl */ CmmComplexDecl::CmmComplexDecl () : empty_width (NULL), empty (false), func_body (NULL), location () { for (int i = 0; i < 5; i ++) location [i] = NULL; } /* CmmCtorDecl */ CmmCtorDecl::CmmCtorDecl () : destructor (false), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } /* CmmCtorHead */ CmmCtorHead::CmmCtorHead () : destructor (false), init_values (false), body (false), try_block (false), location () { for (int i = 0; i < 5; i ++) location [i] = NULL; } /* CmmContSpecifierSect */ void CmmContSpecifierSect::link_item (CmmContSpecifier * item, CmmContSpecifier * bef, CmmContSpecifier * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmContSpecifierSect::insertFirst (CmmContSpecifier * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmContSpecifierSect::add (CmmContSpecifier * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmContSpecifierSect::removeAll () { CmmContSpecifier * p = first; while (p != NULL) { CmmContSpecifier * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmContSpecifierSect::~CmmContSpecifierSect () { removeAll (); } CmmContSpecifierSect::CmmContSpecifierSect () : first (NULL), last (NULL) { } /* CmmFunctionBody */ CmmFunctionBody::CmmFunctionBody () : ctor_init (NULL), statements (NULL), handlers (NULL), location () { for (int i = 0; i < 3; i ++) location [i] = NULL; } /* CmmEnumDecl */ CmmEnumDecl::CmmEnumDecl () : name (NULL), with_body (false), items (NULL), location () { for (int i = 0; i < 5; i ++) location [i] = NULL; } /* CmmClassDecl */ CmmClassDecl::CmmClassDecl () : style (ClassStyle), name (NULL), with_body (false), base_list (NULL), members (NULL), location () { for (int i = 0; i < 10; i ++) location [i] = NULL; } /* CmmNamespaceDecl */ CmmNamespaceDecl::CmmNamespaceDecl () : name (NULL), value (NULL), body (NULL), location () { for (int i = 0; i < 5; i ++) location [i] = NULL; } /* CmmUsingDecl */ CmmUsingDecl::CmmUsingDecl () : a_namespace (false), a_typename (false), name (NULL), location () { for (int i = 0; i < 4; i ++) location [i] = NULL; } /* CmmExternDecl */ CmmExternDecl::CmmExternDecl () : language (), decl_list (NULL), inner_decl (NULL), location () { for (int i = 0; i < 4; i ++) location [i] = NULL; } /* CmmAsmDecl */ CmmAsmDecl::CmmAsmDecl () : instruction (), location () { for (int i = 0; i < 5; i ++) location [i] = NULL; } /* CmmEmptyDecl */ CmmEmptyDecl::CmmEmptyDecl () : location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } /* CmmDeclSpec */ CmmDeclSpec::CmmDeclSpec () : basic_name (NULL), class_spec (NULL), enum_spec (NULL), typename_spec (NULL), a_register (false), a_typedef (false), a_friend (false), a_inline (false), a_virtual (false), a_explicit (false), a_mutable (false), a_extern (false), a_static (false), a_auto (false), a_const (false), a_volatile (false), a_signed (false), a_unsigned (false), a_short (false), a_long (false), a_long_long (false), a_bool (false), a_char (false), a_wchar (false), a_int (false), a_float (false), a_double (false), a_void (false), ptr (NULL), location () { for (int i = 0; i < 30; i ++) location [i] = NULL; } /* CmmTypenameSpec */ CmmTypenameSpec::CmmTypenameSpec () : name (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } /* CmmEnumSect */ void CmmEnumSect::link_item (CmmEnumItem * item, CmmEnumItem * bef, CmmEnumItem * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmEnumSect::insertFirst (CmmEnumItem * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmEnumSect::add (CmmEnumItem * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmEnumSect::removeAll () { CmmEnumItem * p = first; while (p != NULL) { CmmEnumItem * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmEnumSect::CmmEnumSect () : first (NULL), last (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } CmmEnumSect::~CmmEnumSect () { removeAll (); } /* CmmEnumItem */ void CmmEnumItem::insertBefore (CmmEnumItem * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmEnumItem::insertAfter (CmmEnumItem * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmEnumItem::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmEnumItem::CmmEnumItem () : name (NULL), init (NULL), prev (NULL), next (NULL), up (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } CmmEnumItem::~CmmEnumItem () { if (up != NULL) remove (); } /* CmmTypeId */ CmmTypeId::CmmTypeId () : spec (NULL), decl (NULL) { } /* CmmPtrSpecifierSect */ void CmmPtrSpecifierSect::link_item (CmmPtrSpecifier * item, CmmPtrSpecifier * bef, CmmPtrSpecifier * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmPtrSpecifierSect::insertFirst (CmmPtrSpecifier * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmPtrSpecifierSect::add (CmmPtrSpecifier * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmPtrSpecifierSect::removeAll () { CmmPtrSpecifier * p = first; while (p != NULL) { CmmPtrSpecifier * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmPtrSpecifierSect::~CmmPtrSpecifierSect () { removeAll (); } CmmPtrSpecifierSect::CmmPtrSpecifierSect () : first (NULL), last (NULL) { } /* CmmPtrSpecifier */ void CmmPtrSpecifier::insertBefore (CmmPtrSpecifier * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmPtrSpecifier::insertAfter (CmmPtrSpecifier * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmPtrSpecifier::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmPtrSpecifier::CmmPtrSpecifier () : pointer (false), reference (false), area (NULL), member_pointer (false), cv_const (false), cv_volatile (false), prev (NULL), next (NULL), up (NULL), location () { for (int i = 0; i < 6; i ++) location [i] = NULL; } CmmPtrSpecifier::~CmmPtrSpecifier () { if (up != NULL) remove (); } /* CmmArraySpecifier */ CmmArraySpecifier::CmmArraySpecifier () : lim (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } /* CmmParamSect */ void CmmParamSect::link_item (CmmParamItem * item, CmmParamItem * bef, CmmParamItem * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmParamSect::insertFirst (CmmParamItem * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmParamSect::add (CmmParamItem * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmParamSect::removeAll () { CmmParamItem * p = first; while (p != NULL) { CmmParamItem * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmParamSect::CmmParamSect () : first (NULL), last (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } CmmParamSect::~CmmParamSect () { removeAll (); } /* CmmParamItem */ void CmmParamItem::insertBefore (CmmParamItem * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmParamItem::insertAfter (CmmParamItem * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmParamItem::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmParamItem::CmmParamItem () : type (NULL), following_dots (false), value (NULL), dots (false), init (NULL), prev (NULL), next (NULL), up (NULL), location () { for (int i = 0; i < 3; i ++) location [i] = NULL; } CmmParamItem::~CmmParamItem () { if (up != NULL) remove (); } /* CmmInitializer */ CmmInitializer::CmmInitializer () : value (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } /* CmmInitItem */ void CmmInitItem::insertBefore (CmmInitItem * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmInitItem::insertAfter (CmmInitItem * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmInitItem::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmInitItem::~CmmInitItem () { if (up != NULL) remove (); } CmmInitItem::CmmInitItem () : prev (NULL), next (NULL), up (NULL) { } /* CmmInitEmpty */ CmmInitEmpty::CmmInitEmpty () { } /* CmmInitSimple */ CmmInitSimple::CmmInitSimple () : expr (NULL) { } /* CmmInitList */ void CmmInitList::link_item (CmmInitItem * item, CmmInitItem * bef, CmmInitItem * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmInitList::insertFirst (CmmInitItem * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmInitList::add (CmmInitItem * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmInitList::removeAll () { CmmInitItem * p = first; while (p != NULL) { CmmInitItem * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmInitList::CmmInitList () : first (NULL), last (NULL), location () { for (int i = 0; i < 3; i ++) location [i] = NULL; } CmmInitList::~CmmInitList () { removeAll (); } /* CmmBaseSect */ void CmmBaseSect::link_item (CmmBaseItem * item, CmmBaseItem * bef, CmmBaseItem * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmBaseSect::insertFirst (CmmBaseItem * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmBaseSect::add (CmmBaseItem * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmBaseSect::removeAll () { CmmBaseItem * p = first; while (p != NULL) { CmmBaseItem * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmBaseSect::CmmBaseSect () : first (NULL), last (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } CmmBaseSect::~CmmBaseSect () { removeAll (); } /* CmmCtorInitializer */ void CmmCtorInitializer::link_item (CmmMemberInitializer * item, CmmMemberInitializer * bef, CmmMemberInitializer * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmCtorInitializer::insertFirst (CmmMemberInitializer * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmCtorInitializer::add (CmmMemberInitializer * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmCtorInitializer::removeAll () { CmmMemberInitializer * p = first; while (p != NULL) { CmmMemberInitializer * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmCtorInitializer::CmmCtorInitializer () : first (NULL), last (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } CmmCtorInitializer::~CmmCtorInitializer () { removeAll (); } /* CmmMemberInitializer */ void CmmMemberInitializer::insertBefore (CmmMemberInitializer * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmMemberInitializer::insertAfter (CmmMemberInitializer * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmMemberInitializer::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmMemberInitializer::CmmMemberInitializer () : name (NULL), params (NULL), prev (NULL), next (NULL), up (NULL), location () { for (int i = 0; i < 2; i ++) location [i] = NULL; } CmmMemberInitializer::~CmmMemberInitializer () { if (up != NULL) remove (); } /* CmmSpecialFuction */ CmmSpecialFuction::CmmSpecialFuction () : conv (NULL), spec_new (false), spec_new_array (false), spec_delete (false), spec_delete_array (false), spec_add (false), spec_sub (false), spec_mul (false), spec_div (false), spec_mod (false), spec_xor (false), spec_and (false), spec_or (false), spec_not (false), spec_log_not (false), spec_assign (false), spec_lt (false), spec_gt (false), spec_add_assign (false), spec_sub_assign (false), spec_mul_assign (false), spec_div_assign (false), spec_mod_assign (false), spec_xor_assign (false), spec_and_assign (false), spec_or_assign (false), spec_shl (false), spec_shr (false), spec_shl_assign (false), spec_shr_assign (false), spec_eq (false), spec_ne (false), spec_le (false), spec_ge (false), spec_log_and (false), spec_log_or (false), spec_inc (false), spec_dec (false), spec_comma (false), spec_member_deref (false), spec_deref (false), spec_call (false), spec_index (false), location () { for (int i = 0; i < 47; i ++) location [i] = NULL; } /* CmmTemplateDecl */ CmmTemplateDecl::CmmTemplateDecl () : inner_decl (NULL), export_template (false), params (NULL), explicit_specialization (false), parameter_block (false), explicit_instatiation (false), location () { for (int i = 0; i < 4; i ++) location [i] = NULL; } /* CmmExxternTemplateDecl */ CmmExxternTemplateDecl::CmmExxternTemplateDecl () : location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } /* CmmTemplateParamSect */ void CmmTemplateParamSect::link_item (CmmTemplateParam * item, CmmTemplateParam * bef, CmmTemplateParam * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmTemplateParamSect::insertFirst (CmmTemplateParam * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmTemplateParamSect::add (CmmTemplateParam * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmTemplateParamSect::removeAll () { CmmTemplateParam * p = first; while (p != NULL) { CmmTemplateParam * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmTemplateParamSect::CmmTemplateParamSect () : first (NULL), last (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } CmmTemplateParamSect::~CmmTemplateParamSect () { removeAll (); } /* CmmTemplateParam */ void CmmTemplateParam::insertBefore (CmmTemplateParam * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmTemplateParam::insertAfter (CmmTemplateParam * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmTemplateParam::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmTemplateParam::~CmmTemplateParam () { if (up != NULL) remove (); } CmmTemplateParam::CmmTemplateParam () : prev (NULL), next (NULL), up (NULL) { } /* CmmTemplateTypeParam */ CmmTemplateTypeParam::CmmTemplateTypeParam () : params (NULL), a_class (false), a_typename (false), name (NULL), value (NULL), location () { for (int i = 0; i < 6; i ++) location [i] = NULL; } /* CmmTemplateValueParam */ CmmTemplateValueParam::CmmTemplateValueParam () : type (NULL), init (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } /* CmmTemplateArgSect */ void CmmTemplateArgSect::link_item (CmmTemplateArg * item, CmmTemplateArg * bef, CmmTemplateArg * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmTemplateArgSect::insertFirst (CmmTemplateArg * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmTemplateArgSect::add (CmmTemplateArg * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmTemplateArgSect::removeAll () { CmmTemplateArg * p = first; while (p != NULL) { CmmTemplateArg * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmTemplateArgSect::CmmTemplateArgSect () : first (NULL), last (NULL), location () { for (int i = 0; i < 3; i ++) location [i] = NULL; } CmmTemplateArgSect::~CmmTemplateArgSect () { removeAll (); } /* CmmTemplateArg */ void CmmTemplateArg::insertBefore (CmmTemplateArg * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmTemplateArg::insertAfter (CmmTemplateArg * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmTemplateArg::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmTemplateArg::~CmmTemplateArg () { if (up != NULL) remove (); } CmmTemplateArg::CmmTemplateArg () : prev (NULL), next (NULL), up (NULL) { } /* CmmTemplateTypeArg */ CmmTemplateTypeArg::CmmTemplateTypeArg () : type (NULL) { } /* CmmTemplateValueArg */ CmmTemplateValueArg::CmmTemplateValueArg () : value (NULL) { } /* CmmTryStat */ CmmTryStat::CmmTryStat () : body (NULL), handlers (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } /* CmmHandlerSect */ void CmmHandlerSect::link_item (CmmHandlerItem * item, CmmHandlerItem * bef, CmmHandlerItem * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmHandlerSect::insertFirst (CmmHandlerItem * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmHandlerSect::add (CmmHandlerItem * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmHandlerSect::removeAll () { CmmHandlerItem * p = first; while (p != NULL) { CmmHandlerItem * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmHandlerSect::~CmmHandlerSect () { removeAll (); } CmmHandlerSect::CmmHandlerSect () : first (NULL), last (NULL) { } /* CmmHandlerItem */ void CmmHandlerItem::insertBefore (CmmHandlerItem * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmHandlerItem::insertAfter (CmmHandlerItem * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmHandlerItem::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmHandlerItem::CmmHandlerItem () : type (NULL), dots (false), body (NULL), prev (NULL), next (NULL), up (NULL), location () { for (int i = 0; i < 4; i ++) location [i] = NULL; } CmmHandlerItem::~CmmHandlerItem () { if (up != NULL) remove (); } /* CmmThrowExpr */ CmmThrowExpr::CmmThrowExpr () : expr (NULL), location () { for (int i = 0; i < 1; i ++) location [i] = NULL; } /* CmmExceptionSect */ void CmmExceptionSect::link_item (CmmExceptionItem * item, CmmExceptionItem * bef, CmmExceptionItem * aft) { assert (this != NULL); assert (item != NULL); assert (item->prev == NULL); assert (item->next == NULL); assert (item->up == NULL); item->prev = bef; item->next = aft; item->up = this; if (bef == NULL) this->first = item; else bef->next = item; if (aft == NULL) this->last = item; else aft->prev = item; } void CmmExceptionSect::insertFirst (CmmExceptionItem * item) { assert (this != NULL); link_item (item, NULL, first); } void CmmExceptionSect::add (CmmExceptionItem * item) { assert (this != NULL); link_item (item, last, NULL); } void CmmExceptionSect::removeAll () { CmmExceptionItem * p = first; while (p != NULL) { CmmExceptionItem * t = p; p = p->next; t->remove (); delete t; } first = NULL; last = NULL; } CmmExceptionSect::CmmExceptionSect () : first (NULL), last (NULL), location () { for (int i = 0; i < 4; i ++) location [i] = NULL; } CmmExceptionSect::~CmmExceptionSect () { removeAll (); } /* CmmTypeDecl */ CmmTypeDecl::CmmTypeDecl () { } /* CmmExceptionItem */ void CmmExceptionItem::insertBefore (CmmExceptionItem * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, prev, this); } void CmmExceptionItem::insertAfter (CmmExceptionItem * item) { assert (this != NULL); assert (up != NULL); up->link_item (item, this, next); } void CmmExceptionItem::remove () { assert (this != NULL); assert (up != NULL); if (prev == NULL) up->first = next; else prev->next = next; if (next == NULL) up->last = prev; else next->prev = prev; prev = NULL; next = NULL; up = NULL; } CmmExceptionItem::~CmmExceptionItem () { if (up != NULL) remove (); } CmmExceptionItem::CmmExceptionItem () : type (NULL), prev (NULL), next (NULL), up (NULL) { } CLOSE_NAMESPACE