當前位置: 首頁>>代碼示例>>C#>>正文


C# CharSet.Or方法代碼示例

本文整理匯總了C#中at.jku.ssw.Coco.CharSet.Or方法的典型用法代碼示例。如果您正苦於以下問題:C# CharSet.Or方法的具體用法?C# CharSet.Or怎麽用?C# CharSet.Or使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在at.jku.ssw.Coco.CharSet的用法示例。


在下文中一共展示了CharSet.Or方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
        }
開發者ID:dgrunwald,項目名稱:coco-csharp,代碼行數:28,代碼來源:Parser.cs

示例2: Set

 void Set(out CharSet s)
 {
     CharSet s2;
     SimSet(out s);
     while (la.kind == 25 || la.kind == 26) {
     if (la.kind == 25) {
         Get();
         SimSet(out s2);
         s.Or(s2);
     } else {
         Get();
         SimSet(out s2);
         s.Subtract(s2);
     }
     }
 }
開發者ID:dgrunwald,項目名稱:coco-csharp,代碼行數:16,代碼來源:Parser.cs

示例3: Set

	void Set(
#line 218 "Coco.atg" //SOURCE beg=9237,len=13,col=5
					out CharSet s
#line default //END SOURCE
) {

#line 218 "Coco.atg" //SOURCE beg=9268,len=12,col=36
																																				CharSet s2; 
#line default //END SOURCE
		SimSet(
#line 220 "Coco.atg" //SOURCE beg=9296,len=5,col=10
										out s
#line default //END SOURCE
);
		while (la.kind == 21 || la.kind == 22) {
			if (la.kind == 21) {
				Get();
				SimSet(
#line 221 "Coco.atg" //SOURCE beg=9319,len=6,col=16
																out s2
#line default //END SOURCE
);

#line 221 "Coco.atg" //SOURCE beg=9339,len=10,col=36
																																				s.Or(s2); 
#line default //END SOURCE
			} else {
				Get();
				SimSet(
#line 222 "Coco.atg" //SOURCE beg=9368,len=6,col=16
																out s2
#line default //END SOURCE
);

#line 222 "Coco.atg" //SOURCE beg=9388,len=16,col=36
																																				s.Subtract(s2); 
#line default //END SOURCE
			}
		}
	}
開發者ID:SealedSun,項目名稱:prx,代碼行數:40,代碼來源:Parser.cs

示例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);
	}
開發者ID:SealedSun,項目名稱:prx,代碼行數:61,代碼來源:Parser.cs

示例5: ParseSet

 void ParseSet(out CharSet s)
 {
     CharSet s2;
     ParseSimSet(out s);
     while (la.kind == 22 || la.kind == 23) {
     if (la.kind == 22) {
         Get();
         ParseSimSet(out s2);
         s.Or(s2);
     } else {
         Get();
         ParseSimSet(out s2);
         s.Subtract(s2);
     }
     }
 }
開發者ID:vadimskipin,項目名稱:coco-csharp,代碼行數:16,代碼來源:Coco-cs.cs


注:本文中的at.jku.ssw.Coco.CharSet.Or方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。