Ignore:
Timestamp:
Mar 21, 2002, 4:31:57 PM (23 years ago)
Author:
mjs
Message:

Merged changes from LABYRINTH_KDE_3_MERGE branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/regexp_object.h

    r6 r798  
     1// -*- c-basic-offset: 2 -*-
    12/*
    23 *  This file is part of the KDE libraries
     
    1617 *  License along with this library; if not, write to the Free Software
    1718 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     19 *
     20 *  $Id$
    1821 */
    1922
     
    2124#define _REGEXP_OBJECT_H_
    2225
    23 #include "object.h"
    24 #include "function.h"
     26#include "internal.h"
     27#include "function_object.h"
     28#include "regexp.h"
    2529
    2630namespace KJS {
    27 
    28   class RegExpObject : public ConstructorImp {
     31  class ExecState;
     32  class RegExpPrototypeImp : public ObjectImp {
    2933  public:
    30     RegExpObject(const Object& funcProto, const Object &regProto);
    31     Completion execute(const List &);
    32     Object construct(const List &);
     34    RegExpPrototypeImp(ExecState *exec,
     35                       ObjectPrototypeImp *objProto,
     36                       FunctionPrototypeImp *funcProto);
    3337  };
    3438
    35   class RegExpPrototype : public ObjectImp {
     39  class RegExpProtoFuncImp : public InternalFunctionImp {
    3640  public:
    37     RegExpPrototype(const Object& proto);
    38     KJSO get(const UString &p) const;
    39   };
     41    RegExpProtoFuncImp(ExecState *exec,
     42                       FunctionPrototypeImp *funcProto, int i, int len);
    4043
    41   class RegExpProtoFunc : public InternalFunctionImp {
    42   public:
    43     RegExpProtoFunc(int i) : id(i) { }
    44     Completion execute(const List &);
     44    virtual bool implementsCall() const;
     45    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
     46
    4547    enum { Exec, Test, ToString };
    4648  private:
     
    4850  };
    4951
     52  class RegExpImp : public ObjectImp {
     53  public:
     54    RegExpImp(RegExpPrototypeImp *regexpProto);
     55    ~RegExpImp();
     56    void setRegExp(RegExp *r) { reg = r; }
     57    RegExp* regExp() const { return reg; }
     58
     59    virtual const ClassInfo *classInfo() const { return &info; }
     60    static const ClassInfo info;
     61  private:
     62    RegExp *reg;
     63  };
     64
     65  class RegExpObjectImp : public InternalFunctionImp {
     66  public:
     67    RegExpObjectImp(ExecState *exec,
     68                    RegExpPrototypeImp *regProto,
     69                    FunctionPrototypeImp *funcProto);
     70    virtual ~RegExpObjectImp();
     71    virtual bool implementsConstruct() const;
     72    virtual Object construct(ExecState *exec, const List &args);
     73    virtual bool implementsCall() const;
     74    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
     75
     76    Value get(ExecState *exec, const UString &p) const;
     77    int ** registerRegexp( const RegExp* re, const UString& s );
     78    Value arrayOfMatches(ExecState *exec, const UString &result) const;
     79  private:
     80    UString lastString;
     81    int *lastOvector;
     82    uint lastNrSubPatterns;
     83  };
     84
    5085}; // namespace
    5186
Note: See TracChangeset for help on using the changeset viewer.