source: webkit/trunk/JavaScriptCore/kjs/RegExpObject.h@ 34582

Last change on this file since 34582 was 34582, checked in by Darin Adler, 17 years ago

JavaScriptCore:

2008-06-15 Darin Adler <Darin Adler>

  • API/JSCallbackFunction.cpp:
  • API/JSObjectRef.cpp:
  • DerivedSources.make:
  • GNUmakefile.am:
  • JavaScriptCore.exp:
  • JavaScriptCore.pri:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • JavaScriptCoreSources.bkl:
  • VM/Machine.cpp:
  • kjs/AllInOneFile.cpp:
  • kjs/ArrayPrototype.cpp: Copied from JavaScriptCore/kjs/array_object.cpp.
  • kjs/ArrayPrototype.h: Copied from JavaScriptCore/kjs/array_object.h.
  • kjs/BooleanObject.cpp: Copied from JavaScriptCore/kjs/bool_object.cpp.
  • kjs/BooleanObject.h: Copied from JavaScriptCore/kjs/bool_object.h.
  • kjs/ExecState.cpp:
  • kjs/ExecState.h:
  • kjs/FunctionPrototype.cpp: Copied from JavaScriptCore/kjs/function_object.cpp.
  • kjs/FunctionPrototype.h: Copied from JavaScriptCore/kjs/function_object.h.
  • kjs/JSArray.cpp: Copied from JavaScriptCore/kjs/array_instance.cpp.
  • kjs/JSArray.h: Copied from JavaScriptCore/kjs/array_instance.h.
  • kjs/JSFunction.cpp:
  • kjs/JSFunction.h:
  • kjs/JSGlobalObject.cpp:
  • kjs/JSImmediate.cpp:
  • kjs/JSObject.h:
  • kjs/JSString.h:
  • kjs/JSValue.h:
  • kjs/JSVariableObject.cpp:
  • kjs/MathObject.cpp: Copied from JavaScriptCore/kjs/math_object.cpp.
  • kjs/MathObject.h: Copied from JavaScriptCore/kjs/math_object.h.
  • kjs/NumberObject.cpp: Copied from JavaScriptCore/kjs/number_object.cpp.
  • kjs/NumberObject.h: Copied from JavaScriptCore/kjs/number_object.h.
  • kjs/PropertyMap.cpp: Copied from JavaScriptCore/kjs/property_map.cpp.
  • kjs/PropertyMap.h: Copied from JavaScriptCore/kjs/property_map.h.
  • kjs/PropertySlot.cpp: Copied from JavaScriptCore/kjs/property_slot.cpp.
  • kjs/PropertySlot.h: Copied from JavaScriptCore/kjs/property_slot.h.
  • kjs/RegExpObject.cpp: Copied from JavaScriptCore/kjs/regexp_object.cpp.
  • kjs/RegExpObject.h: Copied from JavaScriptCore/kjs/regexp_object.h.
  • kjs/ScopeChain.cpp: Copied from JavaScriptCore/kjs/scope_chain.cpp.
  • kjs/ScopeChain.h: Copied from JavaScriptCore/kjs/scope_chain.h.
  • kjs/ScopeChainMark.h: Copied from JavaScriptCore/kjs/scope_chain_mark.h.
  • kjs/Shell.cpp:
  • kjs/array_instance.cpp: Removed.
  • kjs/array_instance.h: Removed.
  • kjs/array_object.cpp: Removed.
  • kjs/array_object.h: Removed.
  • kjs/bool_object.cpp: Removed.
  • kjs/bool_object.h: Removed.
  • kjs/error_object.h:
  • kjs/function_object.cpp: Removed.
  • kjs/function_object.h: Removed.
  • kjs/internal.cpp:
  • kjs/math_object.cpp: Removed.
  • kjs/math_object.h: Removed.
  • kjs/nodes.cpp:
  • kjs/number_object.cpp: Removed.
  • kjs/number_object.h: Removed.
  • kjs/object_object.cpp:
  • kjs/property_map.cpp: Removed.
  • kjs/property_map.h: Removed.
  • kjs/property_slot.cpp: Removed.
  • kjs/property_slot.h: Removed.
  • kjs/regexp_object.cpp: Removed.
  • kjs/regexp_object.h: Removed.
  • kjs/scope_chain.cpp: Removed.
  • kjs/scope_chain.h: Removed.
  • kjs/scope_chain_mark.h: Removed.
  • kjs/string_object.cpp:
  • kjs/string_object.h:

WebCore:

