public virtual Statement VisitAcquire(Acquire @acquire) { if (@acquire == null) return null; @acquire.Target = (Statement)this.Visit(@acquire.Target); @acquire.Condition = this.VisitExpression(@acquire.Condition); @acquire.ConditionFunction = this.VisitExpression(@acquire.ConditionFunction); @acquire.Body = this.VisitBlock(@acquire.Body); return @acquire; }
private Acquire ParseAcquire(TokenSet followers){ Acquire acquire = new Acquire(); acquire.SourceContext = this.scanner.CurrentSourceContext; this.GetNextToken(); SourceContext sctx = this.scanner.CurrentSourceContext; if (this.currentToken == Token.Readonly){ acquire.ReadOnly = true; this.GetNextToken(); } this.Skip(Token.LeftParenthesis); acquire.Target = this.ParseExpressionStatementOrDeclaration(false, followers|Token.RightParenthesis|Parser.StatementStart|Token.Semicolon, false, false); if (this.currentToken == Token.Semicolon){ this.GetNextToken(); acquire.Condition = this.ParseExpression(followers|Token.RightParenthesis|Parser.StatementStart); } this.ParseBracket(sctx, Token.RightParenthesis, followers|Parser.StatementStart, Error.ExpectedRightParenthesis); Block b = this.ParseStatementAsBlock(followers); acquire.Body = b; if (b != null){ acquire.SourceContext.EndPos = b.SourceContext.EndPos; if (b.Statements == null) this.HandleError(b.SourceContext, Error.PossibleMistakenNullStatement); } return acquire; }
public override Statement VisitAcquire(Acquire acquire) { if (acquire == null) return null; return base.VisitAcquire((Acquire)acquire.Clone()); }
public EventingVisitor(Action<Acquire> visitAcquire) { VisitedAcquire += visitAcquire; } public event Action<Acquire> VisitedAcquire; public override Statement VisitAcquire(Acquire acquire) { if (VisitedAcquire != null) VisitedAcquire(acquire); return base.VisitAcquire(acquire); }