Thank you for your reply. I could not understand the advice fully, and below are the ideas of the method of my tokenizer that came to mind.
An example code is 'let b = Fraction();'.
1. Split a code by whitespace ([let, b, =, Fraction(1,2);] is generated.)
2. Extract each element
3. If the element has any symbol, split it by the symbol to generate a new list ([Fraction, );] is generated.
4. If the element has no symbol, add it to a blank list
I intended to apply a recursive function on the list in No.3, but it did not work. I attached my test python file, so could you give me any hint to modify the program? I searched about the recursive structure, but I had no idea.
split.pyThanks,
Ichiro