title: Why Babel uses a top down parser?
body: <p>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.</p>
  
  <p>I went through Babylon's code and it appears to be using a Top Down parser with embedded ad hoc semantic rules. <a href="https://github.com/babel/babylon/blob/24d62cd191c9c94d81528fd1f315f05434db10e9/src/parser/statement.js#L26-L61" rel="nofollow noreferrer">src</a></p>
  
  <p>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.</p>
  
  <p>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 :) )</p>
  
  <p>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?</p>
  
  <p>Thanks!</p>