FindCharClass() public method

public FindCharClass ( CharSet s ) : CharClass
s CharSet
return CharClass
示例#1
0
        void SetDecl()
        {
            CharSet s;

            Notify(5); // Coco-Plugin: notify parsercustomization
            Expect(1);
            string    name = t.val;
            CharClass c    = tab.FindCharClass(name);

            if (c != null)
            {
                SemErr("name declared twice");
            }

            Expect(17);
            Set(out s);
            if (s.Elements() == 0)
            {
                SemErr("character set must not be empty");
            }
            tab.NewCharClass(name, s);

            Expect(18);
            Notify(9); // Coco-Plugin: notify parsercustomization
        }
示例#2
0
        void SetDecl()
        {
            CharSet s;

            Expect(1);
            string    name = t.val;
            CharClass c    = tab.FindCharClass(name);

            if (c != null)
            {
                SemErr("name declared twice");
            }

            Expect(17);
            Set(out s);
            if (s.Elements() == 0)
            {
                SemErr("character set must not be empty");
            }
            tab.NewCharClass(name, s);

            Expect(18);
        }
示例#3
0
文件: DFA.cs 项目: omaragb/tlp182
 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;
     }
 }
示例#4
0
 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;
     }
 }