OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // A simple interpreter for the Irregexp byte code. | 5 // A simple interpreter for the Irregexp byte code. |
6 | 6 |
7 #ifndef RUNTIME_VM_REGEXP_INTERPRETER_H_ | 7 #ifndef RUNTIME_VM_REGEXP_INTERPRETER_H_ |
8 #define RUNTIME_VM_REGEXP_INTERPRETER_H_ | 8 #define RUNTIME_VM_REGEXP_INTERPRETER_H_ |
9 | 9 |
10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
11 #include "vm/object.h" | 11 #include "vm/object.h" |
12 #include "vm/zone.h" | 12 #include "vm/zone.h" |
13 | 13 |
14 namespace dart { | 14 namespace dart { |
15 | 15 |
16 class IrregexpInterpreter : public AllStatic { | 16 class IrregexpInterpreter : public AllStatic { |
17 public: | 17 public: |
18 enum IrregexpResult { | 18 enum IrregexpResult { RE_FAILURE = 0, RE_SUCCESS = 1, RE_EXCEPTION = -1 }; |
19 RE_FAILURE = 0, | |
20 RE_SUCCESS = 1, | |
21 RE_EXCEPTION = -1 | |
22 }; | |
23 | 19 |
24 static IrregexpResult Match(const TypedData& bytecode, | 20 static IrregexpResult Match(const TypedData& bytecode, |
25 const String& subject, | 21 const String& subject, |
26 int32_t* captures, | 22 int32_t* captures, |
27 intptr_t start_position, | 23 intptr_t start_position, |
28 Zone* zone); | 24 Zone* zone); |
29 }; | 25 }; |
30 | 26 |
31 } // namespace dart | 27 } // namespace dart |
32 | 28 |
33 #endif // RUNTIME_VM_REGEXP_INTERPRETER_H_ | 29 #endif // RUNTIME_VM_REGEXP_INTERPRETER_H_ |
OLD | NEW |