本文整理汇总了C#中System.Text.RegularExpressions.Group.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# Group.Initialize方法的具体用法?C# Group.Initialize怎么用?C# Group.Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Text.RegularExpressions.Group
的用法示例。
在下文中一共展示了Group.Initialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FixupGroups
private void FixupGroups(LoadContext context) {
Debug.Assert(groupByStartSymbol.Count == 0);
if (fileVersion == CgtVersion.V1_0) {
List<Group> commentGroups = new List<Group>(1);
foreach (Symbol blockStartSymbol in symbolTable) {
if (blockStartSymbol.Kind == SymbolKind.BlockStart) {
foreach (Symbol blockEndSymbol in symbolTable) {
if (blockEndSymbol.Kind == SymbolKind.BlockEnd) {
Group group = new Group(this, commentGroups.Count, "Block Comment", GroupAdvanceMode.Character, GroupEndingMode.Closed);
commentGroups.Add(group);
group.Initialize(blockStartSymbol, blockStartSymbol, blockEndSymbol, new Group[] { group });
groupByStartSymbol.Add(blockStartSymbol, group); // this will fail if there was more than one end symbol of the type "CommentEnd" in the grammar
}
}
}
}
groupTable = commentGroups.ToArray();
} else {
for (int i = 0; i < groupTable.Length; i++) {
GroupInfo info = context.GroupInfos[i];
Group[] nesting = new Group[info.Nesting.Length];
for (int n = 0; n < nesting.Length; n++) {
nesting[n] = groupTable[info.Nesting[n]];
}
Group group = groupTable[i];
group.Initialize(GetSymbol(info.ContainerIndex), GetSymbol(info.StartIndex), GetSymbol(info.EndIndex), nesting);
groupByStartSymbol.Add(group.StartSymbol, group);
}
}
}