Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated readme with more design info
- Loading branch information
Showing
1 changed file
with
39 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,47 @@ | ||
Dan Ziemba | ||
Required file 'Runfile' is generated by Makefile | ||
|
||
Required file 'Runfile' is generated by the Makefile. | ||
Code is also available at https://github.com/zman0900/cse755-lisp | ||
Javadoc is available by running `make doc` | ||
|
||
|
||
Design Information: | ||
|
||
<S> ::= <E> | ||
I used the LL(1) grammar from the project description with whitespace removed | ||
since my lexer handles ensuring required whitespace is where it belongs. | ||
|
||
LL(1) Grammar with numbered rules: | ||
1. <S> ::= <E> | ||
2. <E> ::= atom | ||
3. | (<X> | ||
4. <X> ::= ) | ||
5. | <E><Y> | ||
6. <Y> ::= .<E>) | ||
7. | <R>) | ||
8. <R> ::= <E><R> | ||
9. | empty | ||
|
||
<E> ::= atom | ||
| (<X> | ||
I constructed an LL(1) parse table based on the info from wikipedia's LL parser | ||
page: http://en.wikipedia.org/wiki/LL_parser | ||
|
||
<X> ::= ) | ||
| <E> <Y> | ||
First-sets: | ||
E - { atom, ( } | ||
R - { empty, atom, ( } | ||
S - { atom, ( } | ||
X - { ), atom, ( } | ||
Y - { ), atom, (, . } | ||
|
||
<Y> ::= . <E>) | ||
| <R>) | ||
Follow-sets: | ||
E - { ), $, atom, (, . } | ||
R - { c } | ||
S - { $ } | ||
X - { ), $, atom, (, . } | ||
Y - { ), $, atom, (, . } | ||
|
||
<R> ::= <E> <R> | ||
| empty | ||
Parse table: | ||
. atom ) ( $ | ||
E 2 3 | ||
R 8 9 8 | ||
S 1 1 | ||
X 5 4 5 | ||
Y 6 7 7 7 |