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

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

public class Assignment extends AbstractStatement {

    Expression operand_1;
    Expression operand_2;

    public Assignment(int line, int column, Expression operand_1, Expression operand_2) {
        super(line, column);
        this.operand_1 = operand_1;
        this.operand_2 = operand_2;
    }

    public Expression getOperand_1() {
        return operand_1;
    }

    public Expression getOperand_2() {
        return operand_2;
    }

    @Override
    public String toString() {
        return getOperand_1() + "=" + getOperand_2();
    }

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