Пример #1
0
        public bool testToker2(string path)
        {
            Toker toker = new Toker();

            string fqf = System.IO.Path.GetFullPath(path);

            if (!toker.open(fqf))
            {
                Console.Write("\n can't open {0}\n", fqf);
                return(false);
            }
            toker.setSpecialSingleChars(new List <string> {
                "<", ">"
            });
            toker.setSpecialCharPairs(new List <string> {
                "<<", "=="
            });

            while (!toker.isDone())
            {
                Token tok = toker.getTok();
                Console.Write("\n -- line#{0, 4} : {1}", toker.lineCount(), tok);
            }
            toker.close();

            return(true);
        }
 //----< methods to handle special character set >----------------------------------------
 public bool setSpecialSingleChars(char ssc)
 {
     toker.setSpecialSingleChars(ssc);
     return(true);
 }
 static public void addSingleCharToken(string a)
 {
     Toker.setSpecialSingleChars(a);
 }