当前位置: 首页>>代码示例>>C#>>正文


C# ktList.MoveNext方法代码示例

本文整理汇总了C#中KacTalk.ktList.MoveNext方法的典型用法代码示例。如果您正苦于以下问题:C# ktList.MoveNext方法的具体用法?C# ktList.MoveNext怎么用?C# ktList.MoveNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KacTalk.ktList的用法示例。


在下文中一共展示了ktList.MoveNext方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MakeATree


//.........这里部分代码省略.........
                    /*if ((!FirstRun) && (PrevToken != null) && (
                        (PrevToken.Type == ktTokenType.Id) ||
                        (PrevToken.Type == ktTokenType.CompStatement) ||
                        (PrevToken.Type == ktTokenType.Statement))) {
                            Tree.Remove( (uint)(Tree.Count - 1) );

                            Temp = new ktList( );
                            Temp.Node = new ktNode( "ktTCompStatement", new ktToken( ktTokenType.CompStatement, Token.Value, Token.LineNo, Token.CharPos ) );

                            Temp.AddList( Prev );
                            Temp.AddList( MakeATree( L, FirstRun ) );

                            Tree.AddList( Temp );
                    } else {*/
                    Tree.AddList(MakeATree(L, FirstRun, ThirdRun));
                    /*}*/
                }
                else if ((Token.Type == ktTokenType.Separator) && FirstRun)
                {
                    Prev = L.Prev;
                    Next = L.Next;

                    //					Tree.Remove( (uint)(Tree.Count - 1) );

                    if ((Next != null) && (Next.Node != null) && (Next.Node.Value != null) &&
                            (Token.Value == ":") &&
                             (((ktToken)Next.Node.Value).Type == ktTokenType.Null))
                    {
                        Token = (ktToken)Next.Node.Value;
                        Token.Value = ":null";

                        Tree.Add("ktTNull", Token);

                        List.MoveNext();
                        List.MoveNext();
                        continue;
                    }
            #if ParseDebug2
            ktDebug.Log( "MakeATree calling HandleSep!" );
            #endif
                    HandleSep(Prev, Next, ref Tree, Token);

                    List.MoveNext();
                }
                else if ((FirstRun) && (
                          (Token.Type == ktTokenType.Operator) ||
                          (Token.Type == ktTokenType.AssignmentOperator)
                      ) && (
                          (PrevToken.Type == ktTokenType.Operator) ||
                          (PrevToken.Type == ktTokenType.AssignmentOperator)
                      ))
                {
                    if ( (Token.Value == "=") || (PrevToken.Value == "=") )
                    {
                        switch (PrevToken.Value)
                        {
                            case "=": case "!": case ">": case "<":
                                {
                                    //   PrevToken.Value = "==";
                                    if (PrevToken.Value == "=")
                                        PrevToken.Value.Append(Token.Value);
                                    else
                                        PrevToken.Value.Append("=");
                                    PrevToken.Type = ktTokenType.ComparisonOperator;
                                    Prev.Node.Name = PrevToken.Name = ktToken.TokenToString(ktTokenType.ComparisonOperator);
                                    break;
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:67,代码来源:kt.cs

示例2: HandleAssignmentOperator

        private bool HandleAssignmentOperator(ktToken PrevToken, ktList Prev, ktToken Token, ktList L, ref ktList Tree, ref ktList List, out bool SkipNext, out bool ReturnTree)
        {
            ktList Next = null;
            ktList Temp = null;

            SkipNext = false;
            ReturnTree = false;

            /*ktDebug.Log("Tree::\n" + Tree.Get_R());
            ktDebug.Log("Prev: T:\n" + Prev.Node.Value.ToString());
            ktDebug.Log("Prev::\n" + Prev.Get_R());*/

            // Remove the last leaf(/item) in the tree (it will now become a leaf under this operator)
            Tree.Pop(false); // .Pop() is more efficient than .Remove() and 'false' as an argument means that it will "fail" gracefully in the event of an empty list!

            // Take a step forward
            List.MoveNext();

            // If the previous token has childs
            if (Prev.Count > 0) {
                if ( (((ktToken)Prev.First.Node.Value).Type == ktTokenType.Id) &&
                     (Prev.First.Next != null) &&
                     (((ktToken)Prev.First.Next.Node.Value).Type == ktTokenType.Id)
                    )
                {
                    Prev.Node = new ktNode("ktTVarStatement", new ktToken(ktTokenType.VarStatement, "", ((ktToken)Prev.Node.Value).LineNo, ((ktToken)Prev.Node.Value).CharPos)); ;
                }
                else
                {
                    // Parse the left part of the op tree
                    Prev = MakeAOpTree(Prev, 1);
                }
            }

            // Get the right part of the op tree
            Next = GetTheRest(List);

            // Parse the right part of the tree
            Next = MakeAOpTree(Next, 1);

            // Create a new "subtree"(/operator) and assign appropriate data
            Temp = new ktList();
            Temp.Node = L.Node;
            ((ktToken)Temp.Node.Value).RunnedStep = 1;

            // Add the parts of op tree
            Temp.AddList(Prev);
            Temp.AddList(Next);

            // Add the operator to the tree
            Tree.AddList(Temp);

               // ktDebug.Log("Tree::\n" + Tree.Get_R());

            ktDebug.WrapLevel--;

            ReturnTree = true;

            // Hey! That went well!
            return true;
        }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:61,代码来源:kt.cs

示例3: MakeAOpTree


//.........这里部分代码省略.........
                            Temp = Temp.First;
                        }

                        if ((Token.Type == ktTokenType.Line) &&
                            (!PrevToken.HasBlock) &&
                            ((PrevToken.Type == ktTokenType.If) ||
                              (PrevToken.Type == ktTokenType.Else) ||
                              (PrevToken.Type == ktTokenType.ElseIf)
                            ))
                        {
                            /*ktDebug.Log("ISLINE:PREVIF!");
                            ktDebug.Log("TEMP: " + Temp.Get_R());*/
                            Prev.AddList(Temp);
                        }
                        else
                        {
                            Tree.AddList(Temp);
                        }
                    }
                }
                //ktDebug.Log("MAOT(" + RunNumb + "): TREE:\n" + Tree.Get_R());

                // Should we return the tree we have created??
                if (ReturnTree)
                {
                    // Return the tree and be done with this part!
                    return Tree;
                }

                // Should we skip this one?
                if (SkipNext)
                {
                    SkipNext = false;
                    List.MoveNext();
                }
                continue;

            // OLD CODE FOR REFERENCE:
                if ((RunNumb == 1) && (Token.Type == ktTokenType.Block))
                {
                    if (((PrevToken.Type == ktTokenType.If) ||
                            (PrevToken.Type == ktTokenType.Else) ||
                            (PrevToken.Type == ktTokenType.ElseIf)
                        ) &&
                        (!PrevToken.HasBlock))
                    {
                        /*Tree.Last.AddList(new ktList(L));
                        ((ktToken)Tree.Last.Node.Value).HasBlock = true;*/
                        Prev.AddList(new ktList(L));
                        PrevToken.HasBlock = true;
                    }
                    else
                    {
                        Tree.AddList(new ktList(L));
                    }
                }
                else if ((Token.Type == ktTokenType.Id) || (Token.Type == ktTokenType.Null) ||
                          (Token.Type == ktTokenType.Number) || (Token.Type == ktTokenType.Float) ||
                          (Token.Type == ktTokenType.Boolean) ||
                          (Token.Type == ktTokenType.String)/* ||
                          (Token.Type == ktTokenType.If)*/ )
                {
                    //ktDebug.Log("Constant etc!!(" + Token.Value + ")");
                    Temp = new ktList();
                    Temp.Node = L.Node;
                    ((ktToken)Temp.Node.Value).RunnedStep = RunNumb;
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:67,代码来源:kt.cs


注:本文中的KacTalk.ktList.MoveNext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。