package interpreter;

import sexpression.SExpression;

public class FileLispInterpreter extends LispInterpreter {

    private SExpression lastSExpression;

    public FileLispInterpreter() {
        this.lastSExpression = null;
    }

    @Override
    protected SExpression evaluateNextSExpression() {
        return this.lastSExpression = super.evaluateNextSExpression();
    }

    @Override
    protected void printSExpression(SExpression sExpression) {}

    @Override
    protected void applyFinishingTouches() {
        if (lastSExpression != null)
            super.printSExpression(lastSExpression);

        super.applyFinishingTouches();
    }

}
