Debian Codegraph @

mcs/class/referencesource/System/regex/system/text/regularexpressions/compiledregexrunner.cs

raw
1 //------------------------------------------------------------------------------
2 // <copyright file="CompiledRegexRunner.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 // </copyright>
5 //------------------------------------------------------------------------------
6
7 using System;
8 using System.Diagnostics;
9
10 #if !SILVERLIGHT && !FULL_AOT_RUNTIME
11 using System.Reflection.Emit;
12
13 namespace System.Text.RegularExpressions {
14
15 internal sealed class CompiledRegexRunner : RegexRunner {
16 NoParamDelegate goMethod;
17 FindFirstCharDelegate findFirstCharMethod;
18 NoParamDelegate initTrackCountMethod;
19
20 internal CompiledRegexRunner() {}
21
22 internal void SetDelegates(NoParamDelegate go, FindFirstCharDelegate firstChar, NoParamDelegate trackCount) {
23 goMethod = go;
24 findFirstCharMethod = firstChar;
25 initTrackCountMethod = trackCount;
26 }
27
28 protected override void Go() {
29 goMethod(this);
30 }
31
32 protected override bool FindFirstChar() {
33 return findFirstCharMethod(this);
34 }
35
36 protected override void InitTrackCount() {
37 initTrackCountMethod(this);
38 }
39 }
40
41 internal delegate void NoParamDelegate(RegexRunner r);
42 internal delegate bool FindFirstCharDelegate(RegexRunner r);
43
44 }
45
46 #endif
47