• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Coco.CharSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中at.jku.ssw.Coco.CharSet的典型用法代码示例。如果您正苦于以下问题:C# CharSet类的具体用法?C# CharSet怎么用?C# CharSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CharSet类属于at.jku.ssw.Coco命名空间,在下文中一共展示了CharSet类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Or

 public void Or(CharSet s)
 {
     for (Range p = s.head; p != null; p = p.next)
     for (int i = p.from; i <= p.to; i++) Set(i);
 }
开发者ID:Xpitfire,项目名称:CrossCompile,代码行数:5,代码来源:DFA.cs


示例2: 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;
 }
开发者ID:Xpitfire,项目名称:CrossCompile,代码行数:8,代码来源:DFA.cs


示例3: Equals

 public bool Equals(CharSet s)
 {
     Range p = head, q = s.head;
     while (p != null && q != null) {
     if (p.from != q.from || p.to != q.to) return false;
     p = p.next; q = q.next;
     }
     return p == q;
 }
开发者ID:Xpitfire,项目名称:CrossCompile,代码行数:9,代码来源:DFA.cs


示例4: Intersects

 public bool Intersects(CharSet s)
 {
     for (Range p = s.head; p != null; p = p.next)
     for (int i = p.from; i <= p.to; i++)
         if (this[i]) return true;
     return false;
 }
开发者ID:Xpitfire,项目名称:CrossCompile,代码行数:7,代码来源:DFA.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


示例6: Clone

 public CharSet Clone()
 {
     CharSet s = new CharSet();
     Range prev = null;
     for (Range cur = head; cur != null; cur = cur.next) {
     Range r = new Range(cur.from, cur.to);
     if (prev == null) s.head = r; else prev.next = r;
     prev = r;
     }
     return s;
 }
开发者ID:Xpitfire,项目名称:CrossCompile,代码行数:11,代码来源:DFA.cs


示例7: FindCharClass

	public CharClass FindCharClass(CharSet s) {
		foreach (CharClass c in classes)
			if (s.Equals(c.set)) return c;
		return null;
	}
开发者ID:ggrov,项目名称:tacny,代码行数:5,代码来源:Tab.cs


示例8: 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


示例9: CharClass

	public CharSet set;	// set representing the class

	public CharClass(string name, CharSet s) {
		this.name = name; this.set = s;
	}
开发者ID:ggrov,项目名称:tacny,代码行数:5,代码来源:Tab.cs


示例10: NewCharClass

	public CharClass NewCharClass(string name, CharSet s) {
		if (name == "#") name = "#" + (char)dummyName++;
		CharClass c = new CharClass(name, s);
		c.n = classes.Count;
		classes.Add(c);
		return c;
	}
开发者ID:ggrov,项目名称:tacny,代码行数:7,代码来源:Tab.cs


示例11: 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


示例12: 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


示例13: Tab

        BitArray visited; //!< mark list for graph traversals

        #endregion Fields

        #region Constructors

        public Tab(Parser parser)
        {
            this.parser = parser;
            errors = parser.errors;
            buffer = parser.scanner.buffer;
            eofSy = NewSym(Node.t, "EOF", 0);
            dummyNode = NewNode(Node.eps);
            ignored  = new CharSet();
            literals = new Hashtable();
        }
开发者ID:dgrunwald,项目名称:coco-csharp,代码行数:16,代码来源:Tab.cs


示例14: PutRange

 private void PutRange(CharSet s)
 {
     for (CharSet.Range r = s.head; r != null; r = r.next) {
     if (r.from == r.to) { gen.Write("ch == " + Ch(r.from)); }
     else if (r.from == 0) { gen.Write("ch <= " + Ch(r.to)); }
     else { gen.Write("ch >= " + Ch(r.from) + " && ch <= " + Ch(r.to)); }
     if (r.next != null) gen.Write(" || ");
     }
 }
开发者ID:Xpitfire,项目名称:CrossCompile,代码行数:9,代码来源:DFA.cs


示例15: WriteCharSet

	void WriteCharSet(CharSet s) {
		for (CharSet.Range r = s.head; r != null; r = r.next)
			if (r.from < r.to) { trace.Write(Ch(r.from) + ".." + Ch(r.to) + " "); }
			else { trace.Write(Ch(r.from) + " "); }
	}
开发者ID:ggrov,项目名称:tacny,代码行数:5,代码来源:Tab.cs


示例16: ShiftWith

 public void ShiftWith(CharSet s, Tab tab)
 {
     if (s.Elements() == 1) {
     typ = Node.chr; sym = s.First();
     } else {
     CharClass c = tab.FindCharClass(s);
     if (c == null) c = tab.NewCharClass("#", s); // class with dummy name
     typ = Node.clas; sym = c.n;
     }
 }
开发者ID:Xpitfire,项目名称:CrossCompile,代码行数:10,代码来源:DFA.cs


示例17: 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;
 }
开发者ID:Xpitfire,项目名称:CrossCompile,代码行数:10,代码来源:DFA.cs


示例18: 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


示例19: GenScan3

        String GenScan3()
        {
            MemoryStream insertion = new MemoryStream();
            StreamWriter oldGen = gen;
            gen = new StreamWriter(insertion);
            CharSet nt = new CharSet();
            CharSet tt = new CharSet();
            Comment com = firstComment;

            StreamReader reader = new StreamReader(insertion);
   
                    gen.Write(" ");
                    if (tab.ignored.Elements() > 0) { PutRange(tab.ignored); } else { gen.Write("false"); }
                    gen.Write(" ");
           gen.Flush();
            insertion.Seek(0, SeekOrigin.Begin);
            gen = oldGen;
            return reader.ReadToEnd();
        }
开发者ID:blucz,项目名称:coco-r-fsharp,代码行数:19,代码来源:ScannerOutput.cs



注:本文中的at.jku.ssw.Coco.CharSet类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Coco.Graph类代码示例发布时间:2022-05-26
下一篇:
C# client.Presence类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap