umut-sahin / dotlr

An LR(1) parser generator and visualizer created for educational purposes.
Apache License 2.0
91 stars 4 forks source link

Improve lexing #6

Open umut-sahin opened 2 months ago

umut-sahin commented 2 months ago

The current implementation is very basic and even prone to unexpected behavior! Instead one of the following could be used to replace it:

Single DFA approach is the best, but the most complicated one. I guess the implementation can start with the longest match approach is it's relatively easy, and then to DFA construction in the future.

umut-sahin commented 2 months ago

Implementation is updated to longest match in https://github.com/umut-sahin/dotlr/commit/d32268802efaee3ae601d00a37d25c1716bc56a0.

Keeping the issue open for further improvements.