Ejemplo n.º 1
0
 public void Test()
 {
     Func<TestCase, string> f = delegate(TestCase c)
     {
         IEnumerator<Token> tks; EnumeratorAdapter tenm; Token t;
         tks = SFList.FromText(c.Input).Map<Token>(Token.FromVG).NotNulls().GetEnumerator();
         tenm = new EnumeratorAdapter(tks);
         Analyzer.Init(tenm);
         t = Analyzer.Analyze();
         return TokenEx.ToTree(t);
     };
     new TestCase("", Inp, Epc, f).Run();
 }
Ejemplo n.º 2
0
        public void Test()
        {
            Func<TestCase, string> f = delegate(TestCase c)
            {
                IEnumerator<Token> tks;
                EnumeratorAdapter tkz;
                tks = SFList.FromText(c.Input).Map<Token>(Token.FromVG).NotNulls().GetEnumerator();
                tkz = new EnumeratorAdapter(tks);

                if (tkz.EOF) return "(EOF)";

                StringBuilder b;
                b = new StringBuilder();
                while (tkz.EOF == false)
                {
                    b.Append(TokenEx.ToUTStr(tkz.Cur)).AppendLine();
                    //b.Append(tkz.Cur).AppendLine();
                    tkz.Next();
                }

                return b.ToString();
            };
            new TestCase("", Inp, Epc, f).Run();
        }