source: webkit/trunk/JavaScriptCore/runtime/RegExp.h@ 40176

Last change on this file since 40176 was 39554, checked in by [email protected], 16 years ago

Bug 23080: Remove last vestiges of KJS references

<https://bugs.webkit.org/show_bug.cgi?id=23080>

Reviewed by Darin Adler.

Also updated Apple copyright statements.

  • DerivedSources.make: Changed bison "kjsyy" prefix to "jscyy".
  • GNUmakefile.am: Ditto.
  • JavaScriptCore.pri: Ditto. Also changed KJSBISON to JSCBISON and kjsbison to jscbison.
  • JavaScriptCoreSources.bkl: Changed JSCORE_KJS_SOURCES to JSCORE_JSC_SOURCES.
  • jscore.bkl: Ditto.
  • create_hash_table: Updated copyright and removed old comment.
  • parser/Grammar.y: Changed "kjsyy" prefix to "jscyy" prefix.
  • parser/Lexer.cpp: Ditto. Also changed KJS_DEBUG_LEX to JSC_DEBUG_LEX. (jscyylex): (JSC::Lexer::lex):
  • parser/Parser.cpp: Ditto. (JSC::Parser::parse):
  • pcre/dftables: Changed "kjs_pcre_" prefix to "jsc_pcre_".
  • pcre/pcre_compile.cpp: Ditto. (getOthercaseRange): (encodeUTF8): (compileBranch): (calculateCompiledPatternLength):
  • pcre/pcre_exec.cpp: Ditto. (matchRef): (getUTF8CharAndIncrementLength): (match):
  • pcre/pcre_internal.h: Ditto. (toLowerCase): (flipCase): (classBitmapForChar): (charTypeForChar):
  • pcre/pcre_tables.cpp: Ditto.
  • pcre/pcre_ucp_searchfuncs.cpp: Ditto. (jsc_pcre_ucp_othercase):
  • pcre/pcre_xclass.cpp: Ditto. (getUTF8CharAndAdvancePointer): (jsc_pcre_xclass):
  • runtime/Collector.h: Updated header guards using the clean-header-guards script.
  • runtime/CollectorHeapIterator.h: Added missing header guard.
  • runtime/Identifier.h: Updated header guards.
  • runtime/JSFunction.h: Fixed end-of-namespace comment.
  • runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset): Renamed "kjsprint" debug function to "jscprint". Changed implementation method from globalFuncKJSPrint() to globalFuncJSCPrint().
  • runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncJSCPrint): Renamed from globalFuncKJSPrint().
  • runtime/JSGlobalObjectFunctions.h: Ditto.
  • runtime/JSImmediate.h: Updated header guards.
  • runtime/JSLock.h: Ditto.
  • runtime/JSType.h: Ditto.
  • runtime/JSWrapperObject.h: Ditto.
  • runtime/Lookup.h: Ditto.
  • runtime/Operations.h: Ditto.
  • runtime/Protect.h: Ditto.
  • runtime/RegExp.h: Ditto.
  • runtime/UString.h: Ditto.
  • tests/mozilla/js1_5/Array/regress-157652.js: Changed "KJS" reference in comment to "JSC".
  • wrec/CharacterClassConstructor.cpp: Change "kjs_pcre_" function prefixes to "jsc_pcre_". (JSC::WREC::CharacterClassConstructor::put): (JSC::WREC::CharacterClassConstructor::flush):
  • wtf/unicode/Unicode.h: Change "KJS_" header guard to "WTF_".
  • wtf/unicode/icu/UnicodeIcu.h: Ditto.
  • wtf/unicode/qt4/UnicodeQt4.h: Ditto.
  • Property svn:eol-style set to native
File size: 2.7 KB
Line 
1/*
2 * Copyright (C) 1999-2000 Harri Porten ([email protected])
3 * Copyright (C) 2007, 2008, 2009 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 RegExp_h
22#define RegExp_h
23
24#include "UString.h"
25#include "WREC.h"
26#include "ExecutableAllocator.h"
27#include <wtf/Forward.h>
28#include <wtf/RefCounted.h>
29
30struct JSRegExp;
31
32namespace JSC {
33
34 class JSGlobalData;
35
36 class RegExp : public RefCounted<RegExp> {
37 public:
38 static PassRefPtr<RegExp> create(JSGlobalData* globalData, const UString& pattern);
39 static PassRefPtr<RegExp> create(JSGlobalData* globalData, const UString& pattern, const UString& flags);
40 ~RegExp();
41
42 bool global() const { return m_flagBits & Global; }
43 bool ignoreCase() const { return m_flagBits & IgnoreCase; }
44 bool multiline() const { return m_flagBits & Multiline; }
45
46 const UString& pattern() const { return m_pattern; }
47 const UString& flags() const { return m_flags; }
48
49 bool isValid() const { return !m_constructionError; }
50 const char* errorMessage() const { return m_constructionError; }
51
52 int match(const UString&, int startOffset, OwnArrayPtr<int>* ovector = 0);
53 unsigned numSubpatterns() const { return m_numSubpatterns; }
54
55 private:
56 RegExp(JSGlobalData* globalData, const UString& pattern);
57 RegExp(JSGlobalData* globalData, const UString& pattern, const UString& flags);
58
59 void compile();
60
61 enum FlagBits { Global = 1, IgnoreCase = 2, Multiline = 4 };
62
63 UString m_pattern; // FIXME: Just decompile m_regExp instead of storing this.
64 UString m_flags; // FIXME: Just decompile m_regExp instead of storing this.
65 int m_flagBits;
66 JSRegExp* m_regExp;
67 const char* m_constructionError;
68 unsigned m_numSubpatterns;
69
70#if ENABLE(WREC)
71 WREC::CompiledRegExp m_wrecFunction;
72 RefPtr<ExecutablePool> m_executablePool;
73#endif
74 };
75
76} // namespace JSC
77
78#endif // RegExp_h
Note: See TracBrowser for help on using the repository browser.