本文整理汇总了C#中at.jku.ssw.Coco.CharSet.Set方法的典型用法代码示例。如果您正苦于以下问题:C# CharSet.Set方法的具体用法?C# CharSet.Set怎么用?C# CharSet.Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类at.jku.ssw.Coco.CharSet
的用法示例。
在下文中一共展示了CharSet.Set方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SimSet
void SimSet(out CharSet s)
{
int n1, n2; s = new CharSet();
if (la.kind == 1) {
Get();
CharClass c = tab.FindCharClass(t.val);
if (c == null) SemErr("undefined name"); else s.Or(c.set);
} else if (la.kind == 3) {
Get();
string name = t.val;
name = tab.Unescape(name.Substring(1, name.Length-2));
foreach (char ch in name)
if (dfa.ignoreCase) s.Set(char.ToLower(ch));
else s.Set(ch);
} else if (la.kind == 5) {
Char(out n1);
s.Set(n1);
if (la.kind == 27) {
Get();
Char(out n2);
for (int i = n1; i <= n2; i++) s.Set(i);
}
} else if (la.kind == 28) {
Get();
s = new CharSet(); s.Fill();
} else SynErr(56);
}
示例2: Symbols
public CharSet Symbols(Tab tab)
{
CharSet s;
if (typ == Node.clas)
s = tab.CharClassSet(sym).Clone();
else {
s = new CharSet(); s.Set(sym);
}
return s;
}
示例3: Subtract
public void Subtract(CharSet s)
{
CharSet x = new CharSet();
for (Range p = head; p != null; p = p.next)
for (int i = p.from; i <= p.to; i++)
if (!s[i]) x.Set(i);
head = x.head;
}
示例4: SimSet
void SimSet(
#line 228 "Coco.atg" //SOURCE beg=9517,len=13,col=8
out CharSet s
#line default //END SOURCE
) {
#line 228 "Coco.atg" //SOURCE beg=9545,len=12,col=36
int n1, n2;
#line default //END SOURCE
#line 229 "Coco.atg" //SOURCE beg=9596,len=19,col=36
s = new CharSet();
#line default //END SOURCE
if (la.kind == _ident) {
Get();
#line 230 "Coco.atg" //SOURCE beg=9654,len=169,col=36
CharClass c = tab.FindCharClass(t.val);
if (c == null) SemErr("undefined name"); else s.Or(c.set);
#line default //END SOURCE
} else if (la.kind == _string) {
Get();
#line 233 "Coco.atg" //SOURCE beg=9862,len=311,col=36
string name = t.val;
name = tab.Unescape(name.Substring(1, name.Length-2));
foreach (char ch in name)
if (dfa.ignoreCase) s.Set(char.ToLower(ch));
else s.Set(ch);
#line default //END SOURCE
} else if (la.kind == _char) {
Char(
#line 238 "Coco.atg" //SOURCE beg=10184,len=6,col=8
out n1
#line default //END SOURCE
);
#line 238 "Coco.atg" //SOURCE beg=10212,len=11,col=36
s.Set(n1);
#line default //END SOURCE
if (la.kind == 23) {
Get();
Char(
#line 239 "Coco.atg" //SOURCE beg=10241,len=6,col=15
out n2
#line default //END SOURCE
);
#line 239 "Coco.atg" //SOURCE beg=10262,len=41,col=36
for (int i = n1; i <= n2; i++) s.Set(i);
#line default //END SOURCE
}
} else if (la.kind == 24) {
Get();
#line 241 "Coco.atg" //SOURCE beg=10347,len=29,col=36
s = new CharSet(); s.Fill();
#line default //END SOURCE
} else SynErr(49);
}