3 ms·
None of these helps with implementing AST visitors. I was rather talking about things like Scrap Your Boilerplate or Nanopass.
by sklogic 11y ago
None of these helps with implementing AST visitors. I was rather talking about things like Scrap Your Boilerplate or Nanopass.
- pjmlp 11y agoThey are able to generate part of the AST visitors boilerplate. For example, JJTree on JavaCC.
- sklogic 11y agoIt's not very useful - it's generating only one visitor structure, while you'd need many for different passes. E.g., a visitor for extracting bound and free identifiers lists would be different from a visitor for lowering various syntax sugar.
- pjmlp 11y agoAh ok, but you could also do the multiple passes at once, at least in some cases. I am talking about prototyping, not going with a state of art implementation.
- sklogic 11y agoDoing multiple passes at once is a (premature) optimisation. For prototyping you'd rather split the process into as small and simple passes as possible.