package main; import interpreter.*; public class LispMain { private LispMain() {} public static void main(String[] args) { LispInterpreter interpreter = buildInterpreter(args); interpreter.interpret(); } private static LispInterpreter buildInterpreter(String[] args) { LispInterpreterBuilder builder = new LispInterpreterBuilderImpl(); builder.setInput(System.in); builder.setOutput(System.out); builder.setErrorOutput(System.err); builder.setTerminationFunction(() -> System.exit(0)); builder.setErrorTerminationFunction(() -> System.exit(1)); if (args.length > 0) builder.useFile(args[0]); return builder.build(); } }