11cb0ef41Sopenharmony_ci// Copyright 2016 the V8 project authors. All rights reserved.
21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be
31cb0ef41Sopenharmony_ci// found in the LICENSE file.
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci#ifndef V8_REGEXP_REGEXP_PARSER_H_
61cb0ef41Sopenharmony_ci#define V8_REGEXP_REGEXP_PARSER_H_
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ci#include "src/common/assert-scope.h"
91cb0ef41Sopenharmony_ci#include "src/handles/handles.h"
101cb0ef41Sopenharmony_ci#include "src/regexp/regexp-flags.h"
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_cinamespace v8 {
131cb0ef41Sopenharmony_cinamespace internal {
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_ciclass String;
161cb0ef41Sopenharmony_ciclass Zone;
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_cistruct RegExpCompileData;
191cb0ef41Sopenharmony_ci
201cb0ef41Sopenharmony_ciclass V8_EXPORT_PRIVATE RegExpParser : public AllStatic {
211cb0ef41Sopenharmony_ci public:
221cb0ef41Sopenharmony_ci  static bool ParseRegExpFromHeapString(Isolate* isolate, Zone* zone,
231cb0ef41Sopenharmony_ci                                        Handle<String> input, RegExpFlags flags,
241cb0ef41Sopenharmony_ci                                        RegExpCompileData* result);
251cb0ef41Sopenharmony_ci
261cb0ef41Sopenharmony_ci  template <class CharT>
271cb0ef41Sopenharmony_ci  static bool VerifyRegExpSyntax(Zone* zone, uintptr_t stack_limit,
281cb0ef41Sopenharmony_ci                                 const CharT* input, int input_length,
291cb0ef41Sopenharmony_ci                                 RegExpFlags flags, RegExpCompileData* result,
301cb0ef41Sopenharmony_ci                                 const DisallowGarbageCollection& no_gc);
311cb0ef41Sopenharmony_ci
321cb0ef41Sopenharmony_ci  // Used by the SpiderMonkey embedding of irregexp.
331cb0ef41Sopenharmony_ci  static bool VerifyRegExpSyntax(Isolate* isolate, Zone* zone,
341cb0ef41Sopenharmony_ci                                 Handle<String> input, RegExpFlags flags,
351cb0ef41Sopenharmony_ci                                 RegExpCompileData* result,
361cb0ef41Sopenharmony_ci                                 const DisallowGarbageCollection& no_gc);
371cb0ef41Sopenharmony_ci};
381cb0ef41Sopenharmony_ci
391cb0ef41Sopenharmony_ci}  // namespace internal
401cb0ef41Sopenharmony_ci}  // namespace v8
411cb0ef41Sopenharmony_ci
421cb0ef41Sopenharmony_ci#endif  // V8_REGEXP_REGEXP_PARSER_H_
43