Package de.jplag.cpp.experimental
Interface SourceAnalysis
- All Known Implementing Classes:
GCCSourceAnalysis
public interface SourceAnalysis
Strategy for analyzing source code for unused variables querying the corresponding lines
-
Method Summary
Modifier and TypeMethodDescriptionvoidfindUnusedVariableLines(Set<File> files) Executes the source analysis on the files of a submission.booleanisTokenIgnored(Token token, File file) Tells the caller if a token is located in a line containing an unused variable.
-
Method Details
-
isTokenIgnored
Tells the caller if a token is located in a line containing an unused variable. This usually indicates that the token belongs to a declaration of an unused variable. An edge case is multiple variable declarations in a single line, e.g. 'int a, b;' where a is used an b is unused.- Parameters:
token- The token that will be checkedfile- The file the token was scanned in- Returns:
- True, if the token should not be added to a TokenList, false if it should
-
findUnusedVariableLines
Executes the source analysis on the files of a submission.- Parameters:
files- Set of the files contained in the submission- Throws:
InterruptedException
-