Hello! I’ve been poking through the compiler source code and have a couple questions.
1) It looks like you are lexing via JFlex instead of Antlr. Is this correct? Any reasons for one over the other?
2) Is the parser implemented by hand? I’ve seen some parsing examples where you can generate a simple parser from grammar rules. Did this not give you enough control?
i
Ilmir Usmanov [JB]
05/04/2019, 8:59 PM
The answers are boring: it does not matter. The lexer is written once and never changes. A recursive descent parser can be written at the same speed as the grammar for something like antlr. And also rarely changes, like once per couple of years.
🙏 1
a
aerb
05/06/2019, 12:36 PM
Cool thanks!
m
mbonnin
11/03/2020, 1:12 PM
Halloween's was just a couple of days ago so I feel like I can revive this old thread 👻. Isn't an argument for auto-generating the parser that it'll be always in sync with the spec?
mbonnin
11/03/2020, 1:13 PM
And also that if
antlr
is considered "proven", it removes the possibilty of human mistakes?