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

Last change on this file since 57879 was 55322, checked in by [email protected], 15 years ago

Rubber Stamped by Geoff Garen.

Remove wrec. All builds should have switched to yarr by now.

(JSC::RegExp::match):

  • runtime/RegExp.h:
  • wrec: Removed.
  • wrec/CharacterClass.cpp: Removed.
  • wrec/CharacterClass.h: Removed.
  • wrec/CharacterClassConstructor.cpp: Removed.
  • wrec/CharacterClassConstructor.h: Removed.
  • wrec/Escapes.h: Removed.
  • wrec/Quantifier.h: Removed.
  • wrec/WREC.cpp: Removed.
  • wrec/WREC.h: Removed.
  • wrec/WRECFunctors.cpp: Removed.
  • wrec/WRECFunctors.h: Removed.
  • wrec/WRECGenerator.cpp: Removed.
  • wrec/WRECGenerator.h: Removed.
  • wrec/WRECParser.cpp: Removed.
  • wrec/WRECParser.h: Removed.
  • wscript:
  • 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 * Copyright (C) 2009 Torch Mobile, Inc.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 */
21
22#ifndef RegExp_h
23#define RegExp_h
24
25#include "UString.h"
26#include "ExecutableAllocator.h"
27#include <wtf/Forward.h>
28#include <wtf/RefCounted.h>
29#include "yarr/RegexJIT.h"
30#include "yarr/RegexInterpreter.h"
31
32struct JSRegExp;
33
34namespace JSC {
35
36 class JSGlobalData;
37
38 class RegExp : public RefCounted<RegExp> {
39 public:
40 static PassRefPtr<RegExp> create(JSGlobalData* globalData, const UString& pattern);
41 static PassRefPtr<RegExp> create(JSGlobalData* globalData, const UString& pattern, const UString& flags);
42#if !ENABLE(YARR)
43 ~RegExp();
44#endif
45
46 bool global() const { return m_flagBits & Global; }
47 bool ignoreCase() const { return m_flagBits & IgnoreCase; }
48 bool multiline() const { return m_flagBits & Multiline; }
49
50 const UString& pattern() const { return m_pattern; }
51
52 bool isValid() const { return !m_constructionError; }
53 const char* errorMessage() const { return m_constructionError; }
54
55 int match(const UString&, int startOffset, Vector<int, 32>* ovector = 0);
56 unsigned numSubpatterns() const { return m_numSubpatterns; }
57
58 private:
59 RegExp(JSGlobalData* globalData, const UString& pattern);
60 RegExp(JSGlobalData* globalData, const UString& pattern, const UString& flags);
61
62 void compile(JSGlobalData*);
63
64 enum FlagBits { Global = 1, IgnoreCase = 2, Multiline = 4 };
65
66 UString m_pattern; // FIXME: Just decompile m_regExp instead of storing this.
67 int m_flagBits;
68 const char* m_constructionError;
69 unsigned m_numSubpatterns;
70
71#if ENABLE(YARR_JIT)
72 Yarr::RegexCodeBlock m_regExpJITCode;
73#elif ENABLE(YARR)
74 OwnPtr<Yarr::BytecodePattern> m_regExpBytecode;
75#else
76 JSRegExp* m_regExp;
77#endif
78 };
79
80} // namespace JSC
81
82#endif // RegExp_h
Note: See TracBrowser for help on using the repository browser.