Package de.jplag.cpp.experimental
Class GCCSourceAnalysis
java.lang.Object
de.jplag.cpp.experimental.GCCSourceAnalysis
- All Implemented Interfaces:
SourceAnalysis
Uses GCC to find unused variables and saves their location. The scanner can then check if a token belongs to an
unused variable
-
Field Summary
Fields -
Constructor Summary
Constructors -
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.
-
Field Details
-
COMPILE_COMMAND
- See Also:
-
-
Constructor Details
-
GCCSourceAnalysis
public GCCSourceAnalysis()
-
-
Method Details
-
isTokenIgnored
Description copied from interface:SourceAnalysisTells 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.- Specified by:
isTokenIgnoredin interfaceSourceAnalysis- 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
Description copied from interface:SourceAnalysisExecutes the source analysis on the files of a submission.- Specified by:
findUnusedVariableLinesin interfaceSourceAnalysis- Parameters:
files- Set of the files contained in the submission- Throws:
InterruptedException
-