Entries by Federico Tomassetti

Bests posts on Language Engineering

  In the past years, and in the last 12 months in particular I wrote tens of posts, some of which got a good response from you (thank you!). I thought it could be useful to create a list of the most relevant posts for each topic. It could help in particular new readers. ANTLR […]

Extracting JavaDoc documentation from source files using JavaParser

A lot of people are using JavaParser for the most different goals. One of these is extracting documentation. In this short post we will see how you can print all the JavaDoc comments associated to classes or interfaces. Code is available on GitHub: https://github.com/ftomassetti/javadoc-extractor Getting all the Javadoc comments for classes We are reusing DirExplorer, a supporting […]

Implementing Lexical Preservation for JavaParser

Many users of JavaParser are asking to implement lexical preservation, i.e., the ability of parsing a Java source file, modifying the AST and get back the modified Java source code keeping the original layout. Currently this is not supported by JavaParser: you can parse all Java 8 code with JavaParser, get an AST but then the […]

Writing a very simple JS editor

There are nice web editors out there which are ready to be used: you just download them and plug them in your page. I have used myself both CodeMirror and ACE in the past. For example I wrote a plugin for CodeMirror to support PlantUML. However there is an issue with these editors: they are […]

Observers for AST nodes in JavaParser

We are getting closer to the first Release Candidate for JavaParser 3.0. One of the last features we added was support for observing changes to all nodes of the Abstract Syntax Tree. While I wrote the code for this feature I received precious feedback from Danny van Bruggen (a.k.a. Matozoid) and Cruz Maximilien. So I […]

Interview to Erik Dietrich on Static Analysis and a data driven approach to refactoring

Erik Dietrich is a well known Software Architect with a long experience in consulting. His blog (DaedTech) is a source of thoughtful insights on software development. In particular I was very interested by his usage of static analysis and code metrics in his consulting work. I am myself a relatively young consultant and I thought […]