Programming-Language-Design / src / ast / statement / classes / WriteStatement.java
WriteStatement.java
Raw
package ast.statement.classes;

import ast.expression.Expression;
import ast.statement.AbstractStatement;
import visitor.Visitor;

public class WriteStatement extends AbstractStatement {

    Expression value;

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

    public Expression getValue() {
        return value;
    }

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

    @Override
    public String toString() {
        return "write " + getValue();
    }

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