SourceAnalysis.java 1019 B

1234567891011121314151617181920212223242526
  1. package de.jplag.cpp.experimental;
  2. import java.io.File;
  3. import java.util.Set;
  4. /**
  5. * Strategy for analyzing source code for unused variables querying the corresponding lines
  6. */
  7. public interface SourceAnalysis {
  8. /**
  9. * Tells the caller if a token is located in a line containing an unused variable. This usually indicates that the token
  10. * belongs to a declaration of an unused variable. An edge case is multiple variable declarations in a single line, e.g.
  11. * 'int a, b;' where a is used an b is unused.
  12. * @param token The token that will be checked
  13. * @param file The file the token was scanned in
  14. * @return True, if the token should not be added to a TokenList, false if it should
  15. */
  16. boolean isTokenIgnored(de.jplag.cpp.Token token, File file);
  17. /**
  18. * Executes the source analysis on the files of a submission.
  19. * @param files Set of the files contained in the submission
  20. */
  21. void findUnusedVariableLines(Set<File> files) throws InterruptedException;
  22. }