Ejemplo n.º 1
0
 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),
     }));
 }
Ejemplo n.º 2
0
 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),
     }));
 }
Ejemplo n.º 3
0
 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),
     }));
 }
Ejemplo n.º 4
0
 protected abstract IEnumerable <SyntaxNode> GetCallArgumentExpressionNodes(SyntaxNode?node, CallKinds callKind);
Ejemplo n.º 5
0
        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>();
        }
Ejemplo n.º 6
0
        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>());
        }
Ejemplo n.º 7
0
 protected abstract IEnumerable<SyntaxNode> GetCallArgumentExpressionNodes(SyntaxNode node, CallKinds callKind);