/**
         * 以流形式读取ExpressionToken
         * @return ExpressionToken
         * @throws IOException
         * @throws FormatException
         * @throws AntipathicException
         */
        public Element ReadToken()
        {
            prefixBlank = false;
            while (true)
            {
                //去除空格
                Mark(0);//标记
                int b = Read();
                if (b == -1)
                {
                    return(null);
                }
                char c = (char)b;
                if (IGNORE_CHAR.IndexOf(c) >= 0)  //去除开始的空格
                {
                    prefixBlank = true;
                    continue;
                }

                Reset();//重置

                //构造一个词元读取器
                IElementReader er = ElementReaderFactory.CreateElementReader(this);

                return(er.Read(this));
            }
        }
示例#2
0
 public ElementReaderTests()
 {
     _elemetReader = new ElementReader();
 }