3 ms·
Lexing IS regular expressipn matching (except for some esoteric features like Haskell's nrsted comments). Difference is in the handling. As a matter of fact,
by thesz 12y ago
Lexing IS regular expressipn matching (except for some esoteric features like Haskell's nrsted comments).
Difference is in the handling.
As a matter of fact, Visual Studio uses semantic analysis - classes show differently than other identifiers.
- deleted 12y ago[deleted]
- cordite 12y agoIt can be, it can also be a context free grammar, which is 'higher' than a state machine (or regular expression)
- hyperpape 12y agoBut there are also higher complexity bounds on CFGs (since they include regular expressions, they certainly can't be lower). In any case, I've never heard of someone using non-regular expression CFGs for lexing. Are there cases?
- thesz 12y agoI mentioned Haskell above. It has nested block comments which should be balanced. Thus CFG.