Ejemplo n.º 1
0
 /// <summary>
 /// Specify a <see cref="FunctionCall"/> for the <see cref="Scope"/>
 /// </summary>
 /// <param name="scope"><see cref="Scope"/> to specify for</param>
 /// <param name="callback"><see cref="Action{FunctionCall}"/> that gets called for setting up the <see cref="FunctionCall"/></param>
 /// <returns>Chained <see cref="Scope"/> to keep building on</returns>
 public static Scope FunctionCall(this Scope scope, Action<FunctionCall> callback)
 {
     var functionCall = new FunctionCall();
     scope.AddChild(functionCall);
     callback(functionCall);
     return scope;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Call function on an accessor
 /// </summary>
 /// <param name="accessor"><see cref="Accessor"/> perform call on</param>
 /// <param name="callback"><see cref="Action{FunctionCall}"/> that gets called to build the functioncall</param>
 /// <returns>The <see cref="Assignment"/> to build on</returns>
 public static Accessor WithFunctionCall(this Accessor accessor, Action<FunctionCall> callback)
 {
     var functionCall = new FunctionCall();
     accessor.Child = functionCall;
     callback(functionCall);
     return accessor;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Assign a function call
 /// </summary>
 /// <param name="assignment"><see cref="Assignment"/> to assign to</param>
 /// <param name="callback"><see cref="Action{FunctionCall}"/> that gets called to build the functioncall</param>
 /// <returns>The <see cref="Assignment"/> to build on</returns>
 public static Assignment WithFunctionCall(this Assignment assignment, Action<FunctionCall> callback)
 {
     var functionCall = new FunctionCall();
     assignment.Value = functionCall;
     callback(functionCall);
     return assignment;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Specify a name for the <see cref="FunctionCall"/>
 /// </summary>
 /// <param name="functionCall"><see cref="FunctionCall"/> to set name for</param>
 /// <param name="name">Name of the <see cref="FunctionCall"/></param>
 /// <returns>Chained <see cref="FunctionCall"/> to keep building on</returns>
 public static FunctionCall WithName(this FunctionCall functionCall, string name)
 {
     functionCall.Function = name;
     return(functionCall);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Set the parameters for a <see cref="FunctionCall"/>
 /// </summary>
 /// <param name="functionCall"><see cref="FunctionCall"/> to set for</param>
 /// <param name="parameters">Parameters to set</param>
 /// <returns>Chained <see cref="FunctionCall"/> to keep building on</returns>
 public static FunctionCall WithParameters(this FunctionCall functionCall, params LanguageElement[] parameters)
 {
     functionCall.Parameters = parameters;
     return(functionCall);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Set the parameters for a <see cref="FunctionCall"/> based on strings
 /// </summary>
 /// <param name="functionCall"><see cref="FunctionCall"/> to set for</param>
 /// <param name="parameters">Parameters to set</param>
 /// <returns>Chained <see cref="FunctionCall"/> to keep building on</returns>
 public static FunctionCall WithParameters(this FunctionCall functionCall, params string[] parameters)
 {
     functionCall.Parameters = parameters.Select(p => new Literal(p)).ToArray();
     return(functionCall);
 }