202 references to RegexOpcode
System.Text.RegularExpressions (202)
System\Text\RegularExpressions\RegexInterpreterCode.cs (122)
26
public static bool OpcodeBacktracks(
RegexOpcode
opcode)
28
opcode &=
RegexOpcode
.OperatorMask;
30
RegexOpcode
.Oneloop or
31
RegexOpcode
.Onelazy or
32
RegexOpcode
.Notoneloop or
33
RegexOpcode
.Notonelazy or
34
RegexOpcode
.Setloop or
35
RegexOpcode
.Setlazy or
36
RegexOpcode
.Lazybranch or
37
RegexOpcode
.Branchmark or
38
RegexOpcode
.Lazybranchmark or
39
RegexOpcode
.Nullcount or
40
RegexOpcode
.Setcount or
41
RegexOpcode
.Branchcount or
42
RegexOpcode
.Lazybranchcount or
43
RegexOpcode
.Setmark or
44
RegexOpcode
.Capturemark or
45
RegexOpcode
.Getmark or
46
RegexOpcode
.Setjump or
47
RegexOpcode
.Backjump or
48
RegexOpcode
.Forejump or
49
RegexOpcode
.Goto;
56
public static int OpcodeSize(
RegexOpcode
opcode)
58
opcode &=
RegexOpcode
.OperatorMask;
61
case
RegexOpcode
.Nothing:
62
case
RegexOpcode
.Bol:
63
case
RegexOpcode
.Eol:
64
case
RegexOpcode
.Boundary:
65
case
RegexOpcode
.NonBoundary:
66
case
RegexOpcode
.ECMABoundary:
67
case
RegexOpcode
.NonECMABoundary:
68
case
RegexOpcode
.Beginning:
69
case
RegexOpcode
.Start:
70
case
RegexOpcode
.EndZ:
71
case
RegexOpcode
.End:
72
case
RegexOpcode
.Nullmark:
73
case
RegexOpcode
.Setmark:
74
case
RegexOpcode
.Getmark:
75
case
RegexOpcode
.Setjump:
76
case
RegexOpcode
.Backjump:
77
case
RegexOpcode
.Forejump:
78
case
RegexOpcode
.Stop:
79
case
RegexOpcode
.UpdateBumpalong:
83
case
RegexOpcode
.One:
84
case
RegexOpcode
.Notone:
85
case
RegexOpcode
.Multi:
86
case
RegexOpcode
.Backreference:
87
case
RegexOpcode
.TestBackreference:
88
case
RegexOpcode
.Goto:
89
case
RegexOpcode
.Nullcount:
90
case
RegexOpcode
.Setcount:
91
case
RegexOpcode
.Lazybranch:
92
case
RegexOpcode
.Branchmark:
93
case
RegexOpcode
.Lazybranchmark:
94
case
RegexOpcode
.Set:
98
case
RegexOpcode
.Capturemark:
99
case
RegexOpcode
.Branchcount:
100
case
RegexOpcode
.Lazybranchcount:
101
case
RegexOpcode
.Onerep:
102
case
RegexOpcode
.Notonerep:
103
case
RegexOpcode
.Oneloop:
104
case
RegexOpcode
.Oneloopatomic:
105
case
RegexOpcode
.Notoneloop:
106
case
RegexOpcode
.Notoneloopatomic:
107
case
RegexOpcode
.Onelazy:
108
case
RegexOpcode
.Notonelazy:
109
case
RegexOpcode
.Setlazy:
110
case
RegexOpcode
.Setrep:
111
case
RegexOpcode
.Setloop:
112
case
RegexOpcode
.Setloopatomic:
118
goto case
RegexOpcode
.Stop;
129
for (int i = 0; i < Codes.Length; i += OpcodeSize((
RegexOpcode
)Codes[i]))
140
RegexOpcode
opcode = (
RegexOpcode
)Codes[opcodeOffset];
144
sb.Append(OpcodeBacktracks(opcode &
RegexOpcode
.OperatorMask) ? '~' : ' ');
145
sb.Append(opcode &
RegexOpcode
.OperatorMask);
146
if ((opcode &
RegexOpcode
.CaseInsensitive) != 0) sb.Append("-Ci");
147
if ((opcode &
RegexOpcode
.RightToLeft) != 0) sb.Append("-Rtl");
148
if ((opcode &
RegexOpcode
.Backtracking) != 0) sb.Append("-Back");
149
if ((opcode &
RegexOpcode
.BacktrackingSecond) != 0) sb.Append("-Back2");
151
opcode &=
RegexOpcode
.OperatorMask;
155
case
RegexOpcode
.One:
156
case
RegexOpcode
.Onerep:
157
case
RegexOpcode
.Oneloop:
158
case
RegexOpcode
.Oneloopatomic:
159
case
RegexOpcode
.Onelazy:
160
case
RegexOpcode
.Notone:
161
case
RegexOpcode
.Notonerep:
162
case
RegexOpcode
.Notoneloop:
163
case
RegexOpcode
.Notoneloopatomic:
164
case
RegexOpcode
.Notonelazy:
168
case
RegexOpcode
.Set:
169
case
RegexOpcode
.Setrep:
170
case
RegexOpcode
.Setloop:
171
case
RegexOpcode
.Setloopatomic:
172
case
RegexOpcode
.Setlazy:
176
case
RegexOpcode
.Multi:
180
case
RegexOpcode
.Backreference:
181
case
RegexOpcode
.TestBackreference:
185
case
RegexOpcode
.Capturemark:
193
case
RegexOpcode
.Nullcount:
194
case
RegexOpcode
.Setcount:
198
case
RegexOpcode
.Goto:
199
case
RegexOpcode
.Lazybranch:
200
case
RegexOpcode
.Branchmark:
201
case
RegexOpcode
.Lazybranchmark:
202
case
RegexOpcode
.Branchcount:
203
case
RegexOpcode
.Lazybranchcount:
210
case
RegexOpcode
.Onerep:
211
case
RegexOpcode
.Oneloop:
212
case
RegexOpcode
.Oneloopatomic:
213
case
RegexOpcode
.Onelazy:
214
case
RegexOpcode
.Notonerep:
215
case
RegexOpcode
.Notoneloop:
216
case
RegexOpcode
.Notoneloopatomic:
217
case
RegexOpcode
.Notonelazy:
218
case
RegexOpcode
.Setrep:
219
case
RegexOpcode
.Setloop:
220
case
RegexOpcode
.Setloopatomic:
221
case
RegexOpcode
.Setlazy:
225
case
RegexOpcode
.Branchcount:
226
case
RegexOpcode
.Lazybranchcount:
System\Text\RegularExpressions\RegexNodeKind.cs (26)
17
One =
RegexOpcode
.One,
20
Notone =
RegexOpcode
.Notone,
23
Set =
RegexOpcode
.Set,
27
Multi =
RegexOpcode
.Multi,
34
Oneloop =
RegexOpcode
.Oneloop,
38
Notoneloop =
RegexOpcode
.Notoneloop,
42
Setloop =
RegexOpcode
.Setloop,
47
Onelazy =
RegexOpcode
.Onelazy,
51
Notonelazy =
RegexOpcode
.Notonelazy,
55
Setlazy =
RegexOpcode
.Setlazy,
62
Oneloopatomic =
RegexOpcode
.Oneloopatomic,
68
Notoneloopatomic =
RegexOpcode
.Notoneloopatomic,
74
Setloopatomic =
RegexOpcode
.Setloopatomic,
78
Backreference =
RegexOpcode
.Backreference,
81
Bol =
RegexOpcode
.Bol,
83
Eol =
RegexOpcode
.Eol,
85
Boundary =
RegexOpcode
.Boundary,
87
NonBoundary =
RegexOpcode
.NonBoundary,
89
ECMABoundary =
RegexOpcode
.ECMABoundary,
91
NonECMABoundary =
RegexOpcode
.NonECMABoundary,
93
Beginning =
RegexOpcode
.Beginning,
95
Start =
RegexOpcode
.Start,
97
EndZ =
RegexOpcode
.EndZ,
99
End =
RegexOpcode
.End,
102
UpdateBumpalong =
RegexOpcode
.UpdateBumpalong,
105
Nothing =
RegexOpcode
.Nothing,
System\Text\RegularExpressions\RegexOpcode.cs (1)
10
/// each of which is an <see cref="
RegexOpcode
"/> stored as an int, followed immediately by all of the operands
System\Text\RegularExpressions\RegexWriter.cs (53)
75
Emit(
RegexOpcode
.Lazybranch, 0);
111
Emit(
RegexOpcode
.Stop);
139
private void Emit(
RegexOpcode
op)
150
private void Emit(
RegexOpcode
op, int opd1)
162
private void Emit(
RegexOpcode
op, int opd1, int opd2)
203
RegexOpcode
bits = 0;
206
bits |=
RegexOpcode
.RightToLeft;
210
bits |=
RegexOpcode
.CaseInsensitive;
224
Emit(
RegexOpcode
.Lazybranch, 0);
234
Emit(
RegexOpcode
.Goto, 0);
251
Emit(
RegexOpcode
.Setjump);
253
Emit(
RegexOpcode
.Lazybranch, 0);
254
Emit(
RegexOpcode
.TestBackreference, RegexParser.MapCaptureNumber(node.M, _tree.CaptureNumberSparseMapping));
255
Emit(
RegexOpcode
.Forejump);
267
Emit(
RegexOpcode
.Goto, 0);
269
Emit(
RegexOpcode
.Forejump);
282
Emit(
RegexOpcode
.Setjump);
283
Emit(
RegexOpcode
.Setmark);
285
Emit(
RegexOpcode
.Lazybranch, 0);
294
Emit(
RegexOpcode
.Getmark);
295
Emit(
RegexOpcode
.Forejump);
300
Emit(
RegexOpcode
.Goto, 0);
302
Emit(
RegexOpcode
.Getmark);
303
Emit(
RegexOpcode
.Forejump);
315
Emit(node.M == 0 ?
RegexOpcode
.Nullcount :
RegexOpcode
.Setcount, node.M == 0 ? 0 : 1 - node.M);
317
Emit(node.M == 0 ?
RegexOpcode
.Nullmark :
RegexOpcode
.Setmark);
322
Emit(
RegexOpcode
.Goto, 0);
334
Emit(
RegexOpcode
.Branchcount + Lazy, _intStack.Pop(), node.N == int.MaxValue ? int.MaxValue : node.N - node.M);
336
Emit(
RegexOpcode
.Branchmark + Lazy, _intStack.Pop());
344
Emit(
RegexOpcode
.Setmark);
348
Emit(
RegexOpcode
.Capturemark, RegexParser.MapCaptureNumber(node.M, _tree.CaptureNumberSparseMapping), RegexParser.MapCaptureNumber(node.N, _tree.CaptureNumberSparseMapping));
352
Emit(
RegexOpcode
.Setjump); // causes lookahead/lookbehind to be non-backtracking
353
Emit(
RegexOpcode
.Setmark);
357
Emit(
RegexOpcode
.Getmark);
358
Emit(
RegexOpcode
.Forejump); // causes lookahead/lookbehind to be non-backtracking
362
Emit(
RegexOpcode
.Setjump);
364
Emit(
RegexOpcode
.Lazybranch, 0);
368
Emit(
RegexOpcode
.Backjump);
370
Emit(
RegexOpcode
.Forejump);
374
Emit(
RegexOpcode
.Setjump);
378
Emit(
RegexOpcode
.Forejump);
383
Emit((
RegexOpcode
)node.Kind | bits, node.Ch);
395
RegexOpcode
.Onerep :
RegexOpcode
.Notonerep) | bits, node.Ch, node.M);
399
Emit((
RegexOpcode
)node.Kind | bits, node.Ch, node.N == int.MaxValue ? int.MaxValue : node.N - node.M);
410
Emit(
RegexOpcode
.Setrep | bits, stringCode, node.M);
414
Emit((
RegexOpcode
)node.Kind | bits, stringCode, (node.N == int.MaxValue) ? int.MaxValue : node.N - node.M);
420
Emit((
RegexOpcode
)node.Kind | bits, StringCode(node.Str!));
424
Emit((
RegexOpcode
)node.Kind | bits, StringCode(node.Str!));
428
Emit((
RegexOpcode
)node.Kind | bits, RegexParser.MapCaptureNumber(node.M, _tree.CaptureNumberSparseMapping));
443
Emit((
RegexOpcode
)node.Kind);