|
Mercury library
1.0
Translation of CFG grammars into an object model (Bachelor's thesis).
|
"Folds" all its arguments into one value. For instance, for "x y z" arguments this action computes f(f(f(s,x), y), z) where f is the lamda function and s is the seed parameter of the constructor
More...
Public Member Functions | |
| FoldingAction (string name, int minargs, Func< V, U, V > f, V seed, ArgumentType flags=ArgumentType.None) | |
| Initializes a new instance of the FoldingAction{T, U, V} class. More... | |
| override V | Evaluate (Argument[] arguments, RecursiveEval< T > eval, InterpreterContext< T > context) |
| Evaluates the action. More... | |
Public Member Functions inherited from Mercury.Interpreting.InterpreterAction< T, U > | |
| InterpreterAction (string name, Tuple< int, int > arity, ArgumentType[] argtypes, bool allowswild=true) | |
| Initializes a new instance of the InterpreterAction{T,U} class. See Mercury.Interpreting.InterpreterAction{T} for better explanation. More... | |
| override object | Invoke (Argument[] arguments, RecursiveEval< T > eval, InterpreterContext< T > context) |
| Evaluates the arguments. It is guaranteed to have a valid number of arguments (specified by Arity) and that no argument is null UNLESS the flag Mercury.Interpreting.ArgumentType contains Lazy or Null. More... | |
Public Member Functions inherited from Mercury.Interpreting.InterpreterAction< T > | |
| InterpreterAction (string name, Tuple< int, int > arity, ArgumentType[] argtypes, bool allowswild=true) | |
| Initializes a new instance of the InterpreterAction{T} class. The target application can inherit from this class, but rather one of Mercury.Interpreting.InterpreterAction{T,U} or Mercury.Interpreting.GenericAction{T} is recommended to derive. Conditions: More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Mercury.Interpreting.InterpreterAction< T > | |
| void | CheckDefinition () |
Properties inherited from Mercury.Interpreting.InterpreterAction< T > | |
| string | Name [get, set] |
| Action name. More... | |
| Tuple< int, int > | Arity [get, set] |
| Minimum and maximum number of arguments. More... | |
| ArgumentType | ReturnType [get, set] |
| Action return type. More... | |
| ArgumentType[] | ArgumentTypes [get, set] |
| Allowed types of arguments. If more arguments specified (within range of Arity), the last type in this array will be used. It can be empty if and only if arity is (0,0). More... | |
| bool | AllowsWildcard [get, set] |
| Indicates whether a Mercury.Interpreting.Wildcard can be an argument of this action. More... | |
"Folds" all its arguments into one value. For instance, for "x y z" arguments this action computes f(f(f(s,x), y), z) where f is the lamda function and s is the seed parameter of the constructor
| T | Interpreter return type |
| U | Type of values |
| V | Output type |
| T | : | class |
Definition at line 415 of file BasicActions.cs.
| Mercury.Interpreting.FoldingAction< T, U, V >.FoldingAction | ( | string | name, |
| int | minargs, | ||
| Func< V, U, V > | f, | ||
| V | seed, | ||
| ArgumentType | flags = ArgumentType.None |
||
| ) |
Initializes a new instance of the FoldingAction{T, U, V} class.
| name | The name of the action |
| minargs | Minimal number of arguments |
| f | The lambda function |
| seed | Initial value |
| flags | The flags. |
| System.ArgumentNullException | f |
Definition at line 432 of file BasicActions.cs.
|
virtual |
Evaluates the action.
| arguments | Arguments provided by the interpreter. |
| eval | The recursive evaluation delegate. |
| context | The interpreter context. |
Implements Mercury.Interpreting.InterpreterAction< T, U >.
Definition at line 446 of file BasicActions.cs.
1.8.7