3 ms·
What few seem to realize is that it's perfectly possible to abstract out some of the work and create an extensible foundation for manual parsers. Since it's al
by codr7 5y ago
What few seem to realize is that it's perfectly possible to abstract out some of the work and create an extensible foundation for manual parsers.
Since it's all regular code, you can use the full power of the host language to deal with the problem.
https://github.com/codr7/swifties/blob/main/Sources/Swifties/Parser.swift https://github.com/codr7/swifties/blob/main/Sources/Swifties...
- p4bl0 5y agoI understand that, but I still find it easier to write/maintain/extend a grammar than a parser for that grammar.
- brundolf 5y agoIf you've got the right utility functions, a handwritten parser visually maps very directly to its grammar. It won't be as concise of course, but cognitively you can work with it almost as if it were just a grammar.