So I dont have much experience working with Linked List in java and I got this assignment that requires to store values on a Linked List. In summary is creating class that deals with Lisp expressions. In particular, it creates a reference based linked list from an expression, and implements a number of methods to perform operations on the list. As provided by my professor, he use the tokenizer to break the expression. Example:
parse("(+ 3 5 ( 23.2 -1a 1/2 \"abc\" ) ) ");
And my assignment is to add it to a simple linked list, but my problem is that for every open parentheses there's a new list and a parentheses inside this is a sublist.
For the case: (4 * (45 + 3) - (7/5))
(45 + 3) is a sublist or list.
(7/5) is a sublist or list
4 is integer
* symbol
45 integer
+ symbol
3 integer
- symbol
7/5 ratio
My professor told me this: "So, the sublist or list you have to do the same as the complete list, that means that the recognizer process can be recursive."
I have a Lisp generic class, a LinkedList class, and a class for breaking the expression into tokens.
Any idea?