regexp-parser.h 1.42 KB
Newer Older
1 2 3 4 5 6 7
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_REGEXP_REGEXP_PARSER_H_
#define V8_REGEXP_REGEXP_PARSER_H_

8 9
#include "src/common/assert-scope.h"
#include "src/handles/handles.h"
10
#include "src/regexp/regexp-flags.h"
11 12 13 14

namespace v8 {
namespace internal {

15 16
class String;
class Zone;
17

18
struct RegExpCompileData;
19

20
class V8_EXPORT_PRIVATE RegExpParser : public AllStatic {
21
 public:
22
  static bool ParseRegExpFromHeapString(Isolate* isolate, Zone* zone,
23
                                        Handle<String> input, RegExpFlags flags,
24
                                        RegExpCompileData* result);
25

26 27 28 29 30 31
  template <class CharT>
  static bool VerifyRegExpSyntax(Zone* zone, uintptr_t stack_limit,
                                 const CharT* input, int input_length,
                                 RegExpFlags flags, RegExpCompileData* result,
                                 const DisallowGarbageCollection& no_gc);

32 33
  // Used by the SpiderMonkey embedding of irregexp.
  static bool VerifyRegExpSyntax(Isolate* isolate, Zone* zone,
34
                                 Handle<String> input, RegExpFlags flags,
35
                                 RegExpCompileData* result,
36
                                 const DisallowGarbageCollection& no_gc);
37 38 39 40 41 42
};

}  // namespace internal
}  // namespace v8

#endif  // V8_REGEXP_REGEXP_PARSER_H_