I'm studying compiler construction and naturally I'm also studying real world implementations of these concepts. One example of this is Babel's parser: Babylon.
I went through Babylon's code and it appears to be using a Top Down parser with embedded ad hoc semantic rules. src
I was expecting Babel to be using a member of the LR parsers and probably a definition file where the grammar productions are coupled together with semantic rules. Why? Well mostly because a bunch of other real world langs use lr parser generators such as Yacc, Bison, et al, that give you this exact interface, and seems to be a clearer and more maintainable way of representing these rules, and even more when you consider that Babel lives on the edge of the Javascript standard, implementing new things all the time.
I also have constructed both top down and bottom up (lr) parsers and I don't see a big implementation difficulty difference between the two (both are equally difficult :) )
So, why does Babel's parser uses a top down ad hoc syntax directed translations instead of what I see as a more structured approach? What are the design decisions behind that? What am I missing?
Thanks!