本文整理汇总了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;
}
}
}
}
示例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);
}
示例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);
}