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


C# Seq.Pop方法代码示例

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


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

示例1: UnaryExpression

 private Expression UnaryExpression(ref bool isLHS)
 {
     var stack = new Seq<UnaryOperator>();
     while (true)
     {
         switch (Current.Tag)
         {
             case InputElementTag.Delete:
                 stack.Push(new UnaryOperator(Current.Loc, UnaryOp.Delete));
                 Consume();
                 break;
             case InputElementTag.Void:
                 stack.Push(new UnaryOperator(Current.Loc, UnaryOp.Void));
                 Consume();
                 break;
             case InputElementTag.Typeof:
                 stack.Push(new UnaryOperator(Current.Loc, UnaryOp.TypeOf));
                 Consume();
                 break;
             case InputElementTag.PlusPlus:
                 stack.Push(new UnaryOperator(Current.Loc, UnaryOp.PreIncrement));
                 Consume();
                 break;
             case InputElementTag.MinusMinus:
                 stack.Push(new UnaryOperator(Current.Loc, UnaryOp.PreDecrement));
                 Consume();
                 break;
             case InputElementTag.Plus:
                 stack.Push(new UnaryOperator(Current.Loc, UnaryOp.UnaryPlus));
                 Consume();
                 break;
             case InputElementTag.Minus:
                 stack.Push(new UnaryOperator(Current.Loc, UnaryOp.UnaryMinus));
                 Consume();
                 break;
             case InputElementTag.Twiddle:
                 stack.Push(new UnaryOperator(Current.Loc, UnaryOp.BitwiseNot));
                 Consume();
                 break;
             case InputElementTag.Bang:
                 stack.Push(new UnaryOperator(Current.Loc, UnaryOp.LogicalNot));
                 Consume();
                 break;
             default:
             {
                 var e = PostfixExpression(ref isLHS);
                 while (stack.Count > 0)
                 {
                     isLHS = false;
                     var op = stack.Pop();
                     e = new UnaryExpression(op.Loc.Union(e.Loc), op, e);
                 }
                 return e;
             }
         }
     }
 }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:57,代码来源:Parser.cs

示例2: Reduce

 private void Reduce(ref Expression bottom, Seq<SREntry> stack)
 {
     var top = stack.Pop();
     if (stack.Count == 0)
         bottom = new BinaryExpression(bottom.Loc.Union(top.Exp.Loc), bottom, top.Op, top.Exp);
     else
         stack.Peek().Exp = new BinaryExpression(stack.Peek().Exp.Loc.Union(top.Exp.Loc), stack.Peek().Exp, top.Op, top.Exp);
 }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:8,代码来源:Parser.cs

示例3: PopNew

        // According to the grammar:
        //     MemberExpression ::= (PrimaryExpression | "new" MemberExpression Arguments) ("[" Expression "]" | "." Identifier)*
        //     LeftHandSideExpression ::=
        //         "new"+ MemberExpression
        //      | MemberExpression (Arguments (Arguments | "[" Expression "]" | "." Identifier)*)?

        private Expression PopNew(Seq<InputElement> newStack, Expression constructor)
        {
            var ie = newStack.Pop();
            return new NewExpression(ie.Loc.Union(constructor.Loc), constructor);
        }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:11,代码来源:Parser.cs


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