
Code generation for algorithms in Java
Devs often use "magic code" to solve tree problems on LeetCode. However, enterprise code requires readability and maintainability for years. What shall we do when a task is so large that completing it manually would take weeks? Let's take a look at how code generation can help. What's problem? In the previous article , we examined a problem of tree translation. There, we scrutinized how it could be decomposed and proposed a solution. If you want to start with the basics, I suggest taking a peek there. However, I briefly rewind to what we'll discuss. What shall we do? We need an AST translator from the TypeScript compiler representation to our own. For what? To develop a static analyzer for JavaScript/TypeScript. An abstract syntax tree (or AST) surprisingly has not so many differences from any other tree. I'd like to highlight two important characteristics: it has many different types of nodes (for each syntactic structure in the language), and the trees can grow quite large, even thou
Continue reading on Dev.to
Opens in a new tab




