C# Class CSE.Exps.MethodExp

Used to parse method call expressions
Show file Open project: kcherr1/CSharp-Eval Class Usage Examples

Public Methods

Method Description
Parse ( CseObject environment, string methName, List args ) : CseObject

Parses method calls

Private Methods

Method Description
CanCoerce ( List args ) : bool

Determines if it is possible to coerce the given list of arguments so a method signature can be matched.

GetObjArgs ( List args ) : object[]

Converts list of CseObject arguments into a object array using their Value property

GetTypeArray ( List args ) : System.Type[]

Converts list of CseObject arguments into a type array using either their CompileTimeType property or if that is null, using GetType() on their Value property.

NarrowAllIntTypes ( List &args ) : void

Inspects all CseObjects in args and for the literal integral values, it converts their type to the most narrow type that can contain their value. E.g. if the value is a literal 300 (not the value of an identifier as those types aren't changed), then the smallest integral data type that can store that would be a short. This increases the chance that the given args will match a wider method signature.

Method Details

Parse() public static method

Parses method calls
public static Parse ( CseObject environment, string methName, List args ) : CseObject
environment CseObject The environment containing the method
methName string Name of the method
args List CseObject array containing arguments to be sent to the method. Each CseObject is one argument
return CseObject