private void performTest(XmlBBaseAcceptor acceptor,
                                 String fname,
                                 int count,
                                 int inMem)
        {
            XmlBStringContext ctxt = new XmlBStringContext();
            String            b;

            long start = 0; //System.currentTimeMillis();

            if (!ctxt.readFile(fname))
            {
                System.Console.WriteLine("Could not open file : " +
                                         fname);
                return;
            }
            IXmlBBase[] el = new IXmlBBase[inMem];
            try
            {
                int ptr = 0;
                for (int i = 0; i < count; i++)
                {
                    if (i % 1000 == 0)
                    {
                        System.Console.WriteLine("" + (i) + "/" + count);
                    }
                    el[ptr] = acceptor.genericAccept(ctxt);
                    ctxt.setPtr(0);
                    ptr++;
                    if (ptr >= el.Length)
                    {
                        ptr = 0;
                    }
                }
                long stop = 0;//System.currentTimeMillis();
                System.Console.WriteLine("Done parsing.    Total time: " +
                                         (stop - start) + " millisecs   Time/instance: " +
                                         (stop - start) / count);
                // System.Console.WriteLine (el[0].toString());
                start = 0;//System.currentTimeMillis();
                for (int i = 0; i < count; i++)
                {
                    if (i % 1000 == 0)
                    {
                        System.Console.WriteLine("" + (i) + "/" + count);
                    }
                    b = el[0].ToString();
                }
                stop = 0;//System.currentTimeMillis();
                System.Console.WriteLine("Done unparsing.  Total time: " +
                                         (stop - start) + " millisecs   Time/instance: " +
                                         (stop - start) / count);
            }
            catch (Exception)
            {
                ctxt.dumpError();
            }
        }
        private void performTest(XmlBBaseAcceptor acceptor,
            String fname,
            int count,
            int inMem)
        {
            XmlBStringContext ctxt = new XmlBStringContext();
            String b;

            long start = 0; //System.currentTimeMillis();

            if (!ctxt.readFile(fname))
            {
                System.Console.WriteLine("Could not open file : " +
                           fname);
                return;
            }
            IXmlBBase[] el = new IXmlBBase[inMem];
            try
            {
                int ptr = 0;
                for (int i = 0; i < count; i++)
                {
                    if (i % 1000 == 0)
                        System.Console.WriteLine("" + (i) + "/" + count);
                    el[ptr] = acceptor.genericAccept(ctxt);
                    ctxt.setPtr(0);
                    ptr++;
                    if (ptr >= el.Length)
                        ptr = 0;
                }
                long stop = 0;//System.currentTimeMillis();
                System.Console.WriteLine("Done parsing.    Total time: " +
                           (stop - start) + " millisecs   Time/instance: " +
                           (stop - start) / count);
                // System.Console.WriteLine (el[0].toString());
                start = 0;//System.currentTimeMillis();
                for (int i = 0; i < count; i++)
                {
                    if (i % 1000 == 0)
                        System.Console.WriteLine("" + (i) + "/" + count);
                    b = el[0].ToString();
                }
                stop = 0;//System.currentTimeMillis();
                System.Console.WriteLine("Done unparsing.  Total time: " +
                           (stop - start) + " millisecs   Time/instance: " +
                           (stop - start) / count);
            }
            catch (Exception)
            {
                ctxt.dumpError();
            }
        }
        public void performTest(XmlBBaseAcceptor acceptor,
            string[] args)
        {
            int count = DEFAULT_COUNT;
            int inMem = 1;

            if (args == null || args.Length == 0)
            {
                System.Console.WriteLine("No file name specified");
                return;
            }
            if (args.Length > 1)
                if (args.Length > 2)
                    inMem = System.Convert.ToInt32(args[2]);
            performTest(acceptor, args[0], count, inMem);
        }
        public void performTest(XmlBBaseAcceptor acceptor,
                                string[] args)
        {
            int count = DEFAULT_COUNT;
            int inMem = 1;

            if (args == null || args.Length == 0)
            {
                System.Console.WriteLine("No file name specified");
                return;
            }
            if (args.Length > 1)
            {
                if (args.Length > 2)
                {
                    inMem = System.Convert.ToInt32(args[2]);
                }
            }
            performTest(acceptor, args[0], count, inMem);
        }