Update import arrangement

This commit is contained in:
Mike Cifelli 2018-03-17 10:02:52 -04:00
parent d0cffe7500
commit bd7df920fa
161 changed files with 795 additions and 861 deletions

View File

@ -4,6 +4,19 @@
<option name="DO_NOT_WRAP_AFTER_SINGLE_ANNOTATION" value="true" />
<option name="ANNOTATION_PARAMETER_WRAP" value="5" />
<option name="ALIGN_MULTILINE_ANNOTATION_PARAMETERS" value="true" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="IMPORT_LAYOUT_TABLE">
<value>
<emptyLine />
<package name="" withSubpackages="true" static="false" />
<emptyLine />
<package name="javax" withSubpackages="true" static="false" />
<package name="java" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="true" />
</value>
</option>
</JavaCodeStyleSettings>
<XML>
<option name="XML_SPACE_INSIDE_EMPTY_TAG" value="true" />

View File

@ -1,8 +1,14 @@
package application;
import static com.googlecode.lanterna.terminal.IOSafeTerminalAdapter.createRuntimeExceptionConvertingAdapter;
import static java.text.MessageFormat.format;
import static terminal.LispTerminal.END_OF_SEGMENT;
import com.googlecode.lanterna.terminal.DefaultTerminalFactory;
import com.googlecode.lanterna.terminal.IOSafeTerminal;
import com.googlecode.lanterna.terminal.Terminal;
import interpreter.LispInterpreter;
import interpreter.LispInterpreterBuilder;
import interpreter.LispInterpreterBuilderImpl;
import stream.UncheckedIOException;
import terminal.LispTerminal;
import terminal.TerminalConfiguration;
import java.io.IOException;
import java.io.PipedInputStream;
@ -10,16 +16,9 @@ import java.io.PipedOutputStream;
import java.io.PrintStream;
import java.util.function.Function;
import com.googlecode.lanterna.terminal.DefaultTerminalFactory;
import com.googlecode.lanterna.terminal.IOSafeTerminal;
import com.googlecode.lanterna.terminal.Terminal;
import interpreter.LispInterpreter;
import interpreter.LispInterpreterBuilder;
import interpreter.LispInterpreterBuilderImpl;
import stream.UncheckedIOException;
import terminal.LispTerminal;
import terminal.TerminalConfiguration;
import static com.googlecode.lanterna.terminal.IOSafeTerminalAdapter.createRuntimeExceptionConvertingAdapter;
import static java.text.MessageFormat.format;
import static terminal.LispTerminal.END_OF_SEGMENT;
public class LispMain {

View File

@ -1,11 +1,11 @@
package environment;
import error.ErrorManager;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.function.Function;
import error.ErrorManager;
public class RuntimeEnvironment {
private static RuntimeEnvironment uniqueInstance = new RuntimeEnvironment();

View File

@ -1,10 +1,10 @@
package error;
import static error.ErrorManager.Severity.CRITICAL;
import error.ErrorManager.Severity;
import file.FilePosition;
import static error.ErrorManager.Severity.CRITICAL;
public abstract class CriticalLineColumnException extends LineColumnException {
private static final long serialVersionUID = 1L;

View File

@ -1,9 +1,9 @@
package error;
import static error.ErrorManager.Severity.CRITICAL;
import error.ErrorManager.Severity;
import static error.ErrorManager.Severity.CRITICAL;
public abstract class CriticalLispException extends LispException {
private static final long serialVersionUID = 1L;

View File

@ -1,13 +1,13 @@
package error;
import environment.RuntimeEnvironment;
import java.io.PrintStream;
import static error.ErrorManager.Severity.CRITICAL;
import static error.ErrorManager.Severity.WARNING;
import static java.text.MessageFormat.format;
import java.io.PrintStream;
import environment.RuntimeEnvironment;
/**
* Prints error messages and potentially terminates the application.
*/

View File

@ -1,9 +1,9 @@
package error;
import static java.text.MessageFormat.format;
import file.FilePosition;
import static java.text.MessageFormat.format;
public abstract class LineColumnException extends LispException {
private static final long serialVersionUID = 1L;

View File

@ -1,9 +1,9 @@
package error;
import static error.ErrorManager.Severity.ERROR;
import error.ErrorManager.Severity;
import static error.ErrorManager.Severity.ERROR;
public abstract class LispException extends RuntimeException {
private static final long serialVersionUID = 1L;

View File

@ -1,9 +1,9 @@
package error;
import static error.ErrorManager.Severity.WARNING;
import error.ErrorManager.Severity;
import static error.ErrorManager.Severity.WARNING;
public abstract class LispWarning extends LispException {
private static final long serialVersionUID = 1L;

View File

@ -1,15 +1,15 @@
package function;
import static function.builtin.cons.LENGTH.getLength;
import static java.text.MessageFormat.format;
import java.math.BigInteger;
import error.LispException;
import sexpression.Cons;
import sexpression.DisplayName;
import sexpression.SExpression;
import java.math.BigInteger;
import static function.builtin.cons.LENGTH.getLength;
import static java.text.MessageFormat.format;
public class ArgumentValidator {
private Class<? extends SExpression> firstArgumentType;

View File

@ -1,12 +1,5 @@
package function;
import static function.builtin.EVAL.eval;
import static java.text.MessageFormat.format;
import static recursion.TailCalls.done;
import static sexpression.Nil.NIL;
import java.util.ArrayList;
import error.LispException;
import recursion.TailCall;
import recursion.TailCalls;
@ -16,6 +9,13 @@ import sexpression.Symbol;
import table.ExecutionContext;
import table.SymbolTable;
import java.util.ArrayList;
import static function.builtin.EVAL.eval;
import static java.text.MessageFormat.format;
import static recursion.TailCalls.done;
import static sexpression.Nil.NIL;
public class UserDefinedFunction extends LispFunction {
private static final String KEYWORD_REST = "&REST";

View File

@ -1,15 +1,15 @@
package function.builtin;
import static function.builtin.EVAL.applyFunction;
import static function.builtin.EVAL.lookupFunctionOrLambda;
import static table.FunctionTable.lookupFunction;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
import static function.builtin.EVAL.applyFunction;
import static function.builtin.EVAL.lookupFunctionOrLambda;
import static table.FunctionTable.lookupFunction;
@FunctionNames({ "APPLY" })
public class APPLY extends LispFunction {

View File

@ -1,8 +1,5 @@
package function.builtin;
import static function.builtin.EVAL.eval;
import static sexpression.Nil.NIL;
import error.LispException;
import function.ArgumentValidator;
import sexpression.AtSignExpression;
@ -11,6 +8,9 @@ import sexpression.CommaExpression;
import sexpression.Cons;
import sexpression.SExpression;
import static function.builtin.EVAL.eval;
import static sexpression.Nil.NIL;
class BackquoteEvaluator {
private ArgumentValidator listValidator;

View File

@ -1,13 +1,5 @@
package function.builtin;
import static function.builtin.cons.LIST.makeList;
import static function.builtin.special.LAMBDA.createFunction;
import static function.builtin.special.LAMBDA.isLambdaExpression;
import static java.text.MessageFormat.format;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import static table.FunctionTable.lookupFunction;
import error.LispException;
import function.ArgumentValidator;
import function.FunctionNames;
@ -20,6 +12,14 @@ import sexpression.SExpression;
import sexpression.Symbol;
import table.ExecutionContext;
import static function.builtin.cons.LIST.makeList;
import static function.builtin.special.LAMBDA.createFunction;
import static function.builtin.special.LAMBDA.isLambdaExpression;
import static java.text.MessageFormat.format;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import static table.FunctionTable.lookupFunction;
@FunctionNames({ "EVAL" })
public class EVAL extends LispFunction {

View File

@ -1,7 +1,5 @@
package function.builtin;
import static sexpression.Nil.NIL;
import environment.RuntimeEnvironment;
import function.ArgumentValidator;
import function.FunctionNames;
@ -9,6 +7,8 @@ import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
import static sexpression.Nil.NIL;
@FunctionNames({ "EXIT" })
public class EXIT extends LispFunction {

View File

@ -1,14 +1,14 @@
package function.builtin;
import static function.builtin.APPLY.apply;
import static function.builtin.cons.LIST.makeList;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
import static function.builtin.APPLY.apply;
import static function.builtin.cons.LIST.makeList;
@FunctionNames({ "FUNCALL", "CALL" })
public class FUNCALL extends LispFunction {

View File

@ -1,7 +1,5 @@
package function.builtin;
import java.math.BigInteger;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
@ -9,6 +7,8 @@ import sexpression.Cons;
import sexpression.SExpression;
import sexpression.Symbol;
import java.math.BigInteger;
@FunctionNames({ "GENSYM" })
public class GENSYM extends LispFunction {

View File

@ -1,15 +1,5 @@
package function.builtin;
import static function.builtin.EVAL.eval;
import static java.text.MessageFormat.format;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import static util.Path.getPathPrefix;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Stack;
import environment.RuntimeEnvironment;
import error.LispException;
import error.LispWarning;
@ -21,6 +11,16 @@ import sexpression.Cons;
import sexpression.LispString;
import sexpression.SExpression;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Stack;
import static function.builtin.EVAL.eval;
import static java.text.MessageFormat.format;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import static util.Path.getPathPrefix;
@FunctionNames({ "LOAD" })
public class LOAD extends LispFunction {

View File

@ -1,7 +1,5 @@
package function.builtin;
import static table.FunctionTable.lookupFunction;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
@ -11,6 +9,8 @@ import sexpression.Symbol;
import table.ExecutionContext;
import table.SymbolTable;
import static table.FunctionTable.lookupFunction;
@FunctionNames({ "SET" })
public class SET extends LispFunction {

View File

@ -1,8 +1,5 @@
package function.builtin;
import static java.text.MessageFormat.format;
import static table.FunctionTable.lookupFunction;
import error.LispException;
import function.ArgumentValidator;
import function.FunctionNames;
@ -13,6 +10,9 @@ import sexpression.Cons;
import sexpression.SExpression;
import sexpression.Symbol;
import static java.text.MessageFormat.format;
import static table.FunctionTable.lookupFunction;
@FunctionNames({ "SYMBOL-FUNCTION" })
public class SYMBOL_FUNCTION extends LispFunction {

View File

@ -1,13 +1,13 @@
package function.builtin.cons;
import static sexpression.Nil.NIL;
import static table.FunctionTable.lookupFunction;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import static sexpression.Nil.NIL;
import static table.FunctionTable.lookupFunction;
@FunctionNames({ "APPEND" })
public class APPEND extends LispFunction {

View File

@ -1,12 +1,5 @@
package function.builtin.cons;
import static function.builtin.cons.LIST.makeList;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static table.FunctionTable.lookupFunction;
import java.math.BigInteger;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
@ -14,6 +7,13 @@ import recursion.TailCall;
import sexpression.Cons;
import sexpression.LispNumber;
import java.math.BigInteger;
import static function.builtin.cons.LIST.makeList;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static table.FunctionTable.lookupFunction;
@FunctionNames({ "LENGTH" })
public class LENGTH extends LispFunction {

View File

@ -1,13 +1,13 @@
package function.builtin.cons;
import static sexpression.Nil.NIL;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
import static sexpression.Nil.NIL;
@FunctionNames({ "LIST" })
public class LIST extends LispFunction {

View File

@ -1,7 +1,5 @@
package function.builtin.math;
import java.math.BigInteger;
import error.LispException;
import function.ArgumentValidator;
import function.FunctionNames;
@ -9,6 +7,8 @@ import function.LispFunction;
import sexpression.Cons;
import sexpression.LispNumber;
import java.math.BigInteger;
@FunctionNames({ "/" })
public class DIVIDE extends LispFunction {

View File

@ -1,13 +1,13 @@
package function.builtin.math;
import java.math.BigInteger;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.LispNumber;
import java.math.BigInteger;
@FunctionNames({ "-" })
public class MINUS extends LispFunction {

View File

@ -1,13 +1,13 @@
package function.builtin.math;
import static sexpression.LispNumber.ONE;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.LispNumber;
import static sexpression.LispNumber.ONE;
@FunctionNames({ "*" })
public class MULTIPLY extends LispFunction {

View File

@ -1,16 +1,16 @@
package function.builtin.math;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import java.util.function.BiFunction;
import java.util.function.Function;
import recursion.TailCall;
import sexpression.Cons;
import sexpression.LispNumber;
import sexpression.SExpression;
import java.util.function.BiFunction;
import java.util.function.Function;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
class MathFunction {
Function<LispNumber, LispNumber> singleValueOperation;

View File

@ -1,13 +1,13 @@
package function.builtin.math;
import static sexpression.LispNumber.ZERO;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.LispNumber;
import static sexpression.LispNumber.ZERO;
@FunctionNames({ "+" })
public class PLUS extends LispFunction {

View File

@ -1,14 +1,14 @@
package function.builtin.predicate;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
@FunctionNames({ "ATOM", "ATOM?" })
public class ATOM extends LispFunction {

View File

@ -1,14 +1,14 @@
package function.builtin.predicate;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
@FunctionNames({ "EQ", "EQ?" })
public class EQ extends LispFunction {

View File

@ -1,14 +1,14 @@
package function.builtin.predicate;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
@FunctionNames({ "EQUAL", "EQUAL?" })
public class EQUAL extends LispFunction {

View File

@ -1,8 +1,10 @@
package function.builtin.predicate;
import static function.builtin.GENSYM.GENSYM_PREFIX;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
import java.util.HashMap;
import java.util.Map;
@ -10,11 +12,9 @@ import java.util.Map.Entry;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
import static function.builtin.GENSYM.GENSYM_PREFIX;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
@FunctionNames({ "GENSYM-EQUAL", "GENSYM-EQUAL?" })
public class GENSYM_EQUAL extends LispFunction {

View File

@ -1,14 +1,14 @@
package function.builtin.predicate;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
@FunctionNames({ "LISTP", "LIST?" })
public class LISTP extends LispFunction {

View File

@ -1,14 +1,14 @@
package function.builtin.predicate;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
@FunctionNames({ "NULL", "NULL?" })
public class NULL extends LispFunction {

View File

@ -1,10 +1,5 @@
package function.builtin.predicate;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
@ -13,6 +8,11 @@ import sexpression.Cons;
import sexpression.LispNumber;
import sexpression.SExpression;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
@FunctionNames({ "=" })
public class NUMERIC_EQUAL extends LispFunction {

View File

@ -1,10 +1,5 @@
package function.builtin.predicate;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
@ -13,6 +8,11 @@ import sexpression.Cons;
import sexpression.LispNumber;
import sexpression.SExpression;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
@FunctionNames({ ">" })
public class NUMERIC_GREATER extends LispFunction {

View File

@ -1,10 +1,5 @@
package function.builtin.predicate;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
@ -13,6 +8,11 @@ import sexpression.Cons;
import sexpression.LispNumber;
import sexpression.SExpression;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
@FunctionNames({ "<" })
public class NUMERIC_LESS extends LispFunction {

View File

@ -1,10 +1,5 @@
package function.builtin.special;
import static function.builtin.EVAL.eval;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static sexpression.Symbol.T;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
@ -12,6 +7,11 @@ import recursion.TailCall;
import sexpression.Cons;
import sexpression.SExpression;
import static function.builtin.EVAL.eval;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static sexpression.Symbol.T;
@FunctionNames({ "AND" })
public class AND extends LispSpecialFunction {

View File

@ -1,12 +1,5 @@
package function.builtin.special;
import static function.builtin.EVAL.eval;
import static function.builtin.predicate.EQUAL.isEqual;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
@ -15,6 +8,13 @@ import sexpression.Cons;
import sexpression.Nil;
import sexpression.SExpression;
import static function.builtin.EVAL.eval;
import static function.builtin.predicate.EQUAL.isEqual;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
@FunctionNames({ "CASE" })
public class CASE extends LispSpecialFunction {

View File

@ -1,10 +1,5 @@
package function.builtin.special;
import static function.builtin.EVAL.eval;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static sexpression.Nil.NIL;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
@ -13,6 +8,11 @@ import sexpression.Cons;
import sexpression.Nil;
import sexpression.SExpression;
import static function.builtin.EVAL.eval;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static sexpression.Nil.NIL;
@FunctionNames({ "COND" })
public class COND extends LispSpecialFunction {

View File

@ -1,10 +1,5 @@
package function.builtin.special;
import static function.builtin.cons.LIST.makeList;
import static java.text.MessageFormat.format;
import static table.FunctionTable.defineFunction;
import static table.FunctionTable.isAlreadyDefined;
import environment.RuntimeEnvironment;
import error.LispWarning;
import function.ArgumentValidator;
@ -14,6 +9,11 @@ import sexpression.Cons;
import sexpression.SExpression;
import sexpression.Symbol;
import static function.builtin.cons.LIST.makeList;
import static java.text.MessageFormat.format;
import static table.FunctionTable.defineFunction;
import static table.FunctionTable.isAlreadyDefined;
public abstract class Define extends LispSpecialFunction {
private ArgumentValidator argumentValidator;

View File

@ -1,13 +1,13 @@
package function.builtin.special;
import static function.builtin.EVAL.eval;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
import sexpression.Cons;
import sexpression.SExpression;
import static function.builtin.EVAL.eval;
@FunctionNames({ "IF" })
public class IF extends LispSpecialFunction {

View File

@ -1,7 +1,5 @@
package function.builtin.special;
import static function.builtin.cons.LIST.makeList;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
@ -11,6 +9,8 @@ import sexpression.LambdaExpression;
import sexpression.SExpression;
import sexpression.Symbol;
import static function.builtin.cons.LIST.makeList;
@FunctionNames({ "LAMBDA", "Λ" })
public class LAMBDA extends LispSpecialFunction {

View File

@ -1,8 +1,5 @@
package function.builtin.special;
import static function.builtin.EVAL.eval;
import static sexpression.Nil.NIL;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
@ -12,6 +9,9 @@ import sexpression.Symbol;
import table.ExecutionContext;
import table.SymbolTable;
import static function.builtin.EVAL.eval;
import static sexpression.Nil.NIL;
@FunctionNames({ "LET" })
public class LET extends LispSpecialFunction {

View File

@ -1,9 +1,5 @@
package function.builtin.special;
import static function.builtin.EVAL.eval;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
@ -11,6 +7,10 @@ import recursion.TailCall;
import sexpression.Cons;
import sexpression.SExpression;
import static function.builtin.EVAL.eval;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
@FunctionNames({ "OR" })
public class OR extends LispSpecialFunction {

View File

@ -1,10 +1,5 @@
package function.builtin.special;
import static function.builtin.EVAL.eval;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static sexpression.Nil.NIL;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
@ -12,6 +7,11 @@ import recursion.TailCall;
import sexpression.Cons;
import sexpression.SExpression;
import static function.builtin.EVAL.eval;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import static sexpression.Nil.NIL;
@FunctionNames({ "PROGN", "BEGIN" })
public class PROGN extends LispSpecialFunction {

View File

@ -1,7 +1,5 @@
package function.builtin.special;
import static function.builtin.EVAL.evaluateFunctionArgumentList;
import error.LispException;
import function.ArgumentValidator;
import function.FunctionNames;
@ -10,6 +8,8 @@ import sexpression.Cons;
import sexpression.SExpression;
import table.ExecutionContext;
import static function.builtin.EVAL.evaluateFunctionArgumentList;
@FunctionNames({ "RECUR" })
public class RECUR extends LispSpecialFunction {

View File

@ -1,9 +1,5 @@
package function.builtin.special;
import static function.builtin.EVAL.eval;
import static function.builtin.SET.set;
import static function.builtin.cons.LIST.makeList;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
@ -11,6 +7,10 @@ import sexpression.Cons;
import sexpression.SExpression;
import sexpression.Symbol;
import static function.builtin.EVAL.eval;
import static function.builtin.SET.set;
import static function.builtin.cons.LIST.makeList;
@FunctionNames({ "SETQ" })
public class SETQ extends LispSpecialFunction {

View File

@ -1,15 +1,15 @@
package interpreter;
import static function.builtin.EVAL.eval;
import java.io.InputStream;
import java.util.List;
import environment.RuntimeEnvironment;
import error.LispException;
import parser.LispParser;
import sexpression.SExpression;
import java.io.InputStream;
import java.util.List;
import static function.builtin.EVAL.eval;
public class LispInterpreter {
protected RuntimeEnvironment environment;

View File

@ -1,6 +1,9 @@
package interpreter;
import static util.Path.getPathPrefix;
import environment.RuntimeEnvironment;
import error.CriticalLispException;
import error.ErrorManager;
import interpreter.LispInterpreter.LanguageFile;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@ -10,10 +13,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
import environment.RuntimeEnvironment;
import error.CriticalLispException;
import error.ErrorManager;
import interpreter.LispInterpreter.LanguageFile;
import static util.Path.getPathPrefix;
public class LispInterpreterBuilderImpl implements LispInterpreterBuilder {

View File

@ -1,13 +1,13 @@
package parser;
import java.io.InputStream;
import error.LispException;
import scanner.LispScanner;
import sexpression.SExpression;
import token.Eof;
import token.Token;
import java.io.InputStream;
/**
* Converts a stream of bytes into internal representations of Lisp s-expressions.
*/

View File

@ -16,14 +16,10 @@ public interface TailCall<T> {
}
default T invoke() {
// @formatter:off
return Stream.iterate(this, TailCall::apply)
.filter(TailCall::isComplete)
.findFirst()
.get()
.result();
// @formatter:on
}
}

View File

@ -1,15 +1,15 @@
package scanner;
import stream.SafeInputStream;
import java.io.InputStream;
import static util.Characters.BACKSLASH;
import static util.Characters.DOUBLE_QUOTE;
import static util.Characters.EOF;
import static util.Characters.NEWLINE;
import static util.Characters.SEMICOLON;
import java.io.InputStream;
import stream.SafeInputStream;
/**
* Removes Lisp comments from an input stream.
*/

View File

@ -1,5 +1,16 @@
package scanner;
import error.LineColumnException;
import file.FilePosition;
import file.FilePositionTracker;
import token.Token;
import token.TokenFactory;
import token.TokenFactoryImpl;
import util.Characters;
import java.io.InputStream;
import java.util.function.Function;
import static java.lang.Character.isDigit;
import static java.lang.Character.isWhitespace;
import static util.Characters.BACKSLASH;
@ -9,17 +20,6 @@ import static util.Characters.NEWLINE;
import static util.Characters.isLegalIdentifierCharacter;
import static util.Characters.isNumberPrefix;
import java.io.InputStream;
import java.util.function.Function;
import error.LineColumnException;
import file.FilePosition;
import file.FilePositionTracker;
import token.Token;
import token.TokenFactory;
import token.TokenFactoryImpl;
import util.Characters;
/**
* Converts a stream of bytes into a stream of Lisp tokens.
*/

View File

@ -1,10 +1,10 @@
package sexpression;
import recursion.TailCall;
import static recursion.TailCalls.done;
import static recursion.TailCalls.tailCall;
import recursion.TailCall;
@DisplayName("list")
public class Cons extends SExpression {

View File

@ -1,10 +1,10 @@
package sexpression;
import static java.text.MessageFormat.format;
import error.LispException;
import java.math.BigInteger;
import error.LispException;
import static java.text.MessageFormat.format;
@DisplayName("number")
public class LispNumber extends Atom {

View File

@ -1,11 +1,11 @@
package stream;
import static java.nio.charset.StandardCharsets.UTF_8;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import static java.nio.charset.StandardCharsets.UTF_8;
public class SafeInputStream {
private InputStreamReader underlyingStream;

View File

@ -1,9 +1,9 @@
package stream;
import java.io.IOException;
import error.CriticalLispException;
import java.io.IOException;
public class UncheckedIOException extends CriticalLispException {
private static final long serialVersionUID = 1L;

View File

@ -1,13 +1,13 @@
package table;
import static sexpression.Nil.NIL;
import java.util.Stack;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
import java.util.Stack;
import static sexpression.Nil.NIL;
public class ExecutionContext {
private static ExecutionContext uniqueInstance = new ExecutionContext();

View File

@ -1,12 +1,5 @@
package table;
import static java.text.MessageFormat.format;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import error.CriticalLispException;
import function.FunctionNames;
import function.LispFunction;
@ -58,6 +51,13 @@ import function.builtin.special.QUOTE;
import function.builtin.special.RECUR;
import function.builtin.special.SETQ;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import static java.text.MessageFormat.format;
public class FunctionTable {
private static Set<Class<? extends LispFunction>> allBuiltIns = new HashSet<>();

View File

@ -1,17 +1,17 @@
package table;
import static function.builtin.cons.APPEND.append;
import static function.builtin.cons.LIST.makeList;
import static sexpression.Nil.NIL;
import sexpression.Cons;
import sexpression.SExpression;
import sexpression.Symbol;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
import sexpression.Cons;
import sexpression.SExpression;
import sexpression.Symbol;
import static function.builtin.cons.APPEND.append;
import static function.builtin.cons.LIST.makeList;
import static sexpression.Nil.NIL;
public class SymbolTable {

View File

@ -1,12 +1,12 @@
package terminal;
import stream.SafeInputStream;
import static java.lang.Character.isDigit;
import static util.Characters.EOF;
import static util.Characters.LEFT_SQUARE_BRACKET;
import static util.Characters.UNICODE_ESCAPE;
import stream.SafeInputStream;
class ControlSequenceHandler {
public static final boolean isEscape(char c) {

View File

@ -1,11 +1,11 @@
package terminal;
import static terminal.SelectGraphicRendition.SGR_COMMAND;
import terminal.ControlSequence.NullControlSequence;
import java.util.HashMap;
import java.util.Map;
import terminal.ControlSequence.NullControlSequence;
import static terminal.SelectGraphicRendition.SGR_COMMAND;
public class ControlSequenceLookup {

View File

@ -1,5 +1,17 @@
package terminal;
import com.googlecode.lanterna.TerminalPosition;
import com.googlecode.lanterna.TerminalSize;
import com.googlecode.lanterna.input.KeyStroke;
import com.googlecode.lanterna.input.KeyType;
import com.googlecode.lanterna.terminal.IOSafeTerminal;
import stream.SafeInputStream;
import stream.SafeOutputStream;
import java.io.ByteArrayInputStream;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import static com.googlecode.lanterna.input.KeyType.ArrowDown;
import static com.googlecode.lanterna.input.KeyType.ArrowLeft;
import static com.googlecode.lanterna.input.KeyType.ArrowRight;
@ -12,19 +24,6 @@ import static terminal.ControlSequenceHandler.isEscape;
import static util.Characters.EOF;
import static util.Characters.UNICODE_NULL;
import java.io.ByteArrayInputStream;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.googlecode.lanterna.TerminalPosition;
import com.googlecode.lanterna.TerminalSize;
import com.googlecode.lanterna.input.KeyStroke;
import com.googlecode.lanterna.input.KeyType;
import com.googlecode.lanterna.terminal.IOSafeTerminal;
import stream.SafeInputStream;
import stream.SafeOutputStream;
public class LispTerminal {
public static final char END_OF_SEGMENT = UNICODE_NULL;

View File

@ -1,13 +1,12 @@
package terminal;
import com.googlecode.lanterna.terminal.IOSafeTerminal;
import stream.UncheckedIOException;
import java.io.IOException;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import com.googlecode.lanterna.terminal.IOSafeTerminal;
import stream.UncheckedIOException;
public class TerminalConfiguration {
private PipedOutputStream inputWriter;

View File

@ -1,11 +1,11 @@
package token;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.AtSignExpression;
import sexpression.SExpression;
import java.util.function.Supplier;
public class AtSign extends Token {
public AtSign(String text, FilePosition position) {

View File

@ -1,11 +1,11 @@
package token;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.BackquoteExpression;
import sexpression.SExpression;
import java.util.function.Supplier;
public class Backquote extends Token {
public Backquote(String text, FilePosition position) {

View File

@ -1,11 +1,11 @@
package token;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.CommaExpression;
import sexpression.SExpression;
import java.util.function.Supplier;
public class Comma extends Token {
public Comma(String text, FilePosition position) {

View File

@ -1,11 +1,11 @@
package token;
import java.util.function.Supplier;
import error.LineColumnException;
import file.FilePosition;
import sexpression.SExpression;
import java.util.function.Supplier;
public class Eof extends Token {
public Eof(String text, FilePosition position) {

View File

@ -1,11 +1,11 @@
package token;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.SExpression;
import sexpression.Symbol;
import java.util.function.Supplier;
public class Identifier extends Token {
public Identifier(String text, FilePosition position) {

View File

@ -1,10 +1,10 @@
package token;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.SExpression;
import java.util.function.Supplier;
public class LeftParenthesis extends Token {
public LeftParenthesis(String text, FilePosition position) {

View File

@ -1,11 +1,11 @@
package token;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.LispNumber;
import sexpression.SExpression;
import java.util.function.Supplier;
public class Number extends Token {
public Number(String text, FilePosition position) {

View File

@ -1,14 +1,14 @@
package token;
import static sexpression.Nil.NIL;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.Cons;
import sexpression.SExpression;
import sexpression.Symbol;
import java.util.function.Supplier;
import static sexpression.Nil.NIL;
public class QuoteMark extends Token {
public QuoteMark(String text, FilePosition position) {

View File

@ -1,11 +1,11 @@
package token;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.LispString;
import sexpression.SExpression;
import java.util.function.Supplier;
public class QuotedString extends Token {
public QuotedString(String text, FilePosition position) {

View File

@ -1,16 +1,16 @@
package token;
import static recursion.TailCalls.done;
import static sexpression.Nil.NIL;
import java.util.function.Supplier;
import error.LineColumnException;
import file.FilePosition;
import recursion.TailCall;
import sexpression.Cons;
import sexpression.SExpression;
import java.util.function.Supplier;
import static recursion.TailCalls.done;
import static sexpression.Nil.NIL;
public class RightParenthesis extends Token {
public RightParenthesis(String text, FilePosition position) {

View File

@ -1,15 +1,15 @@
package token;
import static recursion.TailCalls.tailCall;
import static sexpression.Nil.NIL;
import java.util.function.Supplier;
import file.FilePosition;
import recursion.TailCall;
import sexpression.Cons;
import sexpression.SExpression;
import java.util.function.Supplier;
import static recursion.TailCalls.tailCall;
import static sexpression.Nil.NIL;
public abstract class Token {
private String text;

View File

@ -1,11 +1,11 @@
package token;
import static java.text.MessageFormat.format;
import error.CriticalLineColumnException;
import error.LineColumnException;
import file.FilePosition;
import static java.text.MessageFormat.format;
public interface TokenFactory {
Token createToken(String text, FilePosition position);

View File

@ -1,5 +1,7 @@
package token;
import file.FilePosition;
import static java.lang.Character.isDigit;
import static util.Characters.AT_SIGN;
import static util.Characters.BACKQUOTE;
@ -11,8 +13,6 @@ import static util.Characters.SINGLE_QUOTE;
import static util.Characters.isLegalIdentifierCharacter;
import static util.Characters.isNumberPrefix;
import file.FilePosition;
public class TokenFactoryImpl implements TokenFactory {
@Override

View File

@ -1,8 +1,7 @@
package acceptance;
import org.junit.runner.RunWith;
import fitnesse.junit.FitNesseRunner;
import org.junit.runner.RunWith;
@RunWith(FitNesseRunner.class)
@FitNesseRunner.Suite("TranscendentalLisp")

View File

@ -1,8 +1,10 @@
package acceptance.fixture;
import static application.LispMain.LANGUAGE_FILE_NAMES;
import static table.FunctionTable.resetFunctionTable;
import static util.Path.getPathPrefix;
import environment.RuntimeEnvironment;
import interpreter.LispInterpreter;
import interpreter.LispInterpreterBuilder;
import interpreter.LispInterpreterBuilderImpl;
import table.ExecutionContext;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@ -10,11 +12,9 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import environment.RuntimeEnvironment;
import interpreter.LispInterpreter;
import interpreter.LispInterpreterBuilder;
import interpreter.LispInterpreterBuilderImpl;
import table.ExecutionContext;
import static application.LispMain.LANGUAGE_FILE_NAMES;
import static table.FunctionTable.resetFunctionTable;
import static util.Path.getPathPrefix;
public class LispInterpreterFixture {

View File

@ -1,31 +1,29 @@
package application;
import static com.googlecode.lanterna.input.KeyType.Enter;
import static java.text.MessageFormat.format;
import static application.LispMain.ANSI_GREEN;
import static application.LispMain.ANSI_PURPLE;
import static application.LispMain.ANSI_RESET;
import static application.LispMain.GREETING;
import static org.junit.Assert.assertEquals;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.util.concurrent.CountDownLatch;
import com.googlecode.lanterna.terminal.virtual.DefaultVirtualTerminal;
import environment.RuntimeEnvironment;
import interpreter.LispInterpreterBuilderImpl;
import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.ExpectedSystemExit;
import org.junit.contrib.java.lang.system.SystemErrRule;
import org.junit.contrib.java.lang.system.SystemOutRule;
import com.googlecode.lanterna.terminal.virtual.DefaultVirtualTerminal;
import environment.RuntimeEnvironment;
import interpreter.LispInterpreterBuilderImpl;
import terminal.TerminalConfiguration;
import terminal.VirtualTerminalInteractor;
import testutil.SymbolAndFunctionCleaner;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.util.concurrent.CountDownLatch;
import static application.LispMain.ANSI_GREEN;
import static application.LispMain.ANSI_PURPLE;
import static application.LispMain.ANSI_RESET;
import static application.LispMain.GREETING;
import static com.googlecode.lanterna.input.KeyType.Enter;
import static java.text.MessageFormat.format;
import static org.junit.Assert.assertEquals;
public class MainTest extends SymbolAndFunctionCleaner {
private RuntimeEnvironment environment;

View File

@ -1,19 +1,18 @@
package environment;
import error.ErrorManager;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.HashSet;
import java.util.Set;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.HashSet;
import java.util.Set;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import error.ErrorManager;
public class RuntimeEnvironmentTest {
private static final String TERMINATED_SUCCESSFULLY = "TERMINATED_SUCCESSFULLY";

View File

@ -1,22 +1,21 @@
package error;
import static error.ErrorManager.Severity.CRITICAL;
import static error.ErrorManager.Severity.ERROR;
import static error.ErrorManager.Severity.WARNING;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import environment.RuntimeEnvironment;
import error.ErrorManager.Severity;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Set;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import environment.RuntimeEnvironment;
import error.ErrorManager.Severity;
import static error.ErrorManager.Severity.CRITICAL;
import static error.ErrorManager.Severity.ERROR;
import static error.ErrorManager.Severity.WARNING;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class ErrorManagerTest {

View File

@ -1,12 +1,12 @@
package file;
import static org.junit.Assert.assertTrue;
import java.util.Objects;
import org.junit.Before;
import org.junit.Test;
import java.util.Objects;
import static org.junit.Assert.assertTrue;
public class FilePositionTrackerTest {
public static final String FILE_NAME = "testFile";

View File

@ -1,5 +1,17 @@
package function;
import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.DottedArgumentListException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import org.junit.Before;
import org.junit.Test;
import sexpression.Cons;
import sexpression.LispString;
import sexpression.Nil;
import sexpression.SExpression;
import sexpression.Symbol;
import static error.ErrorManager.Severity.ERROR;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@ -7,19 +19,6 @@ import static org.junit.Assert.assertTrue;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import org.junit.Before;
import org.junit.Test;
import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.DottedArgumentListException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import sexpression.Cons;
import sexpression.LispString;
import sexpression.Nil;
import sexpression.SExpression;
import sexpression.Symbol;
public class ArgumentValidatorTest {
private ArgumentValidator validator;

View File

@ -1,12 +1,11 @@
package function;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import sexpression.Cons;
import sexpression.SExpression;
import static org.junit.Assert.assertTrue;
public class LispFunctionTest {
@Test

View File

@ -1,12 +1,11 @@
package function;
import static org.junit.Assert.assertFalse;
import org.junit.Test;
import sexpression.Cons;
import sexpression.SExpression;
import static org.junit.Assert.assertFalse;
public class LispSpecialFunctionTest {
@Test

View File

@ -1,22 +1,21 @@
package function;
import error.ErrorManager;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import function.UserDefinedFunction.IllegalKeywordRestPositionException;
import org.junit.Test;
import sexpression.Cons;
import sexpression.LispNumber;
import sexpression.SExpression;
import sexpression.Symbol;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static sexpression.Nil.NIL;
import static testutil.TestUtilities.assertSExpressionsMatch;
import org.junit.Test;
import error.ErrorManager;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import function.UserDefinedFunction.IllegalKeywordRestPositionException;
import sexpression.Cons;
import sexpression.LispNumber;
import sexpression.SExpression;
import sexpression.Symbol;
public class UserDefinedFunctionTest {
private static final String FUNCTION_NAME = "TEST";

View File

@ -1,20 +1,19 @@
package function.builtin;
import static function.builtin.APPLY.apply;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TestUtilities.parseString;
import org.junit.Test;
import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.DottedArgumentListException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import function.builtin.EVAL.UndefinedFunctionException;
import org.junit.Test;
import sexpression.Cons;
import testutil.SymbolAndFunctionCleaner;
import static function.builtin.APPLY.apply;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TestUtilities.parseString;
public class APPLYTest extends SymbolAndFunctionCleaner {
@Test

View File

@ -1,18 +1,11 @@
package function.builtin;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import static testutil.TestUtilities.assertIsErrorWithMessage;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.makeList;
import org.junit.Test;
import function.ArgumentValidator.DottedArgumentListException;
import function.builtin.BackquoteEvaluator.AtSignNotInCommaException;
import function.builtin.BackquoteEvaluator.AtSignNotListException;
import function.builtin.BackquoteEvaluator.NestedAtSignException;
import function.builtin.BackquoteEvaluator.NestedCommaException;
import org.junit.Test;
import sexpression.AtSignExpression;
import sexpression.BackquoteExpression;
import sexpression.CommaExpression;
@ -22,6 +15,12 @@ import sexpression.LispString;
import sexpression.SExpression;
import sexpression.Symbol;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import static testutil.TestUtilities.assertIsErrorWithMessage;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.makeList;
public class BackquoteEvaluatorTest {
private BackquoteEvaluator createBackquoteEvaluator(SExpression expression) {

View File

@ -1,16 +1,5 @@
package function.builtin;
import static function.builtin.EVAL.lookupSymbol;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import static sexpression.Nil.NIL;
import static testutil.TestUtilities.assertIsErrorWithMessage;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TestUtilities.parseString;
import org.junit.Test;
import function.ArgumentValidator.DottedArgumentListException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
@ -20,8 +9,18 @@ import function.builtin.EVAL.UndefinedSymbolException;
import function.builtin.EVAL.UnmatchedAtSignException;
import function.builtin.EVAL.UnmatchedCommaException;
import function.builtin.special.RECUR.RecurNotInTailPositionException;
import org.junit.Test;
import testutil.SymbolAndFunctionCleaner;
import static function.builtin.EVAL.lookupSymbol;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import static sexpression.Nil.NIL;
import static testutil.TestUtilities.assertIsErrorWithMessage;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TestUtilities.parseString;
public class EVALTest extends SymbolAndFunctionCleaner {
@Test

View File

@ -1,17 +1,16 @@
package function.builtin;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static testutil.TestUtilities.evaluateString;
import environment.RuntimeEnvironment;
import function.ArgumentValidator.TooManyArgumentsException;
import org.junit.Test;
import testutil.SymbolAndFunctionCleaner;
import java.util.HashSet;
import java.util.Set;
import org.junit.Test;
import environment.RuntimeEnvironment;
import function.ArgumentValidator.TooManyArgumentsException;
import testutil.SymbolAndFunctionCleaner;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static testutil.TestUtilities.evaluateString;
public class EXITTest extends SymbolAndFunctionCleaner {

View File

@ -1,14 +1,13 @@
package function.builtin;
import function.ArgumentValidator.TooFewArgumentsException;
import org.junit.Test;
import testutil.SymbolAndFunctionCleaner;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TestUtilities.parseString;
import org.junit.Test;
import function.ArgumentValidator.TooFewArgumentsException;
import testutil.SymbolAndFunctionCleaner;
public class FUNCALLTest extends SymbolAndFunctionCleaner {
@Test

View File

@ -1,17 +1,16 @@
package function.builtin;
import function.ArgumentValidator.TooManyArgumentsException;
import org.junit.Test;
import testutil.SymbolAndFunctionCleaner;
import token.TokenFactory.BadCharacterException;
import static function.builtin.GENSYM.GENSYM_PREFIX;
import static testutil.TestUtilities.assertSExpressionsDoNotMatch;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TypeAssertions.assertSymbol;
import org.junit.Test;
import function.ArgumentValidator.TooManyArgumentsException;
import testutil.SymbolAndFunctionCleaner;
import token.TokenFactory.BadCharacterException;
public class GENSYMTest extends SymbolAndFunctionCleaner {
@Test

View File

@ -1,22 +1,21 @@
package function.builtin;
import static org.junit.Assert.assertTrue;
import static testutil.TestUtilities.evaluateString;
import static testutil.TypeAssertions.assertNil;
import static testutil.TypeAssertions.assertT;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.junit.Test;
import environment.RuntimeEnvironment;
import error.ErrorManager;
import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import org.junit.Test;
import testutil.SymbolAndFunctionCleaner;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import static org.junit.Assert.assertTrue;
import static testutil.TestUtilities.evaluateString;
import static testutil.TypeAssertions.assertNil;
import static testutil.TypeAssertions.assertT;
public class LOADTest extends SymbolAndFunctionCleaner {
private ByteArrayOutputStream outputStream;

View File

@ -1,19 +1,18 @@
package function.builtin;
import static java.text.MessageFormat.format;
import static org.junit.Assert.assertEquals;
import static testutil.TestUtilities.evaluateString;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.junit.Test;
import environment.RuntimeEnvironment;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import org.junit.Test;
import testutil.SymbolAndFunctionCleaner;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import static java.text.MessageFormat.format;
import static org.junit.Assert.assertEquals;
import static testutil.TestUtilities.evaluateString;
public class PRINTTest extends SymbolAndFunctionCleaner {
private RuntimeEnvironment environment;

View File

@ -1,19 +1,18 @@
package function.builtin;
import static org.junit.Assert.assertNull;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import org.junit.Test;
import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import function.builtin.EVAL.UndefinedSymbolException;
import org.junit.Test;
import sexpression.LispNumber;
import table.SymbolTable;
import testutil.SymbolAndFunctionCleaner;
import static org.junit.Assert.assertNull;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
public class SETTest extends SymbolAndFunctionCleaner {
@Test

View File

@ -1,13 +1,12 @@
package function.builtin;
import function.ArgumentValidator.TooManyArgumentsException;
import org.junit.Test;
import testutil.SymbolAndFunctionCleaner;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import org.junit.Test;
import function.ArgumentValidator.TooManyArgumentsException;
import testutil.SymbolAndFunctionCleaner;
public class SYMBOLSTest extends SymbolAndFunctionCleaner {
@Test

View File

@ -1,5 +1,12 @@
package function.builtin;
import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import function.builtin.SYMBOL_FUNCTION.UndefinedSymbolFunctionException;
import org.junit.Test;
import testutil.SymbolAndFunctionCleaner;
import static error.ErrorManager.Severity.ERROR;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@ -7,14 +14,6 @@ import static org.junit.Assert.assertTrue;
import static sexpression.Nil.NIL;
import static testutil.TestUtilities.evaluateString;
import org.junit.Test;
import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import function.builtin.SYMBOL_FUNCTION.UndefinedSymbolFunctionException;
import testutil.SymbolAndFunctionCleaner;
public class SYMBOL_FUNCTIONTest extends SymbolAndFunctionCleaner {
@Test

View File

@ -1,17 +1,16 @@
package function.builtin.cons;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TestUtilities.parseString;
import org.junit.Test;
import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.DottedArgumentListException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import org.junit.Test;
import testutil.SymbolAndFunctionCleaner;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TestUtilities.parseString;
public class APPENDTest extends SymbolAndFunctionCleaner {
@Test

Some files were not shown because too many files have changed in this diff Show More