Package it.unive.lisa.checks
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 typeTof the tool that will be used during the inspection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidafterExecution(T tool)Callback invoked only once after the end of the inspection of the program.voidbeforeExecution(T tool)Callback invoked only once before the beginning of the inspection of the program.booleanvisitCompilationUnit(T tool, CompilationUnit unit)Visits the given compilation unit.voidvisitGlobal(T tool, Unit unit, Global global, boolean instance)Visits the given global.-
Methods inherited from interface it.unive.lisa.util.datastructures.graph.GraphVisitor
visit, visit, visit
-
-
-
-
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 useunit- 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 useunit- the unit where the global belongsglobal- the global being visitedinstance- whether or not the global is an instance member of the compilation unit
-
-