Package it.unive.lisa.checks.syntactic
Class CheckTool
- java.lang.Object
-
- it.unive.lisa.checks.syntactic.CheckTool
-
- Direct Known Subclasses:
CheckToolWithAnalysisResults
public class CheckTool extends java.lang.ObjectAn auxiliary tool that can be used by checks during their execution. It provides reporting capabilities, as well as access to analysis singletons, such as executed semantic analyses.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<Warning>getWarnings()Returns an unmodifiable view of the warnings that have been generated up to now using this tool.voidwarn(java.lang.String message)Reports a new warning that is meant to be a generic warning on the program.voidwarnOn(CFGDescriptor descriptor, java.lang.String message)Reports a new warning with the given message on the declaration of the cfg represented by the given descriptor.voidwarnOn(CFG cfg, java.lang.String message)Reports a new warning with the given message on the declaration of the given cfg.voidwarnOn(Expression expression, java.lang.String message)Reports a new warning with the given message on the given expression.voidwarnOn(Statement statement, java.lang.String message)Reports a new warning with the given message on the given statement.voidwarnOn(Unit unit, Global global, java.lang.String message)Reports a new warning with the given message on the declaration of the given global.voidwarnOn(Unit unit, java.lang.String message)Reports a new warning with the given message on the declaration of the given unit.
-
-
-
Constructor Detail
-
CheckTool
public CheckTool()
Build the tool.
-
CheckTool
protected CheckTool(CheckTool other)
Build the tool, shallow-copying the set of warnings from the given one.- Parameters:
other- the original tool to copy
-
-
Method Detail
-
warn
public void warn(java.lang.String message)
Reports a new warning that is meant to be a generic warning on the program. For warnings related to one of the components of the program (e.g., a CFG, a statement, ...) rely on the other methods provided by this class.- Parameters:
message- the message of the warning
-
warnOn
public void warnOn(Unit unit, java.lang.String message)
Reports a new warning with the given message on the declaration of the given unit.- Parameters:
unit- the unit to warn onmessage- the message of the warning
-
warnOn
public void warnOn(Unit unit, Global global, java.lang.String message)
Reports a new warning with the given message on the declaration of the given global.- Parameters:
unit- the unit containing the global to warn onglobal- the global to warn onmessage- the message of the warning
-
warnOn
public void warnOn(CFG cfg, java.lang.String message)
Reports a new warning with the given message on the declaration of the given cfg.- Parameters:
cfg- the cfg to warn onmessage- the message of the warning
-
warnOn
public void warnOn(CFGDescriptor descriptor, java.lang.String message)
Reports a new warning with the given message on the declaration of the cfg represented by the given descriptor.- Parameters:
descriptor- the descriptor cfg to warn onmessage- the message of the warning
-
warnOn
public void warnOn(Statement statement, java.lang.String message)
Reports a new warning with the given message on the given statement. Ifstatementis an instance ofExpression, thenwarnOn(Expression, String)is invoked.- Parameters:
statement- the statement to warn onmessage- the message of the warning
-
warnOn
public void warnOn(Expression expression, java.lang.String message)
Reports a new warning with the given message on the given expression.- Parameters:
expression- the expression to warn onmessage- the message of the warning
-
getWarnings
public java.util.Collection<Warning> getWarnings()
Returns an unmodifiable view of the warnings that have been generated up to now using this tool.- Returns:
- a view of the warnings
-
-