aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/couscous/backends/python/ast/PythonCallNode.java
blob: 3adb4fb67bd38049c9d7d98a9497073203c192ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package org.zwobble.couscous.backends.python.ast;

import org.zwobble.couscous.backends.python.ast.visitors.PythonNodeVisitor;

import java.util.List;

public final class PythonCallNode implements PythonExpressionNode {
    private final PythonExpressionNode callee;
    private final List<PythonExpressionNode> arguments;
    
    @Override
    public void accept(PythonNodeVisitor visitor) {
        visitor.visit(this);
    }
    
    private PythonCallNode(final PythonExpressionNode callee, final List<PythonExpressionNode> arguments) {
        this.callee = callee;
        this.arguments = arguments;
    }
    
    public static PythonCallNode pythonCall(final PythonExpressionNode callee, final List<PythonExpressionNode> arguments) {
        return new PythonCallNode(callee, arguments);
    }
    
    public PythonExpressionNode getCallee() {
        return this.callee;
    }
    
    public List<PythonExpressionNode> getArguments() {
        return this.arguments;
    }
    
    @java.lang.Override
    public java.lang.String toString() {
        return "PythonCallNode(callee=" + this.getCallee() + ", arguments=" + this.getArguments() + ")";
    }

    @Override
    public int precedence() {
        return 150;
    }
}