IMethodDefinition Interface

From The Oxygene Language Wiki

Jump to:navigation, search

This is a Language topic
Feel free to add your notes to this topic below.


IMethodDefinition = public interface (IMemberDefinition, IAttributeDefinitionProvider, 
  IAttributesProvider, IElementDefinition, IMethod, IMember, 
  IGenericParametersProvider, IPosition)

A method definition interface is a reference to an in-code method. This interface allows the user to modify the method header and body.

Namespace: Cirrus

Members

Method
Description
AddLocal(name: string; type: IType): ILocal; Adds a local variable to the locals list
AddLocal(type: IType): ILocal; Adds a local variable to the locals list. This local will not have a name (unless set later) and will not show up in the locals list during debugging
AddParameter(aName: String; aModifier: ParameterModifier; aType: IType): IParameterDefinitionAdds a new parameter to this method
GetLocal(aName: String): ValueReturns a local by name, or fails with an exception if it is not found. Used by the compiler
GetLocal(aName: String; aType: IType): ValueReturns a local by name, or fails with an exception if it is not found. Used by the compiler
GetLocal(no: Integer): ILocal]Returns one of locals defined before the method "begin" block. LocalCount returns the number of locals defined there
GetParameter(aType: IType): ValueReturns a parameter by name, or fails with an exception if it is not found. Used by the compiler
GetParameter(aName: String; aType: IType): ValueReturns a parameter by name, or fails with an exception if it is not found. Used by the compiler
GetParameterArrayValue: ArrayValueReturns an array with all parameters in it
GetResult(aType: IType): ValueReturns a value object for the result of this method
GetResult: ValueReturns a value object for the result of this method.
MethodBodyToStatementAnonymous: ValueReturns a value containing the body of this method as a value
RemoveParameter(aParameter: IParameterDefinition)Removes a parameter from this method
RemoveParameter(aParameter: Integer)Removes a parameter from this method
ReplaceMethodBody(aStatement: Statement) Replaces the method of the body with the statement passed here. The original statement will be placed at the location of the PlaceHolderStatement
SurroundMethodBody(aBefore, aAfter: Statement; aMode: SurroundMethod)Surrounds the original method with the before and after calls.


Properties

Property
Description
Final: BooleanIf true, this method is final and cannot be overridden
LocalCount: IntegerReturns the number of locals this method has (locals defined in a var block before the begin)
ParameterCount: IntegerReturns the number of parameters
Result: ITypeReturns the result of this method, or nil if it has none
SpecialName: BooleanReturns true if this method is a special name method, generally these are constructors and helper methods
Virtual: VirtualModeThe virtual mode of this method

See Also

Oxygene-48.png

Area: Oxygene Language
Compiler version: Oxygene 5

Language GlossaryKeywordsTypesFAQHow To

Navigation
Areas
More
Toolbox