
Pragmatic Versioning
At JavaParser we use a variation of Semantic Versioning that we might call “Pragmatic Versioning.” Why? First, why not just use the Semantic Versioning? Well, […]
At JavaParser we use a variation of Semantic Versioning that we might call “Pragmatic Versioning.” Why? First, why not just use the Semantic Versioning? Well, […]
JavaParser works great to analyse java code and provides a way to process a source directory in one go. But it was lacking a […]
Inspecting an AST Two of the more common questions on JavaParser are: If I have this piece of code, how do I access that part […]
JavaParser’s logging framework in one file Ah, logging, the most important topic in the Java programming world if you look at the amount of time […]
Printing the AST in JavaParser There are various options for printing source code in JavaParser, and not all of them well explained. Node.toString / PrettyPrinter […]
The quick and the full API of JavaParser Lost in a dark corner of the JavaParser site is the idea behind the two API’s of […]
Less casting in JavaParser A common pattern in code using JavaParser looks as follows:
1 2 3 4 5 6 7 8 9 10 |
// We get a field that has a pretty wide type: Expression Expression condExpr = ifStmt.getCondition(); // We want to know if it happens to be a BinaryExpr, so instanceof if (condExpr instanceof BinaryExpr) { // Yeah, we already know it is a BinaryExpr, // but Java wants you to cast it anyway... BinaryExpr cond = (BinaryExpr) condExpr; // Now we can use cond... } |
Federico Tomassetti, who maintains Java Symbol Solver, suggested we move […]
Parse error recovery Since JavaParser 3.2.7, JavaParser is able to recover from parse errors. What does this mean? It’s not about semantic errors This is […]
Inverting ifs in JavaParser To answer a question from Kaleem on our Gitter channel, I made a little sample program that turns all if(x!=y) a […]
If you are not working on the JavaParser project itself, ignore this article. What’s below is outdated starting from version 3.2.9. Currently the build does […]
Copyright © 2019 | WordPress Theme by MH Themes