2008-06-15 Darin Adler <Darin Adler>

  • ForwardingHeaders/kjs/ArrayPrototype.h: Copied from WebCore/ForwardingHeaders/kjs/array_object.h.
  • ForwardingHeaders/kjs/BooleanObject.h: Copied from WebCore/ForwardingHeaders/kjs/bool_object.h.
  • ForwardingHeaders/kjs/FunctionPrototype.h: Copied from WebCore/ForwardingHeaders/kjs/function_object.h.
  • ForwardingHeaders/kjs/JSArray.h: Copied from WebCore/ForwardingHeaders/kjs/array_instance.h.
  • ForwardingHeaders/kjs/PropertyMap.h: Copied from WebCore/ForwardingHeaders/kjs/property_map.h.
  • ForwardingHeaders/kjs/array_instance.h: Removed.
  • ForwardingHeaders/kjs/array_object.h: Removed.
  • ForwardingHeaders/kjs/bool_object.h: Removed.
  • ForwardingHeaders/kjs/function_object.h: Removed.
  • ForwardingHeaders/kjs/property_map.h: Removed.
  • WebCore.vcproj/WebCore.vcproj:
  • bindings/js/JSClipboardCustom.cpp:
  • bindings/js/JSDatabaseCustom.cpp:
  • bindings/js/JSJavaScriptCallFrameCustom.cpp:
  • bindings/js/kjs_events.cpp:
  • bridge/jni/jni_utility.cpp:
  • bridge/qt/qt_runtime.cpp:
  • bridge/runtime_array.cpp:

WebKit/mac:

2008-06-15 Darin Adler <Darin Adler>

  • WebView/WebView.mm:

WebKit/qt:

2008-06-15 Darin Adler <Darin Adler>

  • WebKit_pch.h:

WebKitTools:

2008-06-15 Darin Adler <Darin Adler>

  • Scripts/do-file-rename: Updated.
  • Scripts/do-webcore-rename: Updated for the latest round of renaming.
  • Property svn:eol-style set to native
File size: 3.7 KB
Line 
1/*
2 * Copyright (C) 1999-2000 Harri Porten ([email protected])
3 * Copyright (C) 2003, 2007, 2008 Apple Inc. All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 */
20
21#ifndef RegExpObject_h
22#define RegExpObject_h
23
24#include "FunctionPrototype.h"
25#include "regexp.h"
26
27namespace KJS {
28
29 struct RegExpConstructorPrivate;
30
31 class RegExpPrototype : public JSObject {
32 public:
33 RegExpPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*);
34
35 virtual const ClassInfo* classInfo() const { return &info; }
36 static const ClassInfo info;
37 };
38
39 class RegExpObject : public JSObject {
40 public:
41 enum { Global, IgnoreCase, Multiline, Source, LastIndex };
42
43 RegExpObject(RegExpPrototype*, PassRefPtr<RegExp>);
44 virtual ~RegExpObject();
45
46 void setRegExp(PassRefPtr<RegExp> r) { m_regExp = r; }
47 RegExp* regExp() const { return m_regExp.get(); }
48
49 JSValue* test(ExecState*, const List& args);
50 JSValue* exec(ExecState*, const List& args);
51
52 virtual CallType getCallData(CallData&);
53 virtual JSValue* callAsFunction(ExecState*, JSObject*, const List&);
54
55 bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
56 JSValue* getValueProperty(ExecState*, int token) const;
57 void put(ExecState*, const Identifier&, JSValue*);
58 void putValueProperty(ExecState*, int token, JSValue*);
59
60 virtual const ClassInfo* classInfo() const { return &info; }
61 static const ClassInfo info;
62
63 void setLastIndex(double lastIndex) { m_lastIndex = lastIndex; }
64
65 private:
66 bool match(ExecState*, const List& args);
67
68 RefPtr<RegExp> m_regExp;
69 double m_lastIndex;
70 };
71
72 class RegExpConstructor : public InternalFunction {
73 public:
74 enum { Dollar1, Dollar2, Dollar3, Dollar4, Dollar5, Dollar6, Dollar7, Dollar8, Dollar9,
75 Input, Multiline, LastMatch, LastParen, LeftContext, RightContext };
76
77 RegExpConstructor(ExecState*, FunctionPrototype*, RegExpPrototype*);
78
79 virtual ConstructType getConstructData(ConstructData&);
80 virtual JSObject* construct(ExecState*, const List&);
81
82 virtual JSValue* callAsFunction(ExecState*, JSObject*, const List&);
83
84 virtual void put(ExecState*, const Identifier&, JSValue*);
85 void putValueProperty(ExecState*, int token, JSValue*);
86 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
87 JSValue* getValueProperty(ExecState*, int token) const;
88
89 virtual const ClassInfo* classInfo() const { return &info; }
90 static const ClassInfo info;
91
92 void performMatch(RegExp*, const UString&, int startOffset, int& position, int& length, int** ovector = 0);
93 JSObject* arrayOfMatches(ExecState*) const;
94 const UString& input() const;
95
96 private:
97 JSValue* getBackref(unsigned) const;
98 JSValue* getLastParen() const;
99 JSValue* getLeftContext() const;
100 JSValue* getRightContext() const;
101
102 OwnPtr<RegExpConstructorPrivate> d;
103 };
104
105} // namespace
106
107#endif
Note: See TracBrowser for help on using the repository browser.