aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/couscous/backends/python/ast/PythonAttributeAccessNode.java
blob: e2b8d8b1280b2d7b2a2abcb44a929439e70e9fff (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
package org.zwobble.couscous.backends.python.ast;

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

public final class PythonAttributeAccessNode implements PythonExpressionNode {
    private final PythonExpressionNode left;
    private final String attributeName;
    
    @Override
    public void accept(PythonNodeVisitor visitor) {
        visitor.visit(this);
    }
    
    private PythonAttributeAccessNode(final PythonExpressionNode left, final String attributeName) {
        this.left = left;
        this.attributeName = attributeName;
    }
    
    public static PythonAttributeAccessNode pythonAttributeAccess(final PythonExpressionNode left, final String attributeName) {
        return new PythonAttributeAccessNode(left, attributeName);
    }
    
    public PythonExpressionNode getLeft() {
        return this.left;
    }
    
    public String getAttributeName() {
        return this.attributeName;
    }
    
    @java.lang.Override
    public java.lang.String toString() {
        return "PythonAttributeAccessNode(left=" + this.getLeft() + ", attributeName=" + this.getAttributeName() + ")";
    }

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