public virtual object VisitStackAllocExpression(StackallocExpression stackAllocExpression, object data) { stackMap.Push(stackAllocExpression); stackAllocExpression.Type.AcceptVisitor(this, data); stackAllocExpression.Expression.AcceptVisitor(this, data); stackMap.Pop(); return(null); }
private StackallocExpression ParseStackalloc() { if (isUnsafe <= 0) { ReportError("stackalloc only allowed in unsafe context."); } if (isFinally > 0 || isCatch > 0) { ReportError("stackalloc is not allowed in catch/finally block."); } Token tok = curtok; AssertAndAdvance(TokenID.Stackalloc); TypeNode type = ParseType(false); AssertAndAdvance(TokenID.LBracket); ExpressionNode n = ParseExpression(TokenID.RBracket); StackallocExpression expr = new StackallocExpression(type, n, tok); AssertAndAdvance(TokenID.RBracket); return expr; }
private void ParseStackalloc() { if (isUnsafe <= 0) { ReportError("stackalloc authorized only in unsafe context."); } if (isFinally > 0 || isCatch > 0) { ReportError("stackalloc not authorized in catch/finally block."); } AssertAndAdvance(TokenID.Stackalloc); IType type = ParseType(); AssertAndAdvance(TokenID.LBracket); ExpressionNode n = ParseExpression(TokenID.RBracket); StackallocExpression expr = new StackallocExpression(type, n, n.RelatedToken); AssertAndAdvance(TokenID.RBracket); exprStack.Push(expr); }
public virtual object VisitStackAllocExpression(StackallocExpression stackAllocExpression, object data) { stackMap.Push(stackAllocExpression); stackAllocExpression.Type.AcceptVisitor(this, data); stackAllocExpression.Expression.AcceptVisitor(this, data); stackMap.Pop(); return null; }