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
Exibir arquivo Open project: visualmutator/visualmutator Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method 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.

Protected Methods

Method 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 method

Calls visitor.Visit(ITypeInvariant).
public Dispatch ( ICodeAndContractVisitor visitor ) : void
visitor ICodeAndContractVisitor
return void

Dispatch() public method

Calls visitor.Visit(TypeInvariant).
public Dispatch ( SourceVisitor visitor ) : void
visitor SourceVisitor
return void

MakeCopyFor() public method

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

SetContainingExpression() public method

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
return void

TypeInvariant() protected method

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.
return System.Collections.Generic

TypeInvariant() public method

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.
return System.Collections.Generic