Commit Graph

252 Commits

Author SHA1 Message Date
Mike Cifelli efb0329fda Implement TCO for cons cell toString 2017-11-12 16:40:49 -05:00
Mike Cifelli e8e9d2e12d Update formatter settings 2017-11-12 13:46:15 -05:00
Mike Cifelli 6cd5fb66a4 Implement TCO for the length function 2017-11-12 13:27:04 -05:00
Mike Cifelli 7de348d759 Remove wildcard imports 2017-11-12 09:42:25 -05:00
Mike Cifelli 84ccac0edb Improve interpreter performance slightly 2017-04-13 09:07:30 -04:00
Mike Cifelli 63fd890ac6 Add history feature to the terminal
The history is accessed through the up/down arrow keys.

Resolves #8
2017-04-04 15:37:57 -04:00
Mike Cifelli 243f8a83ac Add terminal history class 2017-04-04 07:56:35 -04:00
Mike Cifelli eb82a25f64 Increase test coverage 2017-03-24 09:29:19 -04:00
Mike Cifelli 111dd06d6f Add unit tests 2017-03-23 18:48:37 -04:00
Mike Cifelli 52762a6152 Add and refactor unit tests 2017-03-23 16:14:26 -04:00
Mike Cifelli 23dd1c0654 Increase test coverage and refactor code 2017-03-23 12:14:44 -04:00
Mike Cifelli 79fb8b633b Fix output interfering with input
Refactored some code
2017-03-22 15:26:00 -04:00
Mike Cifelli 228b4b1793 Refactor stream code and add unit tests 2017-03-22 14:08:22 -04:00
Mike Cifelli b298e118e3 Add colors to the interactive interpreter 2017-03-22 11:26:53 -04:00
Mike Cifelli 058e937c3e Refactor main interpreter code
Fixed several minor issues

Only print the last value when interpreting a file

Resolves #4
2017-03-21 15:03:16 -04:00
Mike Cifelli 5cb6212d2a Fix terminal resize issues 2017-03-21 12:07:22 -04:00
Mike Cifelli a8eff1ad70 Clean up terminal code 2017-03-21 09:25:40 -04:00
Mike Cifelli fc96894d14 Fix text insertion at the end of the buffer 2017-03-20 16:20:28 -04:00
Mike Cifelli 38710e21bf Improve terminal performance 2017-03-20 11:18:36 -04:00
Mike Cifelli cef7be6c25 Add comments to broken code 2017-03-19 17:32:44 -04:00
Mike Cifelli ad173d06a9 Fix issues when input pushes past end of buffer
A few issues still remain:

- Inserting text pushes the remainder of the input to a new line
  at the end of the buffer.

- Resizing the terminal height causes numerous issues.
2017-03-19 17:17:34 -04:00
Mike Cifelli 38ab1144fb Clean up terminal code and unit tests
The terminal unit tests were updated so that they don't rely on an
arbitrary delay.
2017-03-19 12:54:35 -04:00
Mike Cifelli 072a432026 Hide cursor when printing output 2017-03-18 16:55:35 -04:00
Mike Cifelli 31ca72e534 Add a crude interactive terminal implementation 2017-03-18 16:49:46 -04:00
Mike Cifelli 462673ba64 Add line wrapping support to the terminal 2017-03-17 19:40:56 -04:00
Mike Cifelli c533b7c1d9 Start experimenting with lanterna 2017-03-17 16:07:25 -04:00
Mike Cifelli a21114ac7c Add a GENSYM-EQUAL function for unit testing macros
Some macro definitions were refactored along with their associated
unit tests.
2017-03-13 14:43:31 -04:00
Mike Cifelli f2a481952d Add @Override annotations and clean up code 2017-03-13 09:58:30 -04:00
Mike Cifelli c2d722d5ab Fix nested comma handling in a backquote 2017-03-12 14:18:37 -04:00
Mike Cifelli e89a6f2dde Add unit tests for the backquote facility
Renamed BackTick to Backquote globally.
2017-03-12 12:19:45 -04:00
Mike Cifelli 698305f07f Add the backtick facility
Resolves #20
2017-03-11 15:41:07 -05:00
Mike Cifelli 655f49e612 Add DEFMACRO special function
Resolves #16
2017-03-10 15:08:42 -05:00
Mike Cifelli 16b9a4dd30 Add a simple GENSYM function
Resolves #18
2017-03-10 13:19:09 -05:00
Mike Cifelli e78e18df98 Add a simple GENSYM function 2017-03-10 13:14:16 -05:00
Mike Cifelli 87eb0204f5 Remove SETF function 2017-03-07 16:41:26 -05:00
Mike Cifelli 736e230de9 Add LET* special function 2017-03-07 13:26:24 -05:00
Mike Cifelli d1060a8aad Add aliases for several functions 2017-03-07 13:15:40 -05:00
Mike Cifelli 5f10396af8 Use function alias in validation messages
Resolves #9
2017-03-07 10:59:51 -05:00
Mike Cifelli 368f22a02b Rename the project 2017-03-07 10:20:22 -05:00
Mike Cifelli 77a341a1a7 Add more advanced lisp objects
Added a class to compute compound interest.

