| 1 |
//------------------------------------------------------------------------------ |
| 2 |
// <copyright file="RegexTree.cs" company="Microsoft"> |
| 3 |
// Copyright (c) Microsoft Corporation. All rights reserved. |
| 4 |
// </copyright> |
| 5 |
//------------------------------------------------------------------------------ |
| 6 |
|
| 7 |
// RegexTree is just a wrapper for a node tree with some |
| 8 |
// global information attached. |
| 9 |
|
| 10 |
namespace System.Text.RegularExpressions { |
| 11 |
|
| 12 |
using System.Collections; |
| 13 |
using System.Collections.Generic; |
| 14 |
|
| 15 |
internal sealed class RegexTree { |
| 16 |
#if SILVERLIGHT |
| 17 |
internal RegexTree(RegexNode root, Dictionary<Int32, Int32> caps, Int32[] capnumlist, int captop, Dictionary<String, Int32> capnames, String[] capslist, RegexOptions opts) |
| 18 |
#else |
| 19 |
internal RegexTree(RegexNode root, Hashtable caps, Int32[] capnumlist, int captop, Hashtable capnames, String[] capslist, RegexOptions opts) |
| 20 |
#endif |
| 21 |
|
| 22 |
{ |
| 23 |
_root = root; |
| 24 |
_caps = caps; |
| 25 |
_capnumlist = capnumlist; |
| 26 |
_capnames = capnames; |
| 27 |
_capslist = capslist; |
| 28 |
_captop = captop; |
| 29 |
_options = opts; |
| 30 |
} |
| 31 |
|
| 32 |
internal RegexNode _root; |
| 33 |
#if SILVERLIGHT |
| 34 |
internal Dictionary<Int32, Int32> _caps; |
| 35 |
#else |
| 36 |
internal Hashtable _caps; |
| 37 |
#endif |
| 38 |
internal Int32[] _capnumlist; |
| 39 |
#if SILVERLIGHT |
| 40 |
internal Dictionary<String, Int32> _capnames; |
| 41 |
#else |
| 42 |
internal Hashtable _capnames; |
| 43 |
#endif |
| 44 |
internal String[] _capslist; |
| 45 |
internal RegexOptions _options; |
| 46 |
internal int _captop; |
| 47 |
|
| 48 |
#if DBG |
| 49 |
internal void Dump() { |
| 50 |
_root.Dump(); |
| 51 |
} |
| 52 |
|
| 53 |
internal bool Debug { |
| 54 |
get { |
| 55 |
return(_options & RegexOptions.Debug) != 0; |
| 56 |
} |
| 57 |
} |
| 58 |
#endif |
| 59 |
} |
| 60 |
} |