blob: a07006ea01030ad7fcbdae3bdf6b2717bf66e87e (
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
|
package org.zwobble.couscous.ast;
import org.zwobble.couscous.ast.visitors.ExpressionNodeMapper;
import lombok.Value;
@Value
public class VariableReferenceNode implements ExpressionNode {
public static VariableReferenceNode reference(VariableNode variable) {
return new VariableReferenceNode(variable.getDeclaration());
}
VariableDeclaration referent;
@Override
public <T> T accept(ExpressionNodeMapper<T> visitor) {
return visitor.visit(this);
}
public int getReferentId() {
return referent.getId();
}
@Override
public TypeName getType() {
return referent.getType();
}
}
|