Changeset 87484f1 in tol


Ignore:
Timestamp:
Oct 8, 2009, 10:42:22 AM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
dd045c73
Parents:
bb652a3
Message:

New methods for selecting stored members and methods

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@1503 be4846ae-f051-483a-831f-b64e7d08527f

Location:
tol/btol/bgrammar
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/bgrammar/class.cpp

    rbb652a3 r87484f1  
    903903}
    904904
     905//--------------------------------------------------------------------
     906  BList* BMemberOwner::Select(
     907    BList* lst, bool isStatic, bool isMethod) const
     908//--------------------------------------------------------------------
     909{
     910  int i;
     911  for(i=0; i<member_.Size(); i++)
     912  {
     913    BMember& mbr = *(member_[i]->member_);
     914    if((mbr.isStatic_==isStatic) &&
     915       (mbr.isMethod_==isMethod))
     916    {
     917           if(mbr.method_) { lst = Cons(mbr.method_,lst); }
     918      else if(mbr.static_) { lst = Cons(mbr.static_,lst); }
     919    }
     920  }
     921  return(lst);
     922};
     923
     924//--------------------------------------------------------------------
     925  BList* BMemberOwner::SelectStaticMembers(BList* lst) const
     926//--------------------------------------------------------------------
     927{
     928  return(Select(lst, true, false));
     929}
     930
     931//--------------------------------------------------------------------
     932  BList* BMemberOwner::SelectStaticMethods(BList* lst) const
     933//--------------------------------------------------------------------
     934{
     935  return(Select(lst, true, true));
     936}
     937
     938//--------------------------------------------------------------------
     939  BList* BMemberOwner::SelectNonStaticMethods(BList* lst) const
     940//--------------------------------------------------------------------
     941{
     942  return(Select(lst, false, true));
     943}
    905944
    906945//--------------------------------------------------------------------
    … …  
    932971  return(nb_->Dump());
    933972}
     973
    934974
    935975//--------------------------------------------------------------------
  • tol/btol/bgrammar/tol_bclass.h

    rbb652a3 r87484f1  
    155155  //! Sorts parsed members by appearing order
    156156  void SortMembers();
     157  BList* Select(BList* lst, bool isStatic, bool isMethod) const;
     158  BList* SelectStaticMembers(BList* lst) const;
     159  BList* SelectStaticMethods(BList* lst) const;
     160  BList* SelectNonStaticMethods(BList* lst) const;
    157161  DeclareClassNewDelete(BMemberOwner);
    158162};
Note: See TracChangeset for help on using the changeset viewer.