GEGlobalResearch / DARPA-ASKE-TA1

ANSWER Project to demonstrate knowledge-driven extraction of scientific models from code and texts
Other
7 stars 5 forks source link

Some references missing in extraction #134

Open AbhaMoitra opened 3 years ago

AbhaMoitra commented 3 years ago

When ingesting the attached file (rename it by stripping out suffix '.txt'), the resulting extraction has 2 references for the variable currentTime. There should be 3 references for it. This was verified by @agabaldon and he is looking into it.

StrippedSimplyPID.java.txt

crapo commented 3 years ago

If I were going to guess, I would expect that the JavaModelExtractorJP isn't handling the expression

final double dt = (previousTime != Double.NaN) ? (double)(currentTime - previousTime) : 0;

which probably isn't one we encountered in our NASA Java Applet or WindTurbine examples.

agabaldon commented 3 years ago

@crapo, yes. For statements of type VariableDeclarationExpr, the RHS should be treated similar to RHS of statements of type AssignExpr. There is also no case for processing conditional expressions. I will push the change to handle the RHS of VariableDeclarationExpr for your review.

agabaldon commented 3 years ago

Pushed to CodeExtraction branch.

agabaldon commented 3 years ago

Also pushed handling of Conditional and Cast expressions.