An alias for FUNCALL has been added: CALL

Refactored some acceptance tests to load code from files.
2017-03-06 16:52:06 -05:00
Mike Cifelli aa13394548 Add ability to run acceptance tests on files 2017-03-06 12:44:06 -05:00
Mike Cifelli 8a719c8e44 Add unit test for LOAD 2017-03-05 10:41:49 -05:00
Mike Cifelli 04cb46e94d Store the base directory for an interpreted files
A bug was resolved where some functions were getting a null
ErrorManager.

A reset funtion was added to RuntimeEnvironment.

Resolves #15
2017-03-05 10:20:31 -05:00
Mike Cifelli 946af24514 Minor cleanup of LIST 2017-03-03 15:57:16 -05:00
Mike Cifelli 311a3b4036 Cleaned up code and tests 2017-03-03 15:06:49 -05:00
Mike Cifelli 503b19a5e1 Resolves #14 - Load now keeps track of directories 2017-03-03 12:56:06 -05:00
Mike Cifelli 0eb8db36a8 Acceptance tests now run with JUnit 2017-03-02 15:26:21 -05:00
Mike Cifelli d55ebdd22f Resolves #13 - Exclusion based on type in ArgumentValidator 2017-03-02 11:39:07 -05:00
Mike Cifelli ef4c03a672 Expanded dlambda example 2017-03-02 10:29:59 -05:00
Mike Cifelli 2bd0c1a674 Major Refactor - Static constants and test case names 2017-03-02 09:54:23 -05:00
Mike Cifelli 64e18fe076 Resolves #12 - &rest keyword added to lambda lists
Added unit tests and cleaned up some code
The setup for acceptance tests now cleans up the environment
2017-03-01 11:11:59 -05:00
Mike Cifelli 42191ec69d Parts of CASE and COND were refactored
Updated the terminology used in the code
Added test cases
Changed the format of error/warning messages
2017-02-28 16:16:43 -05:00
Mike Cifelli ab17d4c60e Static method in SET has been refactored 2017-02-28 15:04:40 -05:00
Mike Cifelli 05f75b627b Resolves #11 - The CASE special function has been added
Refactored some unit tests
2017-02-28 15:01:05 -05:00
Mike Cifelli 544df91c27 Simplified the EQUAL function logic 2017-02-28 12:26:18 -05:00
Mike Cifelli d2dfe23083 Resolves #10 - The equality predicates have been refactored 2017-02-28 11:54:19 -05:00
Mike Cifelli 50a3f3be67 Resolves #6 - PROGN Special Function (Form) 2017-02-27 15:36:17 -05:00
Mike Cifelli 5129f6c17b Minor cleanup in SYMBOL-FUNCTION 2017-02-27 14:54:31 -05:00
Mike Cifelli d3e3f52e59 Altered SYMBOL-FUNCTION behavior and cleaned up some code 2017-02-27 14:10:20 -05:00
Mike Cifelli fb35884479 Resolves #7 - Allow prefixing of numbers 2017-02-27 13:34:04 -05:00
Mike Cifelli bf40feadec User defined functions now set up their scope correctly 2017-02-27 12:00:24 -05:00
Mike Cifelli 462e5ea15e Built-in function names are now defined through annotations 2017-02-26 16:47:06 -05:00
Mike Cifelli 8fdaaeb23d Removed duplicate code in SET and SETF 2017-02-26 13:01:47 -05:00
Mike Cifelli 49e145d098 Cleaned up some code 2017-02-26 12:39:08 -05:00
Mike Cifelli e51d275b76 Started added unit tests for the interpreter and main packages 2017-02-26 12:31:27 -05:00
Mike Cifelli 78c7bf4d9c Added DEFINE-MACRO for user defined special functions (forms) 2017-02-25 19:11:31 -05:00
Mike Cifelli 4f4bc8f71a Added special functions (forms) and refactored internal s-expression predicates 2017-02-25 17:29:37 -05:00
Mike Cifelli b9466d2c5d Cleaned up a parameter name 2017-02-24 16:09:54 -05:00
Mike Cifelli c83db3721c Finished changing car/cdr to first/rest in the code 2017-02-24 16:00:05 -05:00
Mike Cifelli 0855789fde Started changing car/cdr to first/rest, modified acceptance test fixture 2017-02-24 11:07:06 -05:00
Mike Cifelli 8cd813ed14 Formatted a source file 2017-02-22 14:38:32 -05:00
Mike Cifelli 6f2802828d Resolves #5 - Added FitNesse to the project 2017-02-22 14:11:40 -05:00
Mike Cifelli 013707e11a Static import of 'eval' 2017-02-21 13:59:56 -05:00
Mike Cifelli 0c3d3ae024 Resolves #1 - Added the IF Special Form 2017-02-21 12:35:47 -05:00
Mike Cifelli b3ae5c9122 Added decorators for output text 2017-02-11 13:33:34 -05:00
Mike Cifelli ce1547d71a Formatted and cleaned some code 2017-02-11 10:51:37 -05:00
Mike Cifelli 6fa132313d Refactored error severity 2017-02-11 10:42:07 -05:00
Mike Cifelli bdcb2227c9 Removed RuntimeExceptions and associated logic 2017-02-09 12:09:51 -05:00
Mike Cifelli 1a25ddc35f Refactored the lisp interpreter builder and some error handling 2017-02-09 11:00:23 -05:00
Mike Cifelli 65069561b8 Formatted LispInterpreterBuilderImpl 2017-02-06 13:47:05 -05:00
Mike Cifelli 993df541aa Organized imports in several files 2017-02-06 13:44:35 -05:00
Mike Cifelli b6d717ec1c Formatted several files 2017-02-06 13:43:27 -05:00
Mike Cifelli 913fd031c6 Only allow a single interpreter to be built
Renamed Environment to RuntimeEnvironment
2017-02-06 13:39:05 -05:00
Mike Cifelli 4719e14d7f Added unit tests for the FunctionTable and ExecutionContext 2017-02-06 12:02:19 -05:00
Mike Cifelli c2a373dc85 Added the following built-ins: AND & OR 2017-02-05 16:00:56 -05:00
Mike Cifelli a9a47be6cd Allow DEFUN and LAMBDA with an empty body 2017-02-04 15:38:47 -05:00
Mike Cifelli 0a5228d5a7 Update argument validation and added unit tests
Fixed some bugs in LET and LAMBDA

Refactored the code in UserDefinedFunction
2017-02-04 13:51:10 -05:00
Mike Cifelli d7ca5d09da Added unit tests and refactored the let form
Wrote a lisp program to calculate the number of bi-weekly paydays in a year
2017-02-04 12:03:31 -05:00
Mike Cifelli db2817f7be Refactored the symbol table code 2017-01-30 16:12:38 -05:00
Mike Cifelli d3fc8f9812 Refactored the function table logic 2017-01-29 14:33:46 -05:00
Mike Cifelli 5351168763 Started refactoring UserDefinedFunction 2017-01-27 16:19:09 -05:00
Mike Cifelli 27fdc7b328 Added unit tests and refactored lambda 2017-01-27 14:31:41 -05:00
Mike Cifelli 79648cd96f Added unit tests and refactored defun 2017-01-27 12:12:27 -05:00
Mike Cifelli 25f73e6d2e Added unit tests and refactored the load function 2017-01-26 15:58:15 -05:00
Mike Cifelli 919644d9c0 Added unit tests and refactored setf 2017-01-26 12:30:38 -05:00
Mike Cifelli 6ed24e85fe Removed an unused import 2017-01-22 11:13:17 -05:00
Mike Cifelli 1f0d312e7e Added unit tests for exit and symbol-function and refactored some code 2017-01-22 11:11:16 -05:00
Mike Cifelli ea8acd423f Refactored some code and added unit tests 2017-01-18 16:25:09 -05:00
Mike Cifelli b700b714f3 Minor update to the Environment class 2017-01-17 15:54:09 -05:00
Mike Cifelli a4cb521c7d Introduced global abstractions of input, output, and termination 2017-01-17 13:54:21 -05:00
Mike Cifelli 217c215efe Started major refactoring of several built in functions 2017-01-16 13:38:49 -05:00
Mike Cifelli 35ef281733 Refactored the built in function quote 2017-01-15 19:17:19 -05:00
Mike Cifelli 38db0862ff Added unit tests and refactored the length built in function 2017-01-15 14:23:46 -05:00
Mike Cifelli 4b75b13485 Refactored the code for math functions 2017-01-15 13:50:28 -05:00
Mike Cifelli 0560c02093 Re-organized the built in function classes 2017-01-14 18:01:14 -05:00
Mike Cifelli ba59b2a8cf Added more unit tests and refactored the code for several built in functions 2017-01-13 14:05:33 -05:00
Mike Cifelli e543de6f12 Refactored and added unit tests for listp 2017-01-13 12:52:05 -05:00
Mike Cifelli cdb32e3777 Added unit tests and refactored the code for the list function 2017-01-06 17:10:00 -05:00
Mike Cifelli 5cd037fc07 Added unit tests and refactored code 2017-01-05 18:00:21 -05:00
Mike Cifelli 3cb9d89616 Refactored more code and added unit tests for the built in functions 2017-01-04 13:57:16 -05:00
Mike Cifelli 9f80fc9abe Added unit tests and refactored the equal function 2016-12-30 10:22:25 -05:00
Mike Cifelli d0da7813bd Added more unit tests and refactored some built in functions 2016-12-29 13:32:45 -05:00
Mike Cifelli 4b0c4b44a7 Started conversion to BigInteger for numbers 2016-12-25 13:56:24 -05:00
Mike Cifelli 68510ec1a8 Started refactoring and writing unit tests for DEFUN 2016-12-25 13:29:06 -05:00
Mike Cifelli 37bc303fe8 Improved the argument list validation for COND 2016-12-25 12:49:18 -05:00
Mike Cifelli eb9f224c60 Refactored the COND built-in function 2016-12-24 13:16:03 -05:00
Mike Cifelli a0583f808c Added more unit tests for the built-in functions 2016-12-23 10:53:11 -05:00
Mike Cifelli 7de7996a27 Added function to the argument validator and refactored some code 2016-12-22 16:55:25 -05:00
Mike Cifelli 9bea0e6533 Started writing tests for the builtin functions 2016-12-22 10:32:48 -05:00
Mike Cifelli 715de2f220 Cleaned up some import statements 2016-12-21 14:42:45 -05:00
Mike Cifelli c4531b25e2 Added unit tests and did some refactoring 2016-12-20 12:03:37 -05:00
Mike Cifelli 089e3bd520 Refactored the eval package 2016-12-19 13:05:53 -05:00
Mike Cifelli fbd2b3207c Added an argument validator and unit tests 2016-12-19 11:38:14 -05:00
Mike Cifelli 5f2c3dc469 Refactored the interpreter and updated the build file 2016-12-17 10:19:18 -05:00
Mike Cifelli 064f905045 Performed some minor code cleanup 2016-12-16 14:15:29 -05:00
Mike Cifelli 6f4a319dab Refactored some of the exception classes. 2016-12-16 14:00:34 -05:00
Mike Cifelli a137e41a14 Cleaned up the ErrorManager and associated unit tests 2016-12-16 13:12:13 -05:00
Mike Cifelli 25c0b5813b Refactored the ErrorManager and added unit tests 2016-12-16 12:31:16 -05:00
Mike Cifelli 60a7eb562c Refactored some code and added unit tests 2016-12-16 11:26:53 -05:00
Mike Cifelli 62a509eb4b Minor cleaning in the eval pacakge, added unit tests for the sexpression package 2016-12-15 15:33:48 -05:00
Mike Cifelli 7b7556cc65 Started refactoring the sexpression package and cleaned up some unit test code 2016-12-15 11:19:03 -05:00
Mike Cifelli c4e3740dfb Refactored some of the error management code 2016-12-14 14:55:54 -05:00
Mike Cifelli ad2375e2bd Continued refactoring the LispParser and writing unit tests 2016-12-14 14:41:43 -05:00
Mike Cifelli 930c8137df Created a package for s-expressions and continued refactoring the parser 2016-12-14 13:09:41 -05:00
Mike Cifelli 10fdbf3b75 Added unit tests for the LispParser and started refactoring 2016-12-14 12:10:28 -05:00
Mike Cifelli 6b6f349c29 Added token classes and added unit tests 2016-12-12 10:15:20 -05:00
Mike Cifelli c02ef37f64 Added unit tests, refactored some code, and removed IOException references 2016-12-11 15:09:48 -05:00
Mike Cifelli f50b07842c Converted over to runtime exceptions 2016-12-11 11:23:44 -05:00
Mike Cifelli abdd89737f Refactored LispScanner and some unit tests 2016-12-11 10:12:59 -05:00
Mike Cifelli 0d406c3e36 More refactoring of the scanner package 2016-12-10 15:25:46 -05:00
Mike Cifelli a3a49a2084 Performed some minor cleaning 2016-12-10 12:06:14 -05:00
Mike Cifelli 89bb52ab71 Continued refactoring and adding unit tests 2016-12-10 11:57:49 -05:00
Mike Cifelli 1670a825e5 Added more unit tests and continued refactoring the scanner package 2016-12-09 16:04:38 -05:00
Mike Cifelli 9b3261f575 Added unit tests and started refactoring LispScanner 2016-12-09 12:29:56 -05:00
Mike Cifelli 4a5f169076 Formatted the files in the scanner package 2016-12-08 16:12:29 -05:00
Mike Cifelli dd8f4172e4 Fixed a bug where the LispFilterInputStream could not recognize an escaped double quote 2016-12-08 15:33:03 -05:00
Mike Cifelli 702c11a7b9 Added unit tests for LispScanner and refactored LispFilterInputStream 2016-12-08 15:30:40 -05:00
Mike Cifelli daf35a72fa Refactored and added unit tests for LispFilterInputStream 2016-12-08 10:59:02 -05:00
Mike Cifelli 861d24ac7f Updated the ant build to create the output directory 2016-12-08 10:01:54 -05:00
Mike Cifelli f71a9905da Fixed the ant build's output directory 2016-12-08 09:11:12 -05:00