FindCharClass() public method

public FindCharClass ( CharSet s ) : CharClass
s CharSet
return CharClass
Esempio n. 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
        }
Esempio n. 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);
        }
Esempio n. 3
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;
     }
 }
Esempio 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;
     }
 }