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
ConstructorsConstructorDescriptionErrorDirective(IToken token, CompilationPhase phase, ErrorListener.SemanticClassification classification, int lineNumber) A new error style directive. -
Method Summary
Modifier and TypeMethodDescriptionintWhich line number does this directive apply to.Provide a token from the source, by default if not possible supply synthetic.booleanisForClassification(ErrorListener.SemanticClassification classification) booleanisForPhase(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:DirectiveWhat s the type of the directive. -
isForPhase
Description copied from interface:DirectiveIs it for the particular compiler phase.- Specified by:
isForPhasein interfaceDirective
-
isForClassification
-
getClassification
-
getDirectiveToken
Description copied from interface:DirectiveProvide a token from the source, by default if not possible supply synthetic.- Specified by:
getDirectiveTokenin interfaceDirective
-
getAppliesToLineNumber
public int getAppliesToLineNumber()Description copied from interface:DirectiveWhich line number does this directive apply to.- Specified by:
getAppliesToLineNumberin interfaceDirective
-
toString
-