Symbol AddFunction(string name, Atoms atom, int numargs, DataType type, CallKinds callkind, string method, SymKinds kind = SymKinds.FUNC) { return(Add(name, new Symbol { Atom = atom, Kind = kind, CallKind = callkind, NumArgs = numargs, DataType = type, CallInfo = CallInfo.Get(method), })); }
Symbol AddFunction(string name, int numargs, DataType type, CallKinds callkind, string method, FuncKinds funckind) { return(Add(name, new Symbol { Kind = SymKinds.FUNC, CallKind = callkind, NumArgs = numargs, DataType = type, FuncKind = funckind, CallInfo = CallInfo.Get(method), })); }
Symbol AddFunction(string name, int numargs, DataType type, CallKinds callkind, string method, FoldableFlags foldable = FoldableFlags.NUL, FoldSeeds seed = FoldSeeds.NUL) { return(Add(name, new Symbol { Kind = SymKinds.FUNC, CallKind = callkind, NumArgs = numargs, DataType = type, Foldable = foldable, FoldSeed = seed, CallInfo = CallInfo.Get(method), })); }
protected abstract IEnumerable <SyntaxNode> GetCallArgumentExpressionNodes(SyntaxNode?node, CallKinds callKind);
protected override IEnumerable<SyntaxNode> GetCallArgumentExpressionNodes(SyntaxNode node, CallKinds callKind) { if (node != null) { ArgumentListSyntax argList = null; SyntaxKind kind = node.Kind(); if ((kind == SyntaxKind.InvocationExpression) && ((callKind & CallKinds.Invocation) != 0)) { var invocationNode = (InvocationExpressionSyntax)node; argList = invocationNode.ArgumentList; } else if ((kind == SyntaxKind.ObjectCreationExpression) && ((callKind & CallKinds.ObjectCreation) != 0)) { var invocationNode = (ObjectCreationExpressionSyntax)node; argList = invocationNode.ArgumentList; } if (argList != null) { return argList.Arguments.Select(arg => arg.Expression); } } return Enumerable.Empty<SyntaxNode>(); }
protected override IEnumerable <SyntaxNode> GetCallArgumentExpressionNodes(SyntaxNode node, CallKinds callKind) { if (node != null) { ArgumentListSyntax argList = null; SyntaxKind kind = node.Kind(); if ((kind == SyntaxKind.InvocationExpression) && ((callKind & CallKinds.Invocation) != 0)) { var invocationNode = (InvocationExpressionSyntax)node; argList = invocationNode.ArgumentList; } else if ((kind == SyntaxKind.ObjectCreationExpression) && ((callKind & CallKinds.ObjectCreation) != 0)) { var invocationNode = (ObjectCreationExpressionSyntax)node; argList = invocationNode.ArgumentList; } if (argList != null) { return(argList.Arguments.Select(arg => arg.Expression)); } } return(Enumerable.Empty <SyntaxNode>()); }
protected abstract IEnumerable<SyntaxNode> GetCallArgumentExpressionNodes(SyntaxNode node, CallKinds callKind);