コード例 #1
0
 public Enumerator(StackLoop loop)
 {
     this.loop = loop;
 }
コード例 #2
0
 public void Dispose()
 {
     loop    = null;
     Current = null;
 }
コード例 #3
0
        public static void Main(string[] args)
        {
            //var metaModels = OpCodeMetaModel.OpCodeMetas;
            //var metaLines = string.Join("\r\n", metaModels.Select(x => x.ToString()));
            //saveMetaModel();
            //QOpCodeLearningProgram.TestExecution();
            QOpCodeLearningProgram.Run();
            Operators.AddOpTest();
            LiquisticArraySortTest.LinquisticSort();
            LiquisticArraySortTest.LinquisticSortReverse();


            LambaLoop.ForEachLoopDemo();
            LambaLoop.ForLoopDemo();
            LambaLoop.ForLoopDemo(1, 4);
            LambaLoop.CountEnumerable(1, 4);
            LambaLoop.ExpressExForEachDemo();
            var sl = new StackLoopDemo();

            while (sl.MoveNext())
            {
                sl.Execute(sl.Current);
            }

            var     l          = new List <bool>(new[] { true, false, true, false });
            dynamic enumerator = null;

            //var ex= Expression.Break

            bool        loopstate = true;
            Action      init      = () => enumerator = l.GetEnumerator();
            Func <bool> eval      = () => (loopstate = enumerator.MoveNext());
            Action      body      = () => Console.WriteLine(enumerator.Current);
            Action      inc       = () => { };

            var foreachLoop = new StackLoop(init, eval, body, inc);

            //var foreachLoop = new StackLoop(init, enumerator.MoveNext(), (Action)(() => Console.WriteLine(enumerator.Current)), (Action)(()=> { }));

            foreach (var instruction in foreachLoop)
            {
                foreachLoop.Execute(instruction);
            }


            ElementArraySiblingEnumeratorSortTest.Run();

            buildRDPLinks();
            InstructionEngine.TestLambaIterativeLoop();


            NullV3.UnitTests.Run();

            var set       = new NullUnitSet();
            var setAsList = set.ToList();

            var boolset       = new BoolUnitSet();
            var boolSetAsList = boolset.ToList();

            var parser = new CSParser();

            parser.ParseCsFile("class1.cs");
        }