Show
Ignore:
Timestamp:
02/15/10 15:17:06 (7 months ago)
Author:
weyrick
Message:

classDecl interface and dump

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/rphp/include/rphp/analysis/pAST.h

    r1041 r1043  
    663663public: 
    664664 
    665     enum classType { NORMAL, IFACE, FINAL, ABSTRACT }; 
     665    enum classTypes { NORMAL, 
     666                      IFACE, // "INTERFACE" is keyword? throws error 
     667                      FINAL, 
     668                      ABSTRACT }; 
    666669 
    667670private: 
     
    669672    idList extends_; 
    670673    idList implements_; 
    671     classType type_; 
     674    classTypes classType_; 
    672675    block* members_; 
    673676     
     
    677680    classDecl(const classDecl& other, pParseContext& C): decl(other), 
    678681        name_(other.name_), extends_(other.extends_), implements_(other.implements_), 
    679         type_(other.type_), members_(0) 
     682        classType_(other.classType_), members_(0) 
    680683    { 
    681684        if(other.members_) 
     
    686689    classDecl(pParseContext& C, 
    687690              const pSourceRange& name, 
    688               classType type, 
     691              classTypes type, 
    689692              const sourceRangeList* extends, // may be null 
    690693              const sourceRangeList* implements, // may be null 
     
    695698        extends_(), 
    696699        implements_(), 
    697         type_(type), 
     700        classType_(type), 
    698701        members_(members) 
    699702    { 
     
    726729        return *name_; 
    727730    } 
     731 
    728732    block* members(void) { return members_; } 
     733 
     734    classTypes classType(void) const { return classType_; } 
     735 
     736    pUInt implementsCount(void) const { return implements_.size(); } 
     737    pUInt extendsCount(void) const { return extends_.size(); } 
    729738 
    730739    stmt::child_iterator child_begin() { return (stmt**)&members_; } 
    731740    stmt::child_iterator child_end() { return (stmt**)&members_+1; } 
     741 
     742    idList::iterator extends_begin() { return extends_.begin(); } 
     743    idList::iterator extends_end() { return extends_.end(); } 
     744 
     745    idList::iterator implements_begin() { return implements_.begin(); } 
     746    idList::iterator implements_end() { return implements_.end(); } 
    732747 
    733748    IMPLEMENT_SUPPORT_MEMBERS(classDecl);