1 instantiation of RegexCode
System (1)
regex\system\text\regularexpressions\RegexWriter.cs (1)
301
return new
RegexCode
(_emitted, _stringtable, _trackcount, _caps, capsize, bmPrefix, fcPrefix, anchors, rtl);
442 references to RegexCode
System (442)
regex\system\text\regularexpressions\Regex.cs (4)
182
internal
RegexCode
code; // if interpreted, this is the code for RegexIntepreter
445
internal RegexRunnerFactory Compile(
RegexCode
code, RegexOptions roptions) {
1432
internal
RegexCode
_code;
1449
internal CachedCodeEntry(string key, Hashtable capnames, String[] capslist,
RegexCode
code, Hashtable caps, int capsize, ExclusiveReference runner, SharedReference repl)
regex\system\text\regularexpressions\RegexCompiler.cs (273)
93
internal
RegexCode
_code; // the RegexCode object (used for debugging only)
193
internal static RegexRunnerFactory Compile(
RegexCode
code, RegexOptions options) {
233
RegexCode
code = RegexWriter.Write(tree);
289
return AddTrack(
RegexCode
.Back);
317
return AddUniqueTrack(i,
RegexCode
.Back);
357
return(_regexopcode &
RegexCode
.Rtl) != 0;
364
return(_regexopcode &
RegexCode
.Ci) != 0;
387
return _regexopcode &
RegexCode
.Mask;
785
Ldc(AddUniqueTrack(i,
RegexCode
.Back2));
958
return _codepos +
RegexCode
.OpcodeSize(_codes[_codepos]);
999
for (codepos = 0; codepos < _codes.Length; codepos +=
RegexCode
.OpcodeSize(_codes[codepos])) {
1022
for (codepos = 0; codepos < _codes.Length; codepos +=
RegexCode
.OpcodeSize(_codes[codepos])) {
1646
case
RegexCode
.Stop:
1652
case
RegexCode
.Nothing:
1657
case
RegexCode
.Goto:
1662
case
RegexCode
.Testref:
1671
case
RegexCode
.Lazybranch:
1677
case
RegexCode
.Lazybranch |
RegexCode
.Back:
1686
case
RegexCode
.Nullmark:
1695
case
RegexCode
.Setmark:
1702
case
RegexCode
.Nullmark |
RegexCode
.Back:
1703
case
RegexCode
.Setmark |
RegexCode
.Back:
1710
case
RegexCode
.Getmark:
1723
case
RegexCode
.Getmark |
RegexCode
.Back:
1733
case
RegexCode
.Capturemark:
1783
case
RegexCode
.Capturemark |
RegexCode
.Back:
1802
case
RegexCode
.Branchmark:
1842
case
RegexCode
.Branchmark |
RegexCode
.Back:
1857
case
RegexCode
.Branchmark |
RegexCode
.Back2:
1868
case
RegexCode
.Lazybranchmark:
1924
case
RegexCode
.Lazybranchmark |
RegexCode
.Back:
1938
case
RegexCode
.Lazybranchmark |
RegexCode
.Back2:
1949
case
RegexCode
.Nullcount:
1961
case
RegexCode
.Setcount:
1972
case
RegexCode
.Nullcount |
RegexCode
.Back:
1973
case
RegexCode
.Setcount |
RegexCode
.Back:
1981
case
RegexCode
.Branchcount:
2039
case
RegexCode
.Branchcount |
RegexCode
.Back:
2080
case
RegexCode
.Branchcount |
RegexCode
.Back2:
2094
case
RegexCode
.Lazybranchcount:
2145
case
RegexCode
.Lazybranchcount |
RegexCode
.Back:
2195
case
RegexCode
.Lazybranchcount |
RegexCode
.Back2:
2214
case
RegexCode
.Setjump:
2230
case
RegexCode
.Setjump |
RegexCode
.Back:
2237
case
RegexCode
.Backjump:
2272
case
RegexCode
.Forejump:
2287
case
RegexCode
.Forejump |
RegexCode
.Back:
2317
case
RegexCode
.Bol:
2331
case
RegexCode
.Eol:
2345
case
RegexCode
.Boundary:
2346
case
RegexCode
.Nonboundary:
2354
if (Code() ==
RegexCode
.Boundary)
2360
case
RegexCode
.ECMABoundary:
2361
case
RegexCode
.NonECMABoundary:
2369
if (Code() ==
RegexCode
.ECMABoundary)
2375
case
RegexCode
.Beginning:
2383
case
RegexCode
.Start:
2391
case
RegexCode
.EndZ:
2407
case
RegexCode
.End:
2415
case
RegexCode
.One:
2416
case
RegexCode
.Notone:
2417
case
RegexCode
.Set:
2418
case
RegexCode
.One |
RegexCode
.Rtl:
2419
case
RegexCode
.Notone |
RegexCode
.Rtl:
2420
case
RegexCode
.Set |
RegexCode
.Rtl:
2421
case
RegexCode
.One |
RegexCode
.Ci:
2422
case
RegexCode
.Notone |
RegexCode
.Ci:
2423
case
RegexCode
.Set |
RegexCode
.Ci:
2424
case
RegexCode
.One |
RegexCode
.Ci |
RegexCode
.Rtl:
2425
case
RegexCode
.Notone |
RegexCode
.Ci |
RegexCode
.Rtl:
2426
case
RegexCode
.Set |
RegexCode
.Ci |
RegexCode
.Rtl:
2446
if (Code() ==
RegexCode
.Set) {
2455
if (Code() ==
RegexCode
.One)
2462
case
RegexCode
.Multi:
2463
case
RegexCode
.Multi |
RegexCode
.Ci:
2515
case
RegexCode
.Multi |
RegexCode
.Rtl:
2516
case
RegexCode
.Multi |
RegexCode
.Ci |
RegexCode
.Rtl:
2560
case
RegexCode
.Ref:
2561
case
RegexCode
.Ref |
RegexCode
.Rtl:
2562
case
RegexCode
.Ref |
RegexCode
.Ci:
2563
case
RegexCode
.Ref |
RegexCode
.Ci |
RegexCode
.Rtl:
2657
case
RegexCode
.Onerep:
2658
case
RegexCode
.Notonerep:
2659
case
RegexCode
.Setrep:
2660
case
RegexCode
.Onerep |
RegexCode
.Rtl:
2661
case
RegexCode
.Notonerep |
RegexCode
.Rtl:
2662
case
RegexCode
.Setrep |
RegexCode
.Rtl:
2663
case
RegexCode
.Onerep |
RegexCode
.Ci:
2664
case
RegexCode
.Notonerep |
RegexCode
.Ci:
2665
case
RegexCode
.Setrep |
RegexCode
.Ci:
2666
case
RegexCode
.Onerep |
RegexCode
.Ci |
RegexCode
.Rtl:
2667
case
RegexCode
.Notonerep |
RegexCode
.Ci |
RegexCode
.Rtl:
2668
case
RegexCode
.Setrep |
RegexCode
.Ci |
RegexCode
.Rtl:
2727
if (Code() ==
RegexCode
.Setrep) {
2739
if (Code() ==
RegexCode
.Onerep)
2746
if (Code() ==
RegexCode
.Setrep)
2754
case
RegexCode
.Oneloop:
2755
case
RegexCode
.Notoneloop:
2756
case
RegexCode
.Setloop:
2757
case
RegexCode
.Oneloop |
RegexCode
.Rtl:
2758
case
RegexCode
.Notoneloop |
RegexCode
.Rtl:
2759
case
RegexCode
.Setloop |
RegexCode
.Rtl:
2760
case
RegexCode
.Oneloop |
RegexCode
.Ci:
2761
case
RegexCode
.Notoneloop |
RegexCode
.Ci:
2762
case
RegexCode
.Setloop |
RegexCode
.Ci:
2763
case
RegexCode
.Oneloop |
RegexCode
.Ci |
RegexCode
.Rtl:
2764
case
RegexCode
.Notoneloop |
RegexCode
.Ci |
RegexCode
.Rtl:
2765
case
RegexCode
.Setloop |
RegexCode
.Ci |
RegexCode
.Rtl:
2823
if (Code() ==
RegexCode
.Setloop)
2835
if (Code() ==
RegexCode
.Setloop) {
2846
if (Code() ==
RegexCode
.Oneloop)
2880
case
RegexCode
.Oneloop |
RegexCode
.Back:
2881
case
RegexCode
.Notoneloop |
RegexCode
.Back:
2882
case
RegexCode
.Setloop |
RegexCode
.Back:
2883
case
RegexCode
.Oneloop |
RegexCode
.Rtl |
RegexCode
.Back:
2884
case
RegexCode
.Notoneloop |
RegexCode
.Rtl |
RegexCode
.Back:
2885
case
RegexCode
.Setloop |
RegexCode
.Rtl |
RegexCode
.Back:
2886
case
RegexCode
.Oneloop |
RegexCode
.Ci |
RegexCode
.Back:
2887
case
RegexCode
.Notoneloop |
RegexCode
.Ci |
RegexCode
.Back:
2888
case
RegexCode
.Setloop |
RegexCode
.Ci |
RegexCode
.Back:
2889
case
RegexCode
.Oneloop |
RegexCode
.Ci |
RegexCode
.Rtl |
RegexCode
.Back:
2890
case
RegexCode
.Notoneloop |
RegexCode
.Ci |
RegexCode
.Rtl |
RegexCode
.Back:
2891
case
RegexCode
.Setloop |
RegexCode
.Ci |
RegexCode
.Rtl |
RegexCode
.Back:
2920
case
RegexCode
.Onelazy:
2921
case
RegexCode
.Notonelazy:
2922
case
RegexCode
.Setlazy:
2923
case
RegexCode
.Onelazy |
RegexCode
.Rtl:
2924
case
RegexCode
.Notonelazy |
RegexCode
.Rtl:
2925
case
RegexCode
.Setlazy |
RegexCode
.Rtl:
2926
case
RegexCode
.Onelazy |
RegexCode
.Ci:
2927
case
RegexCode
.Notonelazy |
RegexCode
.Ci:
2928
case
RegexCode
.Setlazy |
RegexCode
.Ci:
2929
case
RegexCode
.Onelazy |
RegexCode
.Ci |
RegexCode
.Rtl:
2930
case
RegexCode
.Notonelazy |
RegexCode
.Ci |
RegexCode
.Rtl:
2931
case
RegexCode
.Setlazy |
RegexCode
.Ci |
RegexCode
.Rtl:
2977
case
RegexCode
.Onelazy |
RegexCode
.Back:
2978
case
RegexCode
.Notonelazy |
RegexCode
.Back:
2979
case
RegexCode
.Setlazy |
RegexCode
.Back:
2980
case
RegexCode
.Onelazy |
RegexCode
.Rtl |
RegexCode
.Back:
2981
case
RegexCode
.Notonelazy |
RegexCode
.Rtl |
RegexCode
.Back:
2982
case
RegexCode
.Setlazy |
RegexCode
.Rtl |
RegexCode
.Back:
2983
case
RegexCode
.Onelazy |
RegexCode
.Ci |
RegexCode
.Back:
2984
case
RegexCode
.Notonelazy |
RegexCode
.Ci |
RegexCode
.Back:
2985
case
RegexCode
.Setlazy |
RegexCode
.Ci |
RegexCode
.Back:
2986
case
RegexCode
.Onelazy |
RegexCode
.Ci |
RegexCode
.Rtl |
RegexCode
.Back:
2987
case
RegexCode
.Notonelazy |
RegexCode
.Ci |
RegexCode
.Rtl |
RegexCode
.Back:
2988
case
RegexCode
.Setlazy |
RegexCode
.Ci |
RegexCode
.Rtl |
RegexCode
.Back:
3011
if (Code() ==
RegexCode
.Setlazy) {
3019
if (Code() ==
RegexCode
.Onelazy)
3123
internal Type FactoryTypeFromCode(
RegexCode
code, RegexOptions options, String typeprefix) {
3186
internal void GenerateRegexType(String pattern, RegexOptions opts, String name, bool ispublic,
RegexCode
code, RegexTree tree, Type factory, TimeSpan matchTimeout) {
3415
internal RegexRunnerFactory FactoryInstanceFromCode(
RegexCode
code, RegexOptions options) {
regex\system\text\regularexpressions\RegexInterpreter.cs (96)
24
internal
RegexCode
runcode;
36
internal RegexInterpreter(
RegexCode
code, CultureInfo culture) {
135
SetOperator(runcodes[newpos] |
RegexCode
.Back2);
138
SetOperator(runcodes[newpos] |
RegexCode
.Back);
149
runci = (0 != (op &
RegexCode
.Ci));
150
runrtl = (0 != (op &
RegexCode
.Rtl));
151
runoperator = op & ~(
RegexCode
.Rtl |
RegexCode
.Ci);
417
case
RegexCode
.Stop:
420
case
RegexCode
.Nothing:
423
case
RegexCode
.Goto:
427
case
RegexCode
.Testref:
433
case
RegexCode
.Lazybranch:
438
case
RegexCode
.Lazybranch |
RegexCode
.Back:
444
case
RegexCode
.Setmark:
450
case
RegexCode
.Nullmark:
456
case
RegexCode
.Setmark |
RegexCode
.Back:
457
case
RegexCode
.Nullmark |
RegexCode
.Back:
461
case
RegexCode
.Getmark:
468
case
RegexCode
.Getmark |
RegexCode
.Back:
473
case
RegexCode
.Capturemark:
487
case
RegexCode
.Capturemark |
RegexCode
.Back:
496
case
RegexCode
.Branchmark:
515
case
RegexCode
.Branchmark |
RegexCode
.Back:
523
case
RegexCode
.Branchmark |
RegexCode
.Back2:
528
case
RegexCode
.Lazybranchmark:
556
case
RegexCode
.Lazybranchmark |
RegexCode
.Back:
574
case
RegexCode
.Lazybranchmark |
RegexCode
.Back2:
582
case
RegexCode
.Setcount:
588
case
RegexCode
.Nullcount:
594
case
RegexCode
.Setcount |
RegexCode
.Back:
598
case
RegexCode
.Nullcount |
RegexCode
.Back:
602
case
RegexCode
.Branchcount:
624
case
RegexCode
.Branchcount |
RegexCode
.Back:
641
case
RegexCode
.Branchcount |
RegexCode
.Back2:
650
case
RegexCode
.Lazybranchcount:
671
case
RegexCode
.Lazybranchcount |
RegexCode
.Back:
694
case
RegexCode
.Lazybranchcount |
RegexCode
.Back2:
705
case
RegexCode
.Setjump:
711
case
RegexCode
.Setjump |
RegexCode
.Back:
715
case
RegexCode
.Backjump:
727
case
RegexCode
.Forejump:
737
case
RegexCode
.Forejump |
RegexCode
.Back:
747
case
RegexCode
.Bol:
753
case
RegexCode
.Eol:
759
case
RegexCode
.Boundary:
765
case
RegexCode
.Nonboundary:
771
case
RegexCode
.ECMABoundary:
777
case
RegexCode
.NonECMABoundary:
783
case
RegexCode
.Beginning:
789
case
RegexCode
.Start:
795
case
RegexCode
.EndZ:
801
case
RegexCode
.End:
807
case
RegexCode
.One:
814
case
RegexCode
.Notone:
821
case
RegexCode
.Set:
828
case
RegexCode
.Multi:
837
case
RegexCode
.Ref:
853
case
RegexCode
.Onerep:
870
case
RegexCode
.Notonerep:
887
case
RegexCode
.Setrep:
915
case
RegexCode
.Oneloop:
939
case
RegexCode
.Notoneloop:
963
case
RegexCode
.Setloop:
996
case
RegexCode
.Oneloop |
RegexCode
.Back:
997
case
RegexCode
.Notoneloop |
RegexCode
.Back:
1012
case
RegexCode
.Setloop |
RegexCode
.Back:
1027
case
RegexCode
.Onelazy:
1028
case
RegexCode
.Notonelazy:
1042
case
RegexCode
.Setlazy:
1056
case
RegexCode
.Onelazy |
RegexCode
.Back:
1074
case
RegexCode
.Notonelazy |
RegexCode
.Back:
1092
case
RegexCode
.Setlazy |
RegexCode
.Back:
regex\system\text\regularexpressions\RegexNode.cs (21)
63
internal const int Oneloop =
RegexCode
.Oneloop; // c,n a*
64
internal const int Notoneloop =
RegexCode
.Notoneloop; // c,n .*
65
internal const int Setloop =
RegexCode
.Setloop; // set,n \d*
67
internal const int Onelazy =
RegexCode
.Onelazy; // c,n a*?
68
internal const int Notonelazy =
RegexCode
.Notonelazy; // c,n .*?
69
internal const int Setlazy =
RegexCode
.Setlazy; // set,n \d*?
71
internal const int One =
RegexCode
.One; // char a
72
internal const int Notone =
RegexCode
.Notone; // char . [^a]
73
internal const int Set =
RegexCode
.Set; // set [a-z] \w \s \d
75
internal const int Multi =
RegexCode
.Multi; // string abcdef
76
internal const int Ref =
RegexCode
.Ref; // index \1
78
internal const int Bol =
RegexCode
.Bol; // ^
79
internal const int Eol =
RegexCode
.Eol; // $
80
internal const int Boundary =
RegexCode
.Boundary; // \b
81
internal const int Nonboundary=
RegexCode
.Nonboundary;// \B
82
internal const int ECMABoundary =
RegexCode
.ECMABoundary; // \b
83
internal const int NonECMABoundary=
RegexCode
.NonECMABoundary; // \B
84
internal const int Beginning =
RegexCode
.Beginning; // \A
85
internal const int Start =
RegexCode
.Start; // \G
86
internal const int EndZ =
RegexCode
.EndZ; // \Z
87
internal const int End =
RegexCode
.End; // \z
regex\system\text\regularexpressions\RegexWriter.cs (48)
48
internal static
RegexCode
Write(RegexTree t) {
50
RegexCode
retval = w.RegexCodeFromRegexTree(t);
123
if (
RegexCode
.OpcodeBacktracks(op))
136
if (
RegexCode
.OpcodeBacktracks(op))
150
if (
RegexCode
.OpcodeBacktracks(op))
222
internal
RegexCode
RegexCodeFromRegexTree(RegexTree tree) {
254
Emit(
RegexCode
.Lazybranch, 0);
280
Emit(
RegexCode
.Stop);
314
bits |=
RegexCode
.Rtl;
316
bits |=
RegexCode
.Ci;
328
Emit(
RegexCode
.Lazybranch, 0);
337
Emit(
RegexCode
.Goto, 0);
352
Emit(
RegexCode
.Setjump);
354
Emit(
RegexCode
.Lazybranch, 0);
355
Emit(
RegexCode
.Testref, MapCapnum(node._m));
356
Emit(
RegexCode
.Forejump);
366
Emit(
RegexCode
.Goto, 0);
368
Emit(
RegexCode
.Forejump);
383
Emit(
RegexCode
.Setjump);
384
Emit(
RegexCode
.Setmark);
386
Emit(
RegexCode
.Lazybranch, 0);
394
Emit(
RegexCode
.Getmark);
395
Emit(
RegexCode
.Forejump);
400
Emit(
RegexCode
.Goto, 0);
402
Emit(
RegexCode
.Getmark);
403
Emit(
RegexCode
.Forejump);
419
Emit(node._m == 0 ?
RegexCode
.Nullcount :
RegexCode
.Setcount, node._m == 0 ? 0 : 1 - node._m);
421
Emit(node._m == 0 ?
RegexCode
.Nullmark :
RegexCode
.Setmark);
425
Emit(
RegexCode
.Goto, 0);
436
Emit(
RegexCode
.Branchcount + Lazy, PopInt(), node._n == Int32.MaxValue ? Int32.MaxValue : node._n - node._m);
438
Emit(
RegexCode
.Branchmark + Lazy, PopInt());
450
Emit(
RegexCode
.Setmark);
454
Emit(
RegexCode
.Capturemark, MapCapnum(node._m), MapCapnum(node._n));
460
Emit(
RegexCode
.Setjump);
463
Emit(
RegexCode
.Setmark);
467
Emit(
RegexCode
.Getmark);
471
Emit(
RegexCode
.Forejump);
476
Emit(
RegexCode
.Setjump);
478
Emit(
RegexCode
.Lazybranch, 0);
482
Emit(
RegexCode
.Backjump);
484
Emit(
RegexCode
.Forejump);
488
Emit(
RegexCode
.Setjump);
492
Emit(
RegexCode
.Forejump);
506
RegexCode
.Onerep :
RegexCode
.Notonerep) | bits, (int)node._ch, node._m);
515
Emit(
RegexCode
.Setrep | bits, StringCode(node._str), node._m);