21 #ifndef _REGEXP_OBJECT_H_
22 #define _REGEXP_OBJECT_H_
25 #include "function_object.h"
30 class RegExpPrototypeImp :
public ObjectImp {
32 RegExpPrototypeImp(ExecState *exec,
33 ObjectPrototypeImp *objProto,
34 FunctionPrototypeImp *funcProto);
35 virtual const ClassInfo *classInfo()
const {
return &info; }
36 static const ClassInfo info;
39 class RegExpProtoFuncImp :
public InternalFunctionImp {
41 RegExpProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto,
int i,
int len,
42 const Identifier &_ident);
44 virtual bool implementsCall()
const;
45 virtual Value call(ExecState *exec, Object &thisObj,
const List &args);
47 enum { Exec, Test, ToString, Compile };
52 class RegExpImp :
public ObjectImp {
54 RegExpImp(RegExpPrototypeImp *regexpProto);
56 void setRegExp(RegExp *r);
57 RegExp* regExp() {
return reg; }
59 virtual const ClassInfo *classInfo()
const {
return &info; }
60 static const ClassInfo info;
65 class RegExpObjectImp :
public InternalFunctionImp {
67 RegExpObjectImp(ExecState *exec,
68 FunctionPrototypeImp *funcProto,
69 RegExpPrototypeImp *regProto);
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);
76 Value get(ExecState *exec,
const Identifier &p)
const;
77 bool hasProperty(ExecState *exec,
const Identifier &propertyName)
const;
78 int ** registerRegexp(
const RegExp* re,
const UString& s );
79 void setSubPatterns(
int num) { lastNrSubPatterns = num; }
80 Object arrayOfMatches(ExecState *exec,
const UString &result)
const;
87 static RegExp* makeEngine(ExecState *exec,
const UString &p,
const Value &flagsInput);
91 unsigned int lastNrSubPatterns;