22 #ifndef _REGEXP_OBJECT_H_
23 #define _REGEXP_OBJECT_H_
26 #include "function_object.h"
31 class RegExpPrototypeImp :
public ObjectImp {
33 RegExpPrototypeImp(ExecState *exec,
34 ObjectPrototypeImp *objProto,
35 FunctionPrototypeImp *funcProto);
36 virtual const ClassInfo *classInfo()
const {
return &info; }
37 static const ClassInfo info;
40 class RegExpProtoFuncImp :
public InternalFunctionImp {
42 RegExpProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto,
int i,
int len,
43 const Identifier &_ident);
45 virtual bool implementsCall()
const;
46 virtual Value call(ExecState *exec, Object &thisObj,
const List &args);
48 enum { Exec, Test, ToString, Compile };
53 class RegExpImp :
public ObjectImp {
55 RegExpImp(RegExpPrototypeImp *regexpProto);
57 void setRegExp(RegExp *r);
58 RegExp* regExp() {
return reg; }
60 virtual const ClassInfo *classInfo()
const {
return &info; }
61 static const ClassInfo info;
66 class RegExpObjectImp :
public InternalFunctionImp {
68 RegExpObjectImp(ExecState *exec,
69 FunctionPrototypeImp *funcProto,
70 RegExpPrototypeImp *regProto);
71 virtual ~RegExpObjectImp();
72 virtual bool implementsConstruct()
const;
73 virtual Object construct(ExecState *exec,
const List &args);
74 virtual bool implementsCall()
const;
75 virtual Value call(ExecState *exec, Object &thisObj,
const List &args);
77 Value get(ExecState *exec,
const Identifier &p)
const;
78 bool hasProperty(ExecState *exec,
const Identifier &propertyName)
const;
79 int ** registerRegexp(
const RegExp* re,
const UString& s );
80 void setSubPatterns(
int num) { lastNrSubPatterns = num; }
81 Object arrayOfMatches(ExecState *exec,
const UString &result)
const;
88 static RegExp* makeEngine(ExecState *exec,
const UString &p,
const Value &flagsInput);
92 unsigned int lastNrSubPatterns;