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 Type
    Method
    Description
    void
    Executes the source analysis on the files of a submission.
    boolean
    isTokenIgnored(Token token, File file)
    Tells the caller if a token is located in a line containing an unused variable.
  • Method Details

    • isTokenIgnored

      boolean isTokenIgnored(Token token, File file)
      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 checked
      file - The file the token was scanned in
      Returns:
      True, if the token should not be added to a TokenList, false if it should
    • findUnusedVariableLines

      void findUnusedVariableLines(Set<File> files) throws InterruptedException
      Executes the source analysis on the files of a submission.
      Parameters:
      files - Set of the files contained in the submission
      Throws:
      InterruptedException