Beispiel #1
0
 Symbol AddFoldableOp(string name, Atoms atom, int numargs, int precedence, DataType type, FoldableFlags foldable, FoldSeeds seed, string method)
 {
     return(Add(name, new Symbol {
         Atom = atom,
         Kind = (numargs == 1) ? SymKinds.UNOP : (numargs == 2) ? SymKinds.BINOP : SymKinds.NUL,
         CallKind = CallKinds.FUNC,
         NumArgs = numargs,
         Precedence = precedence,
         DataType = type,
         Foldable = foldable,
         FoldSeed = seed,
         CallInfo = CallInfo.Get(method),
     }));
 }
Beispiel #2
0
 Symbol AddFoldableFunction(string name, Atoms atom, int numargs, DataType type, CallKinds callkind, FoldableFlags foldable, FoldSeeds seed, string method)
 {
     return(Add(name, new Symbol {
         Atom = atom,
         Kind = SymKinds.FUNC,
         CallKind = callkind,
         NumArgs = numargs,
         DataType = type,
         Foldable = foldable,
         FoldSeed = seed,
         CallInfo = CallInfo.Get(method),
     }));
 }
Beispiel #3
0
 Symbol AddOperator(string name, int numargs, int precedence, DataType type, string method, FoldableFlags foldable = FoldableFlags.NUL, FoldSeeds seed = FoldSeeds.NUL)
 {
     return(Add(name, new Symbol {
         Kind = SymKinds.FUNC,
         CallKind = CallKinds.FUNC,
         NumArgs = numargs,
         Precedence = precedence,
         DataType = type,
         Foldable = foldable,
         FoldSeed = seed,
         CallInfo = CallInfo.Get(method),
     }));
 }