C# Class Microsoft.Cci.Ast.Precondition

A condition that must be true at the start of a method, possibly bundled with an exception that will be thrown if the condition does not hold.
Inheritance: MethodContractItem, IPrecondition
Afficher le fichier Open project: visualmutator/visualmutator

Private Properties

Свойство Type Description
Precondition System.Collections.Generic

Méthodes publiques

Méthode Description
Dispatch ( ICodeAndContractVisitor visitor ) : void

Calls visitor.Visit(IPrecondition).

Dispatch ( SourceVisitor visitor ) : void

Calls visitor.Visit(Precondition).

MakeCopyFor ( BlockStatement containingBlock ) : Precondition

Makes a copy of this precondition, changing the containing block to the given block.

Precondition ( Expression condition, Expression exceptionToThrow, ISourceLocation sourceLocation ) : System.Collections.Generic

Allocates a condition that must be true at the start of a method, possibly bundled with an exception that will be thrown if the condition does not hold.

SetContainingExpression ( Expression containingExpression ) : void

Completes the two stage construction of this object. This allows bottom up parsers to construct an Expression before constructing the containing Expression. This method should be called once only and must be called before this object is made available to client code. The construction code itself should also take care not to call any other methods or property/event accessors on the object until after this method has been called.

Méthodes protégées

Méthode Description
CheckForErrorsAndReturnTrueIfAnyAreFound ( ) : bool

Performs any error checks still needed and returns true if any errors were found in the statement or a constituent part of the statement.

Private Methods

Méthode Description
Precondition ( BlockStatement containingBlock, Precondition template ) : System.Collections.Generic

A copy constructor that allocates an instance that is the same as the given template, except for its containing block.

Method Details

CheckForErrorsAndReturnTrueIfAnyAreFound() protected méthode

Performs any error checks still needed and returns true if any errors were found in the statement or a constituent part of the statement.
protected CheckForErrorsAndReturnTrueIfAnyAreFound ( ) : bool
Résultat bool

Dispatch() public méthode

Calls visitor.Visit(IPrecondition).
public Dispatch ( ICodeAndContractVisitor visitor ) : void
visitor ICodeAndContractVisitor
Résultat void

Dispatch() public méthode

Calls visitor.Visit(Precondition).
public Dispatch ( SourceVisitor visitor ) : void
visitor SourceVisitor
Résultat void

MakeCopyFor() public méthode

Makes a copy of this precondition, changing the containing block to the given block.
public MakeCopyFor ( BlockStatement containingBlock ) : Precondition
containingBlock BlockStatement
Résultat Precondition

Precondition() public méthode

Allocates a condition that must be true at the start of a method, possibly bundled with an exception that will be thrown if the condition does not hold.
public Precondition ( Expression condition, Expression exceptionToThrow, ISourceLocation sourceLocation ) : System.Collections.Generic
condition Expression The condition that must be true at the start of the method that is associated with this Precondition instance.
exceptionToThrow Expression An exeption that will be thrown if Condition is not true at the start of the method that is associated with this Precondition instance. /// May be null. If null, the runtime behavior of the associated method is undefined when Condition is not true.
sourceLocation ISourceLocation The source location corresponding to the newly allocated source item.
Résultat System.Collections.Generic

SetContainingExpression() public méthode

Completes the two stage construction of this object. This allows bottom up parsers to construct an Expression before constructing the containing Expression. This method should be called once only and must be called before this object is made available to client code. The construction code itself should also take care not to call any other methods or property/event accessors on the object until after this method has been called.
public SetContainingExpression ( Expression containingExpression ) : void
containingExpression Expression
Résultat void