Remove wildcard imports

This commit is contained in:
Mike Cifelli 2017-11-12 09:42:25 -05:00
parent 3ebd5d49a9
commit 7de348d759
148 changed files with 893 additions and 314 deletions

View File

@ -1,6 +1,7 @@
package environment;
import java.io.*;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.function.Function;
import error.ErrorManager;

View File

@ -1,6 +1,7 @@
package error;
import static error.ErrorManager.Severity.*;
import static error.ErrorManager.Severity.CRITICAL;
import static error.ErrorManager.Severity.WARNING;
import static java.text.MessageFormat.format;
import java.io.PrintStream;

View File

@ -6,7 +6,9 @@ import static java.text.MessageFormat.format;
import java.math.BigInteger;
import error.LispException;
import sexpression.*;
import sexpression.Cons;
import sexpression.DisplayName;
import sexpression.SExpression;
public class ArgumentValidator {

View File

@ -1,6 +1,9 @@
package function;
import java.lang.annotation.*;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)

View File

@ -1,6 +1,7 @@
package function;
import sexpression.*;
import sexpression.Cons;
import sexpression.SExpression;
public abstract class LispFunction {

View File

@ -7,8 +7,11 @@ import static sexpression.Nil.NIL;
import java.util.ArrayList;
import error.LispException;
import sexpression.*;
import table.*;
import sexpression.Cons;
import sexpression.SExpression;
import sexpression.Symbol;
import table.ExecutionContext;
import table.SymbolTable;
public class UserDefinedFunction extends LispFunction {

View File

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

View File

@ -5,7 +5,11 @@ import static sexpression.Nil.NIL;
import error.LispException;
import function.ArgumentValidator;
import sexpression.*;
import sexpression.AtSignExpression;
import sexpression.BackquoteExpression;
import sexpression.CommaExpression;
import sexpression.Cons;
import sexpression.SExpression;
class BackquoteEvaluator {

View File

@ -1,15 +1,22 @@
package function.builtin;
import static function.builtin.cons.LIST.makeList;
import static function.builtin.special.LAMBDA.*;
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.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.BackquoteExpression;
import sexpression.Cons;
import sexpression.LambdaExpression;
import sexpression.SExpression;
import sexpression.Symbol;
import table.ExecutionContext;
@FunctionNames({ "EVAL" })

View File

@ -3,8 +3,11 @@ package function.builtin;
import static sexpression.Nil.NIL;
import environment.RuntimeEnvironment;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
@FunctionNames({ "EXIT" })
public class EXIT extends LispFunction {

View File

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

View File

@ -2,8 +2,12 @@ package function.builtin;
import java.math.BigInteger;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
import sexpression.Symbol;
@FunctionNames({ "GENSYM" })
public class GENSYM extends LispFunction {

View File

@ -6,14 +6,20 @@ import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import static util.Path.getPathPrefix;
import java.io.*;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Stack;
import environment.RuntimeEnvironment;
import error.*;
import function.*;
import error.LispException;
import error.LispWarning;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import parser.LispParser;
import sexpression.*;
import sexpression.Cons;
import sexpression.LispString;
import sexpression.SExpression;
@FunctionNames({ "LOAD" })
public class LOAD extends LispFunction {

View File

@ -1,8 +1,11 @@
package function.builtin;
import environment.RuntimeEnvironment;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
@FunctionNames({ "PRINT" })
public class PRINT extends LispFunction {

View File

@ -2,9 +2,14 @@ package function.builtin;
import static table.FunctionTable.lookupFunction;
import function.*;
import sexpression.*;
import table.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
import sexpression.Symbol;
import table.ExecutionContext;
import table.SymbolTable;
@FunctionNames({ "SET" })
public class SET extends LispFunction {

View File

@ -4,8 +4,14 @@ import static java.text.MessageFormat.format;
import static table.FunctionTable.lookupFunction;
import error.LispException;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import function.LispSpecialFunction;
import function.UserDefinedFunction;
import sexpression.Cons;
import sexpression.SExpression;
import sexpression.Symbol;
@FunctionNames({ "SYMBOL-FUNCTION" })
public class SYMBOL_FUNCTION extends LispFunction {

View File

@ -1,7 +1,10 @@
package function.builtin.cons;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
@FunctionNames({ "CONS" })
public class CONS extends LispFunction {

View File

@ -1,7 +1,10 @@
package function.builtin.cons;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
@FunctionNames({ "FIRST", "CAR" })
public class FIRST extends LispFunction {

View File

@ -4,8 +4,11 @@ import static function.builtin.cons.LIST.makeList;
import java.math.BigInteger;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.LispNumber;
@FunctionNames({ "LENGTH" })
public class LENGTH extends LispFunction {

View File

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

View File

@ -1,7 +1,10 @@
package function.builtin.cons;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.SExpression;
@FunctionNames({ "REST", "CDR" })
public class REST extends LispFunction {

View File

@ -2,8 +2,11 @@ package function.builtin.math;
import java.math.BigInteger;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.LispNumber;
@FunctionNames({ "/" })
public class DIVIDE extends LispFunction {

View File

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

View File

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

View File

@ -1,8 +1,11 @@
package function.builtin.math;
import java.util.function.*;
import java.util.function.BiFunction;
import java.util.function.Function;
import sexpression.*;
import sexpression.Cons;
import sexpression.LispNumber;
import sexpression.SExpression;
class MathFunction {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,8 +3,12 @@ package function.builtin.predicate;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.LispNumber;
import sexpression.SExpression;
@FunctionNames({ "=" })
public class NUMERIC_EQUAL extends LispFunction {

View File

@ -3,8 +3,12 @@ package function.builtin.predicate;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.LispNumber;
import sexpression.SExpression;
@FunctionNames({ ">" })
public class NUMERIC_GREATER extends LispFunction {

View File

@ -3,8 +3,12 @@ package function.builtin.predicate;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispFunction;
import sexpression.Cons;
import sexpression.LispNumber;
import sexpression.SExpression;
@FunctionNames({ "<" })
public class NUMERIC_LESS extends LispFunction {

View File

@ -3,8 +3,11 @@ package function.builtin.special;
import static function.builtin.EVAL.eval;
import static sexpression.Symbol.T;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
import sexpression.Cons;
import sexpression.SExpression;
@FunctionNames({ "AND" })
public class AND extends LispSpecialFunction {

View File

@ -5,8 +5,12 @@ import static function.builtin.predicate.EQUAL.isEqual;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
import sexpression.Cons;
import sexpression.Nil;
import sexpression.SExpression;
@FunctionNames({ "CASE" })
public class CASE extends LispSpecialFunction {

View File

@ -3,8 +3,12 @@ package function.builtin.special;
import static function.builtin.EVAL.eval;
import static sexpression.Nil.NIL;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
import sexpression.Cons;
import sexpression.Nil;
import sexpression.SExpression;
@FunctionNames({ "COND" })
public class COND extends LispSpecialFunction {

View File

@ -1,7 +1,10 @@
package function.builtin.special;
import function.*;
import sexpression.*;
import function.FunctionNames;
import function.UserDefinedFunction;
import function.UserDefinedSpecialFunction;
import sexpression.Cons;
import sexpression.SExpression;
@FunctionNames({ "DEFINE-SPECIAL" })
public class DEFINE_SPECIAL extends Define {

View File

@ -1,7 +1,10 @@
package function.builtin.special;
import function.*;
import sexpression.*;
import function.FunctionNames;
import function.UserDefinedFunction;
import function.UserDefinedMacro;
import sexpression.Cons;
import sexpression.SExpression;
@FunctionNames({ "DEFMACRO" })
public class DEFMACRO extends Define {

View File

@ -1,7 +1,9 @@
package function.builtin.special;
import function.*;
import sexpression.*;
import function.FunctionNames;
import function.UserDefinedFunction;
import sexpression.Cons;
import sexpression.SExpression;
@FunctionNames({ "DEFUN" })
public class DEFUN extends Define {

View File

@ -2,12 +2,17 @@ package function.builtin.special;
import static function.builtin.cons.LIST.makeList;
import static java.text.MessageFormat.format;
import static table.FunctionTable.*;
import static table.FunctionTable.defineFunction;
import static table.FunctionTable.isAlreadyDefined;
import environment.RuntimeEnvironment;
import error.LispWarning;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.LispSpecialFunction;
import function.UserDefinedFunction;
import sexpression.Cons;
import sexpression.SExpression;
import sexpression.Symbol;
public abstract class Define extends LispSpecialFunction {

View File

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

View File

@ -2,8 +2,14 @@ package function.builtin.special;
import static function.builtin.cons.LIST.makeList;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
import function.UserDefinedFunction;
import sexpression.Cons;
import sexpression.LambdaExpression;
import sexpression.SExpression;
import sexpression.Symbol;
@FunctionNames({ "LAMBDA" })
public class LAMBDA extends LispSpecialFunction {

View File

@ -3,9 +3,14 @@ package function.builtin.special;
import static function.builtin.EVAL.eval;
import static sexpression.Nil.NIL;
import function.*;
import sexpression.*;
import table.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
import sexpression.Cons;
import sexpression.SExpression;
import sexpression.Symbol;
import table.ExecutionContext;
import table.SymbolTable;
@FunctionNames({ "LET" })
public class LET extends LispSpecialFunction {

View File

@ -2,8 +2,11 @@ package function.builtin.special;
import static function.builtin.EVAL.eval;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
import sexpression.Cons;
import sexpression.SExpression;
@FunctionNames({ "OR" })
public class OR extends LispSpecialFunction {

View File

@ -3,8 +3,11 @@ package function.builtin.special;
import static function.builtin.EVAL.eval;
import static sexpression.Nil.NIL;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
import sexpression.Cons;
import sexpression.SExpression;
@FunctionNames({ "PROGN", "BEGIN" })
public class PROGN extends LispSpecialFunction {

View File

@ -1,7 +1,10 @@
package function.builtin.special;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
import sexpression.Cons;
import sexpression.SExpression;
@FunctionNames({ "QUOTE" })
public class QUOTE extends LispSpecialFunction {

View File

@ -4,8 +4,12 @@ import static function.builtin.EVAL.eval;
import static function.builtin.SET.set;
import static function.builtin.cons.LIST.makeList;
import function.*;
import sexpression.*;
import function.ArgumentValidator;
import function.FunctionNames;
import function.LispSpecialFunction;
import sexpression.Cons;
import sexpression.SExpression;
import sexpression.Symbol;
@FunctionNames({ "SETQ" })
public class SETQ extends LispSpecialFunction {

View File

@ -1,6 +1,7 @@
package interpreter;
import java.io.*;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.function.Function;
public interface LispInterpreterBuilder {

View File

@ -2,11 +2,15 @@ package interpreter;
import static util.Path.getPathPrefix;
import java.io.*;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.function.Function;
import environment.RuntimeEnvironment;
import error.*;
import error.CriticalLispException;
import error.ErrorManager;
public class LispInterpreterBuilderImpl implements LispInterpreterBuilder {

View File

@ -3,14 +3,22 @@ package main;
import static com.googlecode.lanterna.terminal.IOSafeTerminalAdapter.createRuntimeExceptionConvertingAdapter;
import static terminal.LispTerminal.END_OF_SEGMENT;
import java.io.*;
import java.io.IOException;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.io.PrintStream;
import java.util.function.Function;
import com.googlecode.lanterna.terminal.*;
import com.googlecode.lanterna.terminal.DefaultTerminalFactory;
import com.googlecode.lanterna.terminal.IOSafeTerminal;
import com.googlecode.lanterna.terminal.Terminal;
import interpreter.*;
import interpreter.LispInterpreter;
import interpreter.LispInterpreterBuilder;
import interpreter.LispInterpreterBuilderImpl;
import stream.UncheckedIOException;
import terminal.*;
import terminal.LispTerminal;
import terminal.TerminalConfiguration;
public class LispMain {

View File

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

View File

@ -1,6 +1,10 @@
package scanner;
import static util.Characters.*;
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;

View File

@ -1,14 +1,23 @@
package scanner;
import static java.lang.Character.*;
import static util.Characters.*;
import static java.lang.Character.isDigit;
import static java.lang.Character.isWhitespace;
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.isLegalIdentifierCharacter;
import static util.Characters.isNumberPrefix;
import java.io.InputStream;
import java.util.function.Function;
import error.LineColumnException;
import file.*;
import token.*;
import file.FilePosition;
import file.FilePositionTracker;
import token.Token;
import token.TokenFactory;
import token.TokenFactoryImpl;
import util.Characters;
/**

View File

@ -1,6 +1,9 @@
package sexpression;
import java.lang.annotation.*;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)

View File

@ -1,6 +1,7 @@
package stream;
import java.io.*;
import java.io.IOException;
import java.io.InputStream;
public class SafeInputStream {

View File

@ -1,6 +1,7 @@
package stream;
import java.io.*;
import java.io.IOException;
import java.io.OutputStream;
public class SafeOutputStream {

View File

@ -2,15 +2,55 @@ package table;
import static java.text.MessageFormat.format;
import java.util.*;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import error.CriticalLispException;
import function.*;
import function.builtin.*;
import function.builtin.cons.*;
import function.builtin.math.*;
import function.builtin.predicate.*;
import function.builtin.special.*;
import function.FunctionNames;
import function.LispFunction;
import function.builtin.APPLY;
import function.builtin.EVAL;
import function.builtin.EXIT;
import function.builtin.FUNCALL;
import function.builtin.GENSYM;
import function.builtin.LOAD;
import function.builtin.PRINT;
import function.builtin.SET;
import function.builtin.SYMBOL_FUNCTION;
import function.builtin.cons.CONS;
import function.builtin.cons.FIRST;
import function.builtin.cons.LENGTH;
import function.builtin.cons.LIST;
import function.builtin.cons.REST;
import function.builtin.math.DIVIDE;
import function.builtin.math.MINUS;
import function.builtin.math.MULTIPLY;
import function.builtin.math.PLUS;
import function.builtin.predicate.ATOM;
import function.builtin.predicate.EQ;
import function.builtin.predicate.EQUAL;
import function.builtin.predicate.GENSYM_EQUAL;
import function.builtin.predicate.LISTP;
import function.builtin.predicate.NULL;
import function.builtin.predicate.NUMERIC_EQUAL;
import function.builtin.predicate.NUMERIC_GREATER;
import function.builtin.predicate.NUMERIC_LESS;
import function.builtin.special.AND;
import function.builtin.special.CASE;
import function.builtin.special.COND;
import function.builtin.special.DEFINE_SPECIAL;
import function.builtin.special.DEFMACRO;
import function.builtin.special.DEFUN;
import function.builtin.special.IF;
import function.builtin.special.LAMBDA;
import function.builtin.special.LET;
import function.builtin.special.LET_STAR;
import function.builtin.special.OR;
import function.builtin.special.PROGN;
import function.builtin.special.QUOTE;
import function.builtin.special.SETQ;
public class FunctionTable {

View File

@ -1,7 +1,9 @@
package terminal;
import static java.lang.Character.isDigit;
import static util.Characters.*;
import static util.Characters.EOF;
import static util.Characters.LEFT_SQUARE_BRACKET;
import static util.Characters.UNICODE_ESCAPE;
import stream.SafeInputStream;

View File

@ -2,7 +2,8 @@ package terminal;
import static terminal.SelectGraphicRendition.SGR_COMMAND;
import java.util.*;
import java.util.HashMap;
import java.util.Map;
import terminal.ControlSequence.NullControlSequence;

View File

@ -1,18 +1,29 @@
package terminal;
import static com.googlecode.lanterna.input.KeyType.*;
import static com.googlecode.lanterna.input.KeyType.ArrowDown;
import static com.googlecode.lanterna.input.KeyType.ArrowLeft;
import static com.googlecode.lanterna.input.KeyType.ArrowRight;
import static com.googlecode.lanterna.input.KeyType.ArrowUp;
import static com.googlecode.lanterna.input.KeyType.Backspace;
import static com.googlecode.lanterna.input.KeyType.Character;
import static com.googlecode.lanterna.input.KeyType.Delete;
import static com.googlecode.lanterna.input.KeyType.Enter;
import static terminal.ControlSequenceHandler.isEscape;
import static util.Characters.EOF;
import static util.Characters.UNICODE_NULL;
import java.io.ByteArrayInputStream;
import java.util.concurrent.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.googlecode.lanterna.*;
import com.googlecode.lanterna.input.*;
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.*;
import stream.SafeInputStream;
import stream.SafeOutputStream;
public class LispTerminal {

View File

@ -1,6 +1,8 @@
package terminal;
import java.io.*;
import java.io.IOException;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import com.googlecode.lanterna.terminal.IOSafeTerminal;

View File

@ -1,6 +1,7 @@
package terminal;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
public class TerminalHistory {

View File

@ -3,7 +3,8 @@ package token;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.*;
import sexpression.AtSignExpression;
import sexpression.SExpression;
public class AtSign extends Token {

View File

@ -3,7 +3,8 @@ package token;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.*;
import sexpression.BackquoteExpression;
import sexpression.SExpression;
public class Backquote extends Token {

View File

@ -3,7 +3,8 @@ package token;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.*;
import sexpression.CommaExpression;
import sexpression.SExpression;
public class Comma extends Token {

View File

@ -3,7 +3,8 @@ package token;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.*;
import sexpression.SExpression;
import sexpression.Symbol;
public class Identifier extends Token {

View File

@ -3,7 +3,8 @@ package token;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.*;
import sexpression.LispNumber;
import sexpression.SExpression;
public class Number extends Token {

View File

@ -5,7 +5,9 @@ import static sexpression.Nil.NIL;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.*;
import sexpression.Cons;
import sexpression.SExpression;
import sexpression.Symbol;
public class QuoteMark extends Token {

View File

@ -3,7 +3,8 @@ package token;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.*;
import sexpression.LispString;
import sexpression.SExpression;
public class QuotedString extends Token {

View File

@ -3,7 +3,8 @@ package token;
import java.util.function.Supplier;
import file.FilePosition;
import sexpression.*;
import sexpression.Cons;
import sexpression.SExpression;
public abstract class Token {

View File

@ -2,7 +2,8 @@ package token;
import static java.text.MessageFormat.format;
import error.*;
import error.CriticalLineColumnException;
import error.LineColumnException;
import file.FilePosition;
public interface TokenFactory {

View File

@ -1,7 +1,15 @@
package token;
import static java.lang.Character.isDigit;
import static util.Characters.*;
import static util.Characters.AT_SIGN;
import static util.Characters.BACKQUOTE;
import static util.Characters.COMMA;
import static util.Characters.DOUBLE_QUOTE;
import static util.Characters.LEFT_PARENTHESIS;
import static util.Characters.RIGHT_PARENTHESIS;
import static util.Characters.SINGLE_QUOTE;
import static util.Characters.isLegalIdentifierCharacter;
import static util.Characters.isNumberPrefix;
import file.FilePosition;

View File

@ -1,6 +1,7 @@
package util;
import java.util.*;
import java.util.HashSet;
import java.util.Set;
public final class Characters {

View File

@ -3,10 +3,16 @@ package acceptance.fixture;
import static table.FunctionTable.resetFunctionTable;
import static util.Path.getPathPrefix;
import java.io.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import environment.RuntimeEnvironment;
import interpreter.*;
import interpreter.LispInterpreter;
import interpreter.LispInterpreterBuilder;
import interpreter.LispInterpreterBuilderImpl;
import table.ExecutionContext;
public class LispInterpreterFixture {

View File

@ -1,10 +1,16 @@
package environment;
import static org.junit.Assert.*;
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.*;
import java.util.HashSet;
import java.util.Set;
import org.junit.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import error.ErrorManager;

View File

@ -1,12 +1,19 @@
package error;
import static error.ErrorManager.Severity.*;
import static org.junit.Assert.*;
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 java.io.*;
import java.util.*;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Set;
import org.junit.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import environment.RuntimeEnvironment;
import error.ErrorManager.Severity;

View File

@ -4,7 +4,8 @@ import static org.junit.Assert.assertTrue;
import java.util.Objects;
import org.junit.*;
import org.junit.Before;
import org.junit.Test;
public class FilePositionTrackerTest {

View File

@ -1,14 +1,24 @@
package function;
import static error.ErrorManager.Severity.ERROR;
import static org.junit.Assert.*;
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 sexpression.Symbol.T;
import org.junit.*;
import org.junit.Before;
import org.junit.Test;
import function.ArgumentValidator.*;
import sexpression.*;
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 {

View File

@ -4,7 +4,8 @@ import static org.junit.Assert.assertTrue;
import org.junit.Test;
import sexpression.*;
import sexpression.Cons;
import sexpression.SExpression;
public class LispFunctionTest {

View File

@ -4,7 +4,8 @@ import static org.junit.Assert.assertFalse;
import org.junit.Test;
import sexpression.*;
import sexpression.Cons;
import sexpression.SExpression;
public class LispSpecialFunctionTest {

View File

@ -1,15 +1,21 @@
package function;
import static org.junit.Assert.*;
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.*;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import function.UserDefinedFunction.IllegalKeywordRestPositionException;
import sexpression.*;
import sexpression.Cons;
import sexpression.LispNumber;
import sexpression.SExpression;
import sexpression.Symbol;
public class UserDefinedFunctionTest {

View File

@ -1,11 +1,16 @@
package function.builtin;
import static function.builtin.APPLY.apply;
import static testutil.TestUtilities.*;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TestUtilities.parseString;
import org.junit.Test;
import function.ArgumentValidator.*;
import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.DottedArgumentListException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import function.builtin.EVAL.UndefinedFunctionException;
import sexpression.Cons;
import testutil.SymbolAndFunctionCleaner;

View File

@ -2,13 +2,25 @@ package function.builtin;
import static sexpression.Nil.NIL;
import static sexpression.Symbol.T;
import static testutil.TestUtilities.*;
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.*;
import sexpression.*;
import function.builtin.BackquoteEvaluator.AtSignNotInCommaException;
import function.builtin.BackquoteEvaluator.AtSignNotListException;
import function.builtin.BackquoteEvaluator.NestedAtSignException;
import function.builtin.BackquoteEvaluator.NestedCommaException;
import sexpression.AtSignExpression;
import sexpression.BackquoteExpression;
import sexpression.CommaExpression;
import sexpression.Cons;
import sexpression.LispNumber;
import sexpression.LispString;
import sexpression.SExpression;
import sexpression.Symbol;
public class BackquoteEvaluatorTest {

View File

@ -3,13 +3,21 @@ package function.builtin;
import static function.builtin.EVAL.lookupSymbol;
import static org.junit.Assert.assertNull;
import static sexpression.Nil.NIL;
import static testutil.TestUtilities.*;
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.*;
import function.ArgumentValidator.DottedArgumentListException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import function.builtin.BackquoteEvaluator.AtSignNotInCommaException;
import function.builtin.EVAL.*;
import function.builtin.EVAL.UndefinedFunctionException;
import function.builtin.EVAL.UndefinedSymbolException;
import function.builtin.EVAL.UnmatchedAtSignException;
import function.builtin.EVAL.UnmatchedCommaException;
import testutil.SymbolAndFunctionCleaner;
public class EVALTest extends SymbolAndFunctionCleaner {

View File

@ -1,9 +1,11 @@
package function.builtin;
import static org.junit.Assert.*;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static testutil.TestUtilities.evaluateString;
import java.util.*;
import java.util.HashSet;
import java.util.Set;
import org.junit.Test;

View File

@ -1,6 +1,8 @@
package function.builtin;
import static testutil.TestUtilities.*;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TestUtilities.parseString;
import org.junit.Test;

View File

@ -1,7 +1,9 @@
package function.builtin;
import static function.builtin.GENSYM.GENSYM_PREFIX;
import static testutil.TestUtilities.*;
import static testutil.TestUtilities.assertSExpressionsDoNotMatch;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TypeAssertions.assertSymbol;
import org.junit.Test;

View File

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

View File

@ -4,12 +4,14 @@ import static java.text.MessageFormat.format;
import static org.junit.Assert.assertEquals;
import static testutil.TestUtilities.evaluateString;
import java.io.*;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.junit.Test;
import environment.RuntimeEnvironment;
import function.ArgumentValidator.*;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import testutil.SymbolAndFunctionCleaner;
public class PRINTTest extends SymbolAndFunctionCleaner {

View File

@ -1,11 +1,14 @@
package function.builtin;
import static org.junit.Assert.assertNull;
import static testutil.TestUtilities.*;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import org.junit.Test;
import function.ArgumentValidator.*;
import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import function.builtin.EVAL.UndefinedSymbolException;
import sexpression.LispNumber;
import table.SymbolTable;

View File

@ -1,13 +1,17 @@
package function.builtin;
import static error.ErrorManager.Severity.ERROR;
import static org.junit.Assert.*;
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.evaluateString;
import org.junit.Test;
import function.ArgumentValidator.*;
import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import function.builtin.SYMBOL_FUNCTION.UndefinedSymbolFunctionException;
import testutil.SymbolAndFunctionCleaner;

View File

@ -1,11 +1,15 @@
package function.builtin.cons;
import static testutil.TestUtilities.*;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TestUtilities.parseString;
import org.junit.Test;
import function.ArgumentValidator.*;
import sexpression.*;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import sexpression.Cons;
import sexpression.Symbol;
import testutil.SymbolAndFunctionCleaner;
public class CONSTest extends SymbolAndFunctionCleaner {

View File

@ -1,10 +1,14 @@
package function.builtin.cons;
import static testutil.TestUtilities.*;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TestUtilities.parseString;
import org.junit.Test;
import function.ArgumentValidator.*;
import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import testutil.SymbolAndFunctionCleaner;
public class FIRSTTest extends SymbolAndFunctionCleaner {

View File

@ -1,10 +1,14 @@
package function.builtin.cons;
import static testutil.TestUtilities.*;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TestUtilities.parseString;
import org.junit.Test;
import function.ArgumentValidator.*;
import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import testutil.SymbolAndFunctionCleaner;
public class LENGTHTest extends SymbolAndFunctionCleaner {

View File

@ -1,7 +1,9 @@
package function.builtin.cons;
import static function.builtin.cons.LIST.makeList;
import static testutil.TestUtilities.*;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TestUtilities.parseString;
import org.junit.Test;

View File

@ -1,10 +1,14 @@
package function.builtin.cons;
import static testutil.TestUtilities.*;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import static testutil.TestUtilities.parseString;
import org.junit.Test;
import function.ArgumentValidator.*;
import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.TooFewArgumentsException;
import function.ArgumentValidator.TooManyArgumentsException;
import testutil.SymbolAndFunctionCleaner;
public class RESTTest extends SymbolAndFunctionCleaner {

View File

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

View File

@ -1,10 +1,12 @@
package function.builtin.math;
import static testutil.TestUtilities.*;
import static testutil.TestUtilities.assertSExpressionsMatch;
import static testutil.TestUtilities.evaluateString;
import org.junit.Test;
import function.ArgumentValidator.*;
import function.ArgumentValidator.BadArgumentTypeException;
import function.ArgumentValidator.TooFewArgumentsException;
import sexpression.LispNumber;
import testutil.SymbolAndFunctionCleaner;

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