@GroovyASTTransformation(phase = CompilePhase.INSTRUCTION_SELECTION)
public class StaticTypesTransformation
extends Object
implements ASTTransformation, CompilationUnitAware
Handles the implementation of the TypeChecked transformation.
| Modifiers | Name | Description |
|---|---|---|
static String |
STATIC_ERROR_PREFIX |
Prefix prepended to every static type-checking error. |
protected CompilationUnit |
compilationUnit |
The compilation unit passed to the type-checking visitor and to extensions. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected void |
addTypeCheckingExtensions(StaticTypeCheckingVisitor visitor, Expression extensions)Adds the type-checking extensions named by extensions. |
|
protected StaticTypeCheckingVisitor |
newVisitor(SourceUnit unit, ClassNode node)Allows subclasses to provide their own visitor. |
|
public void |
setCompilationUnit(CompilationUnit unit) |
|
public void |
visit(ASTNode[] nodes, SourceUnit source) |
Prefix prepended to every static type-checking error.
The text is "[Static type checking] - ".
The compilation unit passed to the type-checking visitor and to extensions. Set by setCompilationUnit(CompilationUnit).
Adds the type-checking extensions named by extensions. A constant's
text is one extension specification. A list is walked recursively. Any other
expression, including null, adds nothing.
visitor - the visitor that receives the extensionsextensions - the extensions member of TypeChecked, or nullAllows subclasses to provide their own visitor. This is useful for example for transformations relying on the static type checker.
unit - the source unitnode - the current classnode