2 ms·
IMO that article doesn't really say anything interesting. There is no clear dividing line between the lexer, the parser, and semantic analysis. You have a great
by swift 13y ago
IMO that article doesn't really say anything interesting. There is no clear dividing line between the lexer, the parser, and semantic analysis. You have a great deal of freedom to move work between these phases, and what the grammar you're using at the parser level looks like can change drastically as a result.
If Python's lexer is not regular, it doesn't change the fact that the parser uses a context-free grammar over the resulting lexemes. Whether that's the right approach is an engineering tradeoff and nothing more.