Interface Check<T>

  • Type Parameters:
    T - the type of tool used during the inspection
    All Superinterfaces:
    GraphVisitor<CFG,​Statement,​Edge,​T>
    All Known Subinterfaces:
    SemanticCheck, SyntacticCheck

    public interface Check<T>
    extends GraphVisitor<CFG,​Statement,​Edge,​T>
    A check that inspects the syntactic structure of the program to report warnings. The inspection is performed by providing callbacks that will be invoked by LiSA while visiting the program structure. A check is supposed to perform on each syntactic element in isolation, potentially in parallel. This means that implementers of this interface should take care of sharing data between different callback calls only through thread-safe data structures.

    The check is parametric to the type T of the tool that will be used during the inspection.
    • Method Detail

      • beforeExecution

        void beforeExecution​(T tool)
        Callback invoked only once before the beginning of the inspection of the program. Can be used to setup common data structures.
        Parameters:
        tool - the auxiliary tool that this check can use during the execution
      • afterExecution

        void afterExecution​(T tool)
        Callback invoked only once after the end of the inspection of the program. Can be used to perform cleanups or to report summary warnings.
        Parameters:
        tool - the auxiliary tool that this check can use during the execution
      • visitCompilationUnit

        boolean visitCompilationUnit​(T tool,
                                     CompilationUnit unit)
        Visits the given compilation unit.
        Parameters:
        tool - the auxiliary tool that this visitor can use
        unit - the compilation unit being visited
        Returns:
        whether or not the visiting should continue when this call returns. If this method returns false, all members of the compilation unit will not be visited.
      • visitGlobal

        void visitGlobal​(T tool,
                         Unit unit,
                         Global global,
                         boolean instance)
        Visits the given global.
        Parameters:
        tool - the auxiliary tool that this visitor can use
        unit - the unit where the global belongs
        global - the global being visited
        instance - whether or not the global is an instance member of the compilation unit