regexp_object.h
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 #ifndef _REGEXP_OBJECT_H_
00023 #define _REGEXP_OBJECT_H_
00024 
00025 #include "internal.h"
00026 #include "function_object.h"
00027 #include "regexp.h"
00028 
00029 namespace KJS {
00030   class ExecState;
00031   class RegExpPrototypeImp : public ObjectImp {
00032   public:
00033     RegExpPrototypeImp(ExecState *exec,
00034                        ObjectPrototypeImp *objProto,
00035                        FunctionPrototypeImp *funcProto);
00036   };
00037 
00038   class RegExpProtoFuncImp : public InternalFunctionImp {
00039   public:
00040     RegExpProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto, int i, int len,
00041                        const Identifier &_ident);
00042 
00043     virtual bool implementsCall() const;
00044     virtual Value call(ExecState *exec, Object &thisObj, const List &args);
00045 
00046     enum { Exec, Test, ToString };
00047   private:
00048     int id;
00049   };
00050 
00051   class RegExpImp : public ObjectImp {
00052   public:
00053     RegExpImp(RegExpPrototypeImp *regexpProto);
00054     ~RegExpImp();
00055     void setRegExp(RegExp *r) { reg = r; }
00056     RegExp* regExp() const { return reg; }
00057 
00058     virtual const ClassInfo *classInfo() const { return &info; }
00059     static const ClassInfo info;
00060   private:
00061     RegExp *reg;
00062   };
00063 
00064   class RegExpObjectImp : public InternalFunctionImp {
00065   public:
00066     RegExpObjectImp(ExecState *exec,
00067                     FunctionPrototypeImp *funcProto,
00068                     RegExpPrototypeImp *regProto);
00069     virtual ~RegExpObjectImp();
00070     virtual bool implementsConstruct() const;
00071     virtual Object construct(ExecState *exec, const List &args);
00072     virtual bool implementsCall() const;
00073     virtual Value call(ExecState *exec, Object &thisObj, const List &args);
00074 
00075     Value get(ExecState *exec, const Identifier &p) const;
00076     int ** registerRegexp( const RegExp* re, const UString& s );
00077     void setSubPatterns(int num) { lastNrSubPatterns = num; }
00078     Object arrayOfMatches(ExecState *exec, const UString &result) const;
00079   private:
00080     UString lastString;
00081     int *lastOvector;
00082     uint lastNrSubPatterns;
00083   };
00084 
00085 } 
00086 
00087 #endif
 
This file is part of the documentation for kjs Library Version 3.2.0.