I am using javaparser to parse the AST for Java source files.
I would like to get all binary subexpressions in the source code as individual nodes. Here is the source code I am parsing:
class MyClass {
public MyClass() {
double x = (4 / 10.0) + 15;
}
}
I implemented a Visitor that accepts the built-in BinaryExp type, but the only node that it finds contains the binary expression:
(4 / 10.0) + 15
Is there a way to visit the subexpression "(4 / 10.0)" as well? I tried getting the full expression's "left operand", but it is of type Expression, and not BinaryExpr as I expected.
Any help would be appreciated.