Open
Description
Hello, recently I created my own interpreter following the books' architecture for everything, lexer included.
After some time I realized maybe the approach the author took was against the open-closed principle, especially using an enum for rappresenting the tokens and a switch statement for lexing it, so the lexer class could be changed whether the enum gets changed as well.
So I was wondering if the author's approach on the lexer architecture was the best, and maybe applying the chain of responsability would have been a better approach in order to keep things consistent and not breaking the open-closed principle.
@munificent I would like to have your opinion on this matter.
Metadata
Metadata
Assignees
Labels
No labels