Package org.ek9lang.compiler.directives
Class ErrorDirective
java.lang.Object
org.ek9lang.compiler.directives.ErrorDirective
- All Implemented Interfaces:
Directive
To be used in EK9 source code to assert that an error will be created.
Use this just before the statement that should cause a compiler error.
The first parameter is the phase that the error should be detected in
The second parameter is the type of error that should be generated.
@Error:
SYMBOL_DEFINITION: RETURNING_NOT_REQUIRED- See Also:
-
Constructor Summary
ConstructorDescriptionErrorDirective
(IToken token, CompilationPhase phase, ErrorListener.SemanticClassification classification, int lineNumber) A new error style directive. -
Method Summary
Modifier and TypeMethodDescriptionint
Which line number does this directive apply to.Provide a token from the source, by default if not possible supply synthetic.boolean
isForClassification
(ErrorListener.SemanticClassification classification) boolean
isForPhase
(CompilationPhase phase) Is it for the particular compiler phase.toString()
type()
What s the type of the directive.
-
Constructor Details
-
ErrorDirective
public ErrorDirective(IToken token, CompilationPhase phase, ErrorListener.SemanticClassification classification, int lineNumber) A new error style directive.
-
-
Method Details
-
type
Description copied from interface:Directive
What s the type of the directive. -
isForPhase
Description copied from interface:Directive
Is it for the particular compiler phase.- Specified by:
isForPhase
in interfaceDirective
-
isForClassification
-
getClassification
-
getDirectiveToken
Description copied from interface:Directive
Provide a token from the source, by default if not possible supply synthetic.- Specified by:
getDirectiveToken
in interfaceDirective
-
getAppliesToLineNumber
public int getAppliesToLineNumber()Description copied from interface:Directive
Which line number does this directive apply to.- Specified by:
getAppliesToLineNumber
in interfaceDirective
-
toString
-