summaryrefslogtreecommitdiffstats
path: root/src/ast/types/FunctionType.java
blob: 5e6adaad23a4cb00ff27a41414b58b10235bd524 (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
package ast.types;

/**
 * A Function type.
 */
public class FunctionType extends Type {

    private final int paramNumber;
    private final Type returnType;

    public FunctionType(int paramNumber, Type returnType) {
        this.paramNumber = paramNumber;
        this.returnType = returnType;
    }

    // Return the length of the parameters
    public int getParamNumber() {
        return paramNumber;
    }

    public Type getReturnType() {
        return returnType;
    }

    @Override
    public String toPrint(String prefix) {
        return prefix + "Function\n";
    }
}