C# Class Microsoft.Cci.Ast.MethodContract

A collection of collections of objects that augment the type signature of a method with additional information that describes the contract between calling method and called method.
Inheritance: Contract, IMethodContract
显示文件 Open project: visualmutator/visualmutator

Private Properties

Property Type Description

Public Methods

Method Description
Dispatch ( ICodeAndContractVisitor visitor ) : void

Calls visitor.Visit(IMethodContract).

MakeCopyFor ( BlockStatement containingBlock ) : MethodContract

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

MethodContract ( ) : System.Collections.Generic

Allocates an empty method contract that indicates that the method body must be inlined.

MethodContract ( IEnumerable allocates, IEnumerable frees, IEnumerable modifiedVariables, IEnumerable postconditions, IEnumerable preconditions, IEnumerable reads, IEnumerable thrownExceptions, IEnumerable writes, bool isPure ) : System.Collections.Generic

Allocates a collection of collections of objects that augment the type signature of a method with additional information that describes the contract between calling method and called method. This constructor omits termination checking, for backwards compatability, but should probably be depricated.

MethodContract ( IEnumerable allocates, IEnumerable frees, IEnumerable modifiedVariables, IEnumerable postconditions, IEnumerable preconditions, IEnumerable reads, IEnumerable thrownExceptions, IEnumerable writes, bool isPure, IEnumerable variants ) : System.Collections.Generic

Allocates a collection of collections of objects that augment the type signature of a method with additional information that describes the contract between calling method and called method. This constructor omits termination checking, for backwards compatability, but should probably be depricated.

SetContainingBlock ( BlockStatement containingBlock ) : 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.

Protected Methods

Method Description
CheckForErrorsAndReturnTrueIfAnyAreFound ( ) : bool

Checks for errors and return true if any are found.

MethodContract ( MethodContract template ) : System.Collections.Generic

A copy constructor that allocates an instance that is the same as the given template.

Method Details

CheckForErrorsAndReturnTrueIfAnyAreFound() protected method

Checks for errors and return true if any are found.
protected CheckForErrorsAndReturnTrueIfAnyAreFound ( ) : bool
return bool

Dispatch() public method

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

MakeCopyFor() public method

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

MethodContract() public method

Allocates an empty method contract that indicates that the method body must be inlined.
public MethodContract ( ) : System.Collections.Generic
return System.Collections.Generic

MethodContract() public method

Allocates a collection of collections of objects that augment the type signature of a method with additional information that describes the contract between calling method and called method. This constructor omits termination checking, for backwards compatability, but should probably be depricated.
public MethodContract ( IEnumerable allocates, IEnumerable frees, IEnumerable modifiedVariables, IEnumerable postconditions, IEnumerable preconditions, IEnumerable reads, IEnumerable thrownExceptions, IEnumerable writes, bool isPure ) : System.Collections.Generic
allocates IEnumerable A possibly empty list of expressions that each represents a set of memory locations that are newly allocated by a call to the method.
frees IEnumerable A possibly empty list of expressions that each represents a set of memory locations that are freed by a call to the method.
modifiedVariables IEnumerable A possibly empty or null list of target expressions (variables) that are modified by the called method.
postconditions IEnumerable A possibly empty or null list of postconditions that are established by the called method.
preconditions IEnumerable A possibly empty list of preconditions that must be established by the calling method.
reads IEnumerable A possibly empty list of expressions that each represents a set of memory locations that may be read by the called method.
thrownExceptions IEnumerable A possibly empty or null list of exceptions that may be thrown (or passed on) by the called method.
writes IEnumerable A possibly empty list of expressions that each represents a set of memory locations that may be written to by the called method.
isPure bool True if the method has no observable side-effect on program state and hence this method is safe to use in a contract, which may or may not be executed, depending on how the program has been compiled.
return System.Collections.Generic

MethodContract() public method

Allocates a collection of collections of objects that augment the type signature of a method with additional information that describes the contract between calling method and called method. This constructor omits termination checking, for backwards compatability, but should probably be depricated.
public MethodContract ( IEnumerable allocates, IEnumerable frees, IEnumerable modifiedVariables, IEnumerable postconditions, IEnumerable preconditions, IEnumerable reads, IEnumerable thrownExceptions, IEnumerable writes, bool isPure, IEnumerable variants ) : System.Collections.Generic
allocates IEnumerable A possibly empty list of expressions that each represents a set of memory locations that are newly allocated by a call to the method.
frees IEnumerable A possibly empty list of expressions that each represents a set of memory locations that are freed by a call to the method.
modifiedVariables IEnumerable A possibly empty or null list of target expressions (variables) that are modified by the called method.
postconditions IEnumerable A possibly empty or null list of postconditions that are established by the called method.
preconditions IEnumerable A possibly empty list of preconditions that must be established by the calling method.
reads IEnumerable A possibly empty list of expressions that each represents a set of memory locations that may be read by the called method.
thrownExceptions IEnumerable A possibly empty or null list of exceptions that may be thrown (or passed on) by the called method.
writes IEnumerable A possibly empty list of expressions that each represents a set of memory locations that may be written to by the called method.
isPure bool True if the method has no observable side-effect on program state and hence this method is safe to use in a contract, which may or may not be executed, depending on how the program has been compiled.
variants IEnumerable A possibly empty list of variants, each of which is decreased in each call from the method.
return System.Collections.Generic

MethodContract() protected method

A copy constructor that allocates an instance that is the same as the given template.
protected MethodContract ( MethodContract template ) : System.Collections.Generic
template MethodContract The template to copy.
return System.Collections.Generic

SetContainingBlock() 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 SetContainingBlock ( BlockStatement containingBlock ) : void
containingBlock BlockStatement
return void