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<A>, 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

        default 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. The default implementation does nothing.
        Parameters:
        tool - the auxiliary tool that this check can use during the execution
      • afterExecution

        default 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. The default implementation does nothing.
        Parameters:
        tool - the auxiliary tool that this check can use during the execution
      • visitUnit

        default boolean visitUnit​(T tool,
                                  Unit unit)
        Visits the given unit. The default implementation does nothing and returns true.
        Parameters:
        tool - the auxiliary tool that this visitor can use
        unit - the unit being visited
        Returns:
        whether or not the visiting should continue when this call returns. If this method returns false, all members of the unit will not be visited.
      • visitGlobal

        default void visitGlobal​(T tool,
                                 Unit unit,
                                 Global global,
                                 boolean instance)
        Visits the given global. The default implementation does nothing.
        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 unit