NewCharClass() 공개 메소드

public NewCharClass ( string name, CharSet s ) : CharClass
name string
s CharSet
리턴 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;
     }
 }