C# Class Microsoft.Cci.Ast.TypeInvariant

A condition that must be true after an object has been constructed and that is by default a part of the precondition and postcondition of every public method of the associated type.
Inheritance: Invariant, ITypeInvariant
Afficher le fichier Open project: visualmutator/visualmutator Class Usage Examples

Private Properties

Свойство Type Description

Méthodes publiques

Méthode Description
Dispatch ( ICodeAndContractVisitor visitor ) : void

Calls visitor.Visit(ITypeInvariant).

Dispatch ( SourceVisitor visitor ) : void

Calls visitor.Visit(TypeInvariant).

MakeCopyFor ( BlockStatement containingBlock ) : TypeInvariant

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

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.

TypeInvariant ( Microsoft.Cci.Ast.NameDeclaration name, Expression condition, bool isAxiom, 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.

Méthodes protégées

Méthode Description
TypeInvariant ( BlockStatement containingBlock, TypeInvariant 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

Dispatch() public méthode

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

Dispatch() public méthode

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

MakeCopyFor() public méthode

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

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

TypeInvariant() protected méthode

A copy constructor that allocates an instance that is the same as the given template, except for its containing block.
protected TypeInvariant ( BlockStatement containingBlock, TypeInvariant template ) : System.Collections.Generic
containingBlock BlockStatement The containing block of the copied type invariant. This should be different from the containing block of the template.
template TypeInvariant The statement to copy.
Résultat System.Collections.Generic

TypeInvariant() 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 TypeInvariant ( Microsoft.Cci.Ast.NameDeclaration name, Expression condition, bool isAxiom, ISourceLocation sourceLocation ) : System.Collections.Generic
name Microsoft.Cci.Ast.NameDeclaration The name of the axiom. Used in error diagnostics. May be null.
condition Expression The condition that must be true at the start of the method that is associated with this Precondition instance.
isAxiom bool An axiom is a type invariant whose truth is assumed rather than derived. Commonly used to make statements about the meaning of contract methods.
sourceLocation ISourceLocation The source location corresponding to the newly allocated source item.
Résultat System.Collections.Generic