Programming-Language-Design / src / ast / expression / classes / IntLiteral.java
IntLiteral.java
Raw
package ast.expression.classes;

import ast.expression.AbstractExpression;
import visitor.Visitor;

public class IntLiteral extends AbstractExpression {

    int value;

    public IntLiteral(int line, int column, int value) {
        super(line, column);
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return Integer.toString(getValue());
    }

    @Override
    public <TP, TR> TR accept(Visitor<TP, TR> v, TP param) {
        return v.visit(this, param);
    }
}