transcendental-lisp/src/interpreter/InteractiveLispInterpreter.java
Mike Cifelli 058e937c3e Refactor main interpreter code
Fixed several minor issues

Only print the last value when interpreting a file

Resolves #4
2017-03-21 15:03:16 -04:00

29 lines
734 B
Java

package interpreter;
import sexpression.SExpression;
public class InteractiveLispInterpreter extends LispInterpreter {
private static final String PROMPT = "~ ";
@Override
protected void prompt() {
environment.getOutput().print(environment.decoratePrompt(PROMPT));
environment.getOutput().flush();
}
@Override
protected void printSExpression(SExpression sExpression) {
environment.getOutput().println();
super.printSExpression(sExpression);
}
@Override
protected void applyFinishingTouches() {
environment.getOutput().println();
environment.getOutput().println(environment.decoratePrompt(""));
environment.getOutput().flush();
}
}