io.sarl.lang.validation
Class SARLValidator
All Superinterfaces:
org.eclipse.emf.ecore.EValidator, org.eclipse.xtext.validation.ValidationMessageAcceptor
All Known Subclasses:
Bug621Validator
class SARLValidator
extends AbstractSARLValidator
Validator for the SARL elements.

The check type may be one of:
  • FAST: is executed after a delay of 500ms after ANY editing action (type, enter, delete);
  • NORMAL: is executed after a build (manual, or automatic);
  • EXPENSIVE: is executed by right clicking ANYWHERE in the editor window and chooseing "Validate".
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
See:
"https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#validation"
Property Summary
Inherited: ePackages
Nested Type Summary
Modifier and type Type and description
protected class SARLValidator.SARLModifierValidator
The modifier validator for constructors.
Constructor Summary
Constructor and description
new
Action Summary
Modifier and type Action and description
protected java.lang.String canonicalName(EObject)
Replies the canonical name of the given object.
void checkAbstract(XtendFunction)
Check for abstract methods.
void checkActionFires(SarlAction)
Check the types of the parameters of the "fires" statement.
void checkActionName(SarlAction)
Check if the given action has a valid name.
void checkAmbiguousInterpretationMinusUnaryOperator(XUnaryOperation)
Check if the call to an unary minus operator may be ambiguous interpretation for the SARL developper.
void checkAnnotationTarget(XAnnotation)
void checkArtifactUse(SarlArtifact)
Artifact keyword is reserved.
void checkAssertKeywordUse(SarlAssertExpression)
Check for usage of assert keyword.
protected void checkAssignment(XExpression,EStructuralFeature,boolean)
void checkAssumeKeywordUse(SarlAssertExpression)
Check for usage of assert keyword.
void checkBehaviorUnitEventType(SarlBehaviorUnit)
Check if the parameter of the bahavior unit is an event.
void checkBehaviorUnitGuardType(SarlBehaviorUnit)
Check the type of the behavior unit's guard.
void checkBreakKeywordUse(SarlBreakExpression)
Check for usage of break inside loops.
void checkCapacityFeatures(SarlCapacity)
Check if a capacity has a feature defined inside.
void checkCapacityTypeForUses(SarlCapacityUses)
Check the type of the capacity uses.
protected void checkCast(JvmTypeReference,LightweightTypeReference,LightweightTypeReference)
void checkCasts(XCastedExpression)
void checkClassPath(XtendFile)
Check if the correct SARL libraries are on the classpath.
void checkContainerType(SarlAgent)
Check the container for the SARL agents.
void checkContainerType(SarlBehavior)
Check the container for the SARL behaviors.
void checkContainerType(SarlCapacity)
Check the container for the SARL capacities.
void checkContainerType(SarlEvent)
Check if the modifiers for the SARL events.
void checkContainerType(SarlSkill)
Check the container for the SARL skills.
void checkContinueKeywordUse(SarlContinueExpression)
Check for usage of continue inside loops.
void checkDefaultSkillAnnotation(SarlCapacity)
Check the correct usage of the io.sarl.lang.core.DefaultSkill annotation.
void checkDefaultSuperConstructor(XtendClass)
Check if the super default constructor is correctly invoked.
void checkDefaultValueFinalFieldReferenceInConstructor(SarlFormalParameter)
Check if the default values have valid references to read-only fields from constructors.
void checkDefaultValuePureExpression(SarlFormalParameter)
Check if the default values have not a reference to a not-pure operation.
void checkDefaultValueRedefinition(SarlFormalParameter)
Check if the default value expression is redefined from an inherited definition.
void checkDefaultValueTypeCompatibleWithParameterType(SarlFormalParameter)
Check if the default values of the formal parameters have a compatible type with the formal parameter.
void checkDiscouragedCalls(XAbstractFeatureCall)
Check if the call is discouraged.
void checkEarlyExitEventInFires(SarlAction)
Emit a warning when the events after the "fires" keyword are not early-exit events.
void checkFieldName(SarlField)
Check if the given field has a valid name.
void checkFieldNameShadowing(SarlField)
Check if the given field has a name that is shadowing an inherited field.
void checkFinalFieldInitialization(SarlAgent)
Check if all the fields are initialized in a SARL agent.
void checkFinalFieldInitialization(SarlBehavior)
Check if all the fields are initialized in a SARL behavior.
void checkFinalFieldInitialization(SarlEvent)
Check if all the fields are initialized in a SARL event.
void checkFinalFieldInitialization(SarlSkill)
Check if all the fields are initialized in a SARL skill.
void checkForbiddenCalls(XAbstractFeatureCall)
Check if the call is forbidden.
void checkGenericTypeNameShadowing(JvmTypeParameter)
Check if the given generic type has a name that is shadowing an enclosing generic type.
protected boolean checkImplementedTypes(XtendTypeDeclaration,EReference,List<E>,Class<T>,int,boolean)
Check the implemented type.
protected void checkInferedApi(XtendField)
protected void checkInferedApi(XtendFunction)
void checkLocalUsageOfDeclaredXtendFunction(XtendFunction)
void checkManualInlineDefinition(XtendAnnotationTarget)
Check for @Inline annotation usage.
protected void checkModifiers(SarlAgent)
Check the modifiers for the SARL agents.
protected void checkModifiers(SarlBehavior)
Check the modifiers for the SARL behaviors.
protected void checkModifiers(SarlCapacity)
Check the modifiers for the SARL capacities.
protected void checkModifiers(SarlEvent)
Check if the modifiers for the SARL events.
protected void checkModifiers(SarlSkill)
Check the modifiers for the SARL skills.
protected void checkModifiers(XtendAnnotationType)
protected void checkModifiers(XtendClass)
protected void checkModifiers(XtendConstructor)
protected void checkModifiers(XtendEnum)
protected void checkModifiers(XtendField)
protected void checkModifiers(XtendFunction)
protected void checkModifiers(XtendInterface)
void checkMultipleCapacityUses(SarlCapacityUses)
Check for multiple capacity use declaration.
protected boolean checkOverrideableCasts(SarlCastedExpression)
Check if the given cast expression has an associated overriding function.
void checkParameterName(SarlFormalParameter)
Check if the given parameter has a valid name.
void checkParameterName(XClosure)
Check if the closure parameters have a valid name.
void checkProgrammaticIssueMessage(XAbstractFeatureCall)
Check if element has an programmatic issue message.
void checkRedundantImplementedInterfaces(SarlClass)
Check if implemented interfaces of a Xtend Class are redundant.
void checkRedundantImplementedInterfaces(SarlInterface)
Check if implemented interfaces of a Xtend Interface are redundant.
void checkRedundantImplementedInterfaces(SarlSkill)
Check if implemented interfaces of a skill are redundant.
void checkRequiredCapacityUse(SarlRequiredCapacity)
Emit a warning when the "requires" keyword is used.
void checkReservedAnnotation(XtendAnnotationTarget)
Check for reserved annotations.
void checkSpaceUse(SarlSpace)
Space keyword is reserved.
void checkStaticConstructorPrototype(XtendConstructor)
Check for a valid prototype of a static constructor.
void checkSuperConstructor(SarlAgent)
Check if the super default constructor is correctly invoked.
void checkSuperConstructor(SarlBehavior)
Check if the super default constructor is correctly invoked.
void checkSuperConstructor(SarlEvent)
Check if the super default constructor is correctly invoked.
void checkSuperConstructor(SarlSkill)
Check if the super default constructor is correctly invoked.
protected void checkSuperConstructor(XtendTypeDeclaration,EStructuralFeature,Collection<E>)
Check the super constructors.
void checkSuperType(SarlAgent)
Check if the supertype of the given agent is a subtype of Agent.
void checkSuperType(SarlBehavior)
Check if the supertype of the given behavior is a subtype of Behavior.
void checkSuperType(SarlEvent)
Check if the supertype of the given event is a subtype of Event.
void checkSuperType(SarlSkill)
Check if the supertype of the given skill is a subtype of Skill.
void checkSuperTypes(SarlCapacity)
Check if the supertype of the given capacity is a subtype of Capacity.
protected int checkSuperTypes(XtendTypeDeclaration,EReference,List<E>,Class<T>,boolean)
Check the super type.
void checkTopElementsAreUnique(SarlScript)
Check the top elements within a script are not duplicated.
void checkUnmodifiableEventAccess(SarlBehaviorUnit)
Check for usage of the event functions in the behavior units.
void checkUnsynchronizedField(XtendField)
Check if a field needs to be synchronized.
void checkUnusedCapacities(SarlCapacityUses)
Check for unused capacities.
void checkVariableName(XVariableDeclaration)
Check if the given local variable has a valid name.
protected void doCheckFunctionOverrides(EObject,IResolvedOperation,List<E>)
Caution: This function is overridden for translating the MISSING_OVERRIDE error into a warning, and emit a warning when a return type should be specified.
protected org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference getExpectedType(XExpression)
protected org.eclipse.xtext.validation.IssueSeverities getIssueSeverities(Map<K,V>,EObject)
protected java.util.List<E> getParamTypeReferences(JvmExecutable,boolean,boolean)
Retrieve the types of the formal parameters of the given JVM executable object.
protected static org.eclipse.xtext.xbase.XMemberFeatureCall getRootOfMemberFeatureCallSequence(EObject,EObject,Procedure1<Param>)
Replies the member feature call that is the root of a sequence of member feature calls.
protected boolean isAmbiguousCastContext(JvmTypeReference,LightweightTypeReference,LightweightTypeReference)
Test if the enclosing cast expression is unsed in an context that make the casting operation mandatory in order to avoid ambiguity.
protected boolean isAOActiveAnnotation(XAnnotation)
Replies if the given container can receive an active annotation.
protected boolean isAOActiveAnnotationReceiver(XtendTypeDeclaration)
Replies if the given annotation is an active annotation for agent-oriented elements.
protected boolean isAOConstructorContainer(XtendTypeDeclaration)
Replies if the given type is an agent-oriented type that could receives a constructor declaration.
protected boolean isDefaultValuedParameterFunction(XtendFunction)
Replies if the given function has a default value for one of its parameters.
protected boolean isForbiddenActiveAnnotation(XAnnotation)
Replies if the given annotation is a forbidden active annotation.
protected boolean isIgnored(String,EObject)
Replies if the given issue is ignored for the given object.
protected boolean isInitialized(JvmField)
protected boolean isLocallyAssigned(EObject,EObject)
Replies if the given object is locally assigned.
protected boolean isOOActiveAnnotation(XAnnotation)
Replies if the given annotation is an active annotation for object-oriented elements.
protected boolean isOOType(XtendTypeDeclaration)
Replies if the given element is an object oriented type.
protected boolean isTypeFreeExpression(XExpression)
Replies if the given expression has no specific type.
protected boolean isValueExpectedRecursive(XExpression)
protected void reportCastWarnings(JvmTypeReference,LightweightTypeReference,LightweightTypeReference)
Report the warnings associated to the casted expressions.
protected org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference toLightweightTypeReference(JvmType,EObject)
Create a lightweight type reference from the given type.
protected void validateInferredType(JvmTypeReference,XtendMember,String,EAttribute)
This function is overridden in order to add "isIgnore" invocation.
Inherited: getEPackages
Constructor Details
new
new
Action Details
canonicalName(EObject)
protected def canonicalName(EObject) : java.lang.String
Replies the canonical name of the given object.
Parameters:
object - the object.
Returns:
the canonical name or null if it cannot be computed.
checkAbstract(XtendFunction)
def checkAbstract(XtendFunction)
Check for abstract methods.

Override the Xtend behavior for:
  • not generating an error when a return type is missed. Indeed, the return type is "void" by default.
  • generating a warning when "abstract" is missed.
checkActionFires(SarlAction)
def checkActionFires(SarlAction)
Check the types of the parameters of the "fires" statement.
Parameters:
action - the signature that contains the "fires" statement.
checkActionName(SarlAction)
def checkActionName(SarlAction)
Check if the given action has a valid name.
Parameters:
action - the action to test.
See:
SARLFeatureNameValidator
checkAmbiguousInterpretationMinusUnaryOperator(XUnaryOperation)
def checkAmbiguousInterpretationMinusUnaryOperator(XUnaryOperation)
Check if the call to an unary minus operator may be ambiguous interpretation for the SARL developper.

Let the SARL expression -125.abs that is invoking the function Math.abs with extension method notation. According to the precedence of the the SARL operator, this expression is interpreted as -abs(125) and not abs(-125). Indeed the minus sign is an operator and not considered as a part of the number literal itself.

To avoid invalid interpretation of the expression by the SARL developper, a warning is generated.
Parameters:
expression - the expression.
Since:
0.13
checkAnnotationTarget(XAnnotation)
def checkAnnotationTarget(XAnnotation)
checkArtifactUse(SarlArtifact)
def checkArtifactUse(SarlArtifact)
Artifact keyword is reserved.
Parameters:
artifact - the artifact to check.
checkAssertKeywordUse(SarlAssertExpression)
def checkAssertKeywordUse(SarlAssertExpression)
Check for usage of assert keyword.
Parameters:
expression - the expression to analyze.
checkAssignment(XExpression,EStructuralFeature,boolean)
protected def checkAssignment(XExpression,EStructuralFeature,boolean)
checkAssumeKeywordUse(SarlAssertExpression)
def checkAssumeKeywordUse(SarlAssertExpression)
Check for usage of assert keyword.
Parameters:
expression - the expression to analyze.
checkBehaviorUnitEventType(SarlBehaviorUnit)
def checkBehaviorUnitEventType(SarlBehaviorUnit)
Check if the parameter of the bahavior unit is an event.
Parameters:
behaviorUnit - the behavior unit to test.
checkBehaviorUnitGuardType(SarlBehaviorUnit)
def checkBehaviorUnitGuardType(SarlBehaviorUnit)
Check the type of the behavior unit's guard.
Parameters:
behaviorUnit - the behavior unit.
checkBreakKeywordUse(SarlBreakExpression)
def checkBreakKeywordUse(SarlBreakExpression)
Check for usage of break inside loops.
Parameters:
expression - the expression to analyze.
checkCapacityFeatures(SarlCapacity)
def checkCapacityFeatures(SarlCapacity)
Check if a capacity has a feature defined inside.
Parameters:
capacity - the capacity to test.
checkCapacityTypeForUses(SarlCapacityUses)
def checkCapacityTypeForUses(SarlCapacityUses)
Check the type of the capacity uses.
Parameters:
uses - the capacity uses.
checkCast(JvmTypeReference,LightweightTypeReference,LightweightTypeReference)
protected def checkCast(JvmTypeReference,LightweightTypeReference,LightweightTypeReference)
checkCasts(XCastedExpression)
def checkCasts(XCastedExpression)
checkClassPath(XtendFile)
def checkClassPath(XtendFile)
Check if the correct SARL libraries are on the classpath.

This function is overriding the function given by the Xtend validator for having finer tests, and firing a warning in place of an error.
Parameters:
sarlScript - the SARL script.
checkContainerType(SarlAgent)
def checkContainerType(SarlAgent)
Check the container for the SARL agents.
Parameters:
agent - the agent.
checkContainerType(SarlBehavior)
def checkContainerType(SarlBehavior)
Check the container for the SARL behaviors.
Parameters:
behavior - the behavior.
checkContainerType(SarlCapacity)
def checkContainerType(SarlCapacity)
Check the container for the SARL capacities.
Parameters:
capacity - the capacity.
checkContainerType(SarlEvent)
def checkContainerType(SarlEvent)
Check if the modifiers for the SARL events.
Parameters:
event - the event.
checkContainerType(SarlSkill)
def checkContainerType(SarlSkill)
Check the container for the SARL skills.
Parameters:
skill - the skill.
checkContinueKeywordUse(SarlContinueExpression)
def checkContinueKeywordUse(SarlContinueExpression)
Check for usage of continue inside loops.
Parameters:
expression - the expression to analyze.
Since:
0.7
checkDefaultSkillAnnotation(SarlCapacity)
def checkDefaultSkillAnnotation(SarlCapacity)
Check the correct usage of the io.sarl.lang.core.DefaultSkill annotation.
Parameters:
capacity - the associated capacity to check.
checkDefaultSuperConstructor(XtendClass)
def checkDefaultSuperConstructor(XtendClass)
Check if the super default constructor is correctly invoked.
Parameters:
xtendClass - the Xtend element.
checkDefaultValueFinalFieldReferenceInConstructor(SarlFormalParameter)
def checkDefaultValueFinalFieldReferenceInConstructor(SarlFormalParameter)
Check if the default values have valid references to read-only fields from constructors.
Parameters:
param - the formal parameter to check.
checkDefaultValuePureExpression(SarlFormalParameter)
def checkDefaultValuePureExpression(SarlFormalParameter)
Check if the default values have not a reference to a not-pure operation.
Parameters:
param - the formal parameter to check.
checkDefaultValueRedefinition(SarlFormalParameter)
def checkDefaultValueRedefinition(SarlFormalParameter)
Check if the default value expression is redefined from an inherited definition.
Parameters:
param - the formal parameter to check.
checkDefaultValueTypeCompatibleWithParameterType(SarlFormalParameter)
def checkDefaultValueTypeCompatibleWithParameterType(SarlFormalParameter)
Check if the default values of the formal parameters have a compatible type with the formal parameter.
Parameters:
param - the formal parameter to check.
checkDiscouragedCalls(XAbstractFeatureCall)
def checkDiscouragedCalls(XAbstractFeatureCall)
Check if the call is discouraged.

One example of a discouraged feature is err.
Parameters:
expression - the expression.
checkEarlyExitEventInFires(SarlAction)
def checkEarlyExitEventInFires(SarlAction)
Emit a warning when the events after the "fires" keyword are not early-exit events.
Parameters:
action - the action to check.
checkFieldName(SarlField)
def checkFieldName(SarlField)
Check if the given field has a valid name.
Parameters:
field - the field to test.
See:
SARLFeatureNameValidator
checkFieldNameShadowing(SarlField)
def checkFieldNameShadowing(SarlField)
Check if the given field has a name that is shadowing an inherited field.
Parameters:
field - the field to test.
checkFinalFieldInitialization(SarlAgent)
def checkFinalFieldInitialization(SarlAgent)
Check if all the fields are initialized in a SARL agent.
Parameters:
agent - the agent.
checkFinalFieldInitialization(SarlBehavior)
def checkFinalFieldInitialization(SarlBehavior)
Check if all the fields are initialized in a SARL behavior.
Parameters:
behavior - the behavior.
checkFinalFieldInitialization(SarlEvent)
def checkFinalFieldInitialization(SarlEvent)
Check if all the fields are initialized in a SARL event.
Parameters:
event - the event.
checkFinalFieldInitialization(SarlSkill)
def checkFinalFieldInitialization(SarlSkill)
Check if all the fields are initialized in a SARL skill.
Parameters:
skill - the skill.
checkForbiddenCalls(XAbstractFeatureCall)
def checkForbiddenCalls(XAbstractFeatureCall)
Check if the call is forbidden.

One example of a forbidden feature is exit(int).
Parameters:
expression - the expression.
checkGenericTypeNameShadowing(JvmTypeParameter)
def checkGenericTypeNameShadowing(JvmTypeParameter)
Check if the given generic type has a name that is shadowing an enclosing generic type.
Parameters:
type - the generic type parameter to check.
Since:
0.12
checkImplementedTypes(XtendTypeDeclaration,EReference,List<E>,Class<T>,int,boolean)
protected def checkImplementedTypes(XtendTypeDeclaration,EReference,List<E>,Class<T>,int,boolean) : boolean
Check the implemented type.
Parameters:
element - the child type.
feature - the syntactic feature related to the supertypes.
implementedTypes - the current super types.
expectedType - the expected root type.
mandatoryNumberOfTypes - the minimal number of implemented types.
onlySubTypes - if true only the subtype of the expectedType are valid; false if the expectedType is allowed.
Returns:
the count of supertypes.
checkInferedApi(XtendField)
protected def checkInferedApi(XtendField)
checkInferedApi(XtendFunction)
protected def checkInferedApi(XtendFunction)
checkLocalUsageOfDeclaredXtendFunction(XtendFunction)
def checkLocalUsageOfDeclaredXtendFunction(XtendFunction)
checkManualInlineDefinition(XtendAnnotationTarget)
def checkManualInlineDefinition(XtendAnnotationTarget)
Check for @Inline annotation usage.
Parameters:
annotationTarget - thee target to test.
checkModifiers(SarlAgent)
protected def checkModifiers(SarlAgent)
Check the modifiers for the SARL agents.
Parameters:
agent - the agent.
checkModifiers(SarlBehavior)
protected def checkModifiers(SarlBehavior)
Check the modifiers for the SARL behaviors.
Parameters:
behavior - the behavior.
checkModifiers(SarlCapacity)
protected def checkModifiers(SarlCapacity)
Check the modifiers for the SARL capacities.
Parameters:
capacity - the capacity.
checkModifiers(SarlEvent)
protected def checkModifiers(SarlEvent)
Check if the modifiers for the SARL events.
Parameters:
event - the event.
checkModifiers(SarlSkill)
protected def checkModifiers(SarlSkill)
Check the modifiers for the SARL skills.
Parameters:
skill - the skill.
checkModifiers(XtendAnnotationType)
protected def checkModifiers(XtendAnnotationType)
checkModifiers(XtendClass)
protected def checkModifiers(XtendClass)
checkModifiers(XtendConstructor)
protected def checkModifiers(XtendConstructor)
checkModifiers(XtendEnum)
protected def checkModifiers(XtendEnum)
checkModifiers(XtendField)
protected def checkModifiers(XtendField)
checkModifiers(XtendFunction)
protected def checkModifiers(XtendFunction)
checkModifiers(XtendInterface)
protected def checkModifiers(XtendInterface)
checkMultipleCapacityUses(SarlCapacityUses)
def checkMultipleCapacityUses(SarlCapacityUses)
Check for multiple capacity use declaration.
Parameters:
uses - the capacity use declaration.
checkOverrideableCasts(SarlCastedExpression)
protected def checkOverrideableCasts(SarlCastedExpression) : boolean
Check if the given cast expression has an associated overriding function.
Parameters:
cast - the SARL cast expression.
Returns:
true to avoid to do the "standard" cast test (because this function has already did it for example).
checkParameterName(SarlFormalParameter)
def checkParameterName(SarlFormalParameter)
Check if the given parameter has a valid name.
Parameters:
parameter - the parameter to test.
See:
SARLFeatureNameValidator
checkParameterName(XClosure)
def checkParameterName(XClosure)
Check if the closure parameters have a valid name.
Parameters:
closure - the closure to test.
See:
SARLFeatureNameValidator
checkProgrammaticIssueMessage(XAbstractFeatureCall)
def checkProgrammaticIssueMessage(XAbstractFeatureCall)
Check if element has an programmatic issue message.
Parameters:
expression - the expression.
Since:
0.12
checkRedundantImplementedInterfaces(SarlClass)
def checkRedundantImplementedInterfaces(SarlClass)
Check if implemented interfaces of a Xtend Class are redundant.
Parameters:
xtendClass - the class.
checkRedundantImplementedInterfaces(SarlInterface)
def checkRedundantImplementedInterfaces(SarlInterface)
Check if implemented interfaces of a Xtend Interface are redundant.
Parameters:
xtendInterface - the interface.
checkRedundantImplementedInterfaces(SarlSkill)
def checkRedundantImplementedInterfaces(SarlSkill)
Check if implemented interfaces of a skill are redundant.
Parameters:
skill - the skill.
checkRequiredCapacityUse(SarlRequiredCapacity)
def checkRequiredCapacityUse(SarlRequiredCapacity)
Emit a warning when the "requires" keyword is used.
Parameters:
statement - the statement to check.
checkReservedAnnotation(XtendAnnotationTarget)
def checkReservedAnnotation(XtendAnnotationTarget)
Check for reserved annotations.
Parameters:
annotationTarget - thee target to test.
checkSpaceUse(SarlSpace)
def checkSpaceUse(SarlSpace)
Space keyword is reserved.
Parameters:
space - the space to check.
checkStaticConstructorPrototype(XtendConstructor)
def checkStaticConstructorPrototype(XtendConstructor)
Check for a valid prototype of a static constructor.
Parameters:
constructor - the constructor to analyze.
checkSuperConstructor(SarlAgent)
def checkSuperConstructor(SarlAgent)
Check if the super default constructor is correctly invoked.
Parameters:
agent - the SARL element.
checkSuperConstructor(SarlBehavior)
def checkSuperConstructor(SarlBehavior)
Check if the super default constructor is correctly invoked.
Parameters:
behavior - the SARL element.
checkSuperConstructor(SarlEvent)
def checkSuperConstructor(SarlEvent)
Check if the super default constructor is correctly invoked.
Parameters:
event - the SARL element.
checkSuperConstructor(SarlSkill)
def checkSuperConstructor(SarlSkill)
Check if the super default constructor is correctly invoked.
Parameters:
skill - the SARL element.
checkSuperConstructor(XtendTypeDeclaration,EStructuralFeature,Collection<E>)
protected def checkSuperConstructor(XtendTypeDeclaration,EStructuralFeature,Collection<E>)
Check the super constructors.
Parameters:
container - the container.
feature - the syntactic feature related to the supertypes.
defaultSignatures - the signatures of the default constructors for the given container.
checkSuperType(SarlAgent)
def checkSuperType(SarlAgent)
Check if the supertype of the given agent is a subtype of Agent.
Parameters:
agent - the type to test.
checkSuperType(SarlBehavior)
def checkSuperType(SarlBehavior)
Check if the supertype of the given behavior is a subtype of Behavior.
Parameters:
behavior - the type to test.
checkSuperType(SarlEvent)
def checkSuperType(SarlEvent)
Check if the supertype of the given event is a subtype of Event.
Parameters:
event - the type to test.
checkSuperType(SarlSkill)
def checkSuperType(SarlSkill)
Check if the supertype of the given skill is a subtype of Skill.
Parameters:
skill - the type to test.
checkSuperTypes(SarlCapacity)
def checkSuperTypes(SarlCapacity)
Check if the supertype of the given capacity is a subtype of Capacity.
Parameters:
capacity - the type to test.
checkSuperTypes(XtendTypeDeclaration,EReference,List<E>,Class<T>,boolean)
protected def checkSuperTypes(XtendTypeDeclaration,EReference,List<E>,Class<T>,boolean) : int
Check the super type.
Parameters:
element - the child type.
feature - the syntactic feature related to the supertypes.
superTypes - the current super types.
expectedType - the expected root type.
onlySubTypes - if true only the subtype of the expectedType are valid; false if the expectedType is allowed.
Returns:
the count of supertypes.
checkTopElementsAreUnique(SarlScript)
def checkTopElementsAreUnique(SarlScript)
Check the top elements within a script are not duplicated.
Parameters:
script - the SARL script
checkUnmodifiableEventAccess(SarlBehaviorUnit)
def checkUnmodifiableEventAccess(SarlBehaviorUnit)
Check for usage of the event functions in the behavior units.
Parameters:
unit - the unit to analyze.
checkUnsynchronizedField(XtendField)
def checkUnsynchronizedField(XtendField)
Check if a field needs to be synchronized.
Parameters:
field - the field.
Since:
0.7
checkUnusedCapacities(SarlCapacityUses)
def checkUnusedCapacities(SarlCapacityUses)
Check for unused capacities.
Parameters:
uses - the capacity use declaration.
checkVariableName(XVariableDeclaration)
def checkVariableName(XVariableDeclaration)
Check if the given local variable has a valid name.
Parameters:
variable - the variable to test.
See:
SARLFeatureNameValidator
doCheckFunctionOverrides(EObject,IResolvedOperation,List<E>)
protected def doCheckFunctionOverrides(EObject,IResolvedOperation,List<E>)
Caution: This function is overridden for translating the MISSING_OVERRIDE error into a warning, and emit a warning when a return type should be specified.
getExpectedType(XExpression)
protected def getExpectedType(XExpression) : org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
getIssueSeverities(Map<K,V>,EObject)
protected def getIssueSeverities(Map<K,V>,EObject) : org.eclipse.xtext.validation.IssueSeverities
getParamTypeReferences(JvmExecutable,boolean,boolean)
protected def getParamTypeReferences(JvmExecutable,boolean,boolean) : java.util.List<E>
Retrieve the types of the formal parameters of the given JVM executable object.
Parameters:
jvmExecutable - the JVM executable.
wrapFromPrimitives - indicates if the primitive types must be wrapped to object type equivalent.
wrapToPrimitives - indicates if the object types must be wrapped to primitive type equivalent.
Returns:
the list of types.
Since:
0.8
See:
getParamTypes(JvmOperation,boolean)
getRootOfMemberFeatureCallSequence(EObject,EObject,Procedure1<Param>)
protected def getRootOfMemberFeatureCallSequence(EObject,EObject,Procedure1<Param>) : org.eclipse.xtext.xbase.XMemberFeatureCall
Replies the member feature call that is the root of a sequence of member feature calls.

While the current feature call is the actual receiver of a member feature call, and not an argument, the sequence is still active. Otherwise, the sequence is stopped.
Parameters:
leaf - the expression at the leaf of the feature call.
container - the top most container that cannot be part of the sequence. Could be null.
feedback - the function that is invoked on each discovered member feature call within the sequence. Could be null.
Returns:
the root of a member feature call sequence.
isAmbiguousCastContext(JvmTypeReference,LightweightTypeReference,LightweightTypeReference)
protected def isAmbiguousCastContext(JvmTypeReference,LightweightTypeReference,LightweightTypeReference) : boolean
Test if the enclosing cast expression is unsed in an context that make the casting operation mandatory in order to avoid ambiguity.
Parameters:
concreteSyntax - the concrete type from the SARL source code
toType - the real target type
fromType - the real from type (same as the concrete syntax type)
Returns:
true if the context of a casting operation is used for invoking a feature with some ambiguity.
isAOActiveAnnotation(XAnnotation)
protected def isAOActiveAnnotation(XAnnotation) : boolean
Replies if the given container can receive an active annotation.
Parameters:
annotation - the annotation.
Returns:
true if the annotation should be used only for OO elements.
See:
isOOActiveAnnotation(XAnnotation) , isAOActiveAnnotationReceiver(XtendTypeDeclaration)
isAOActiveAnnotationReceiver(XtendTypeDeclaration)
protected def isAOActiveAnnotationReceiver(XtendTypeDeclaration) : boolean
Replies if the given annotation is an active annotation for agent-oriented elements.
Parameters:
container - the container to test.
Returns:
true if the container could receive an active annotation.
See:
isOOActiveAnnotation(XAnnotation) , isAOActiveAnnotation(XAnnotation)
isAOConstructorContainer(XtendTypeDeclaration)
protected def isAOConstructorContainer(XtendTypeDeclaration) : boolean
Replies if the given type is an agent-oriented type that could receives a constructor declaration.
Parameters:
type - is the type to test.
Returns:
true if the given type could contain a constructor declaration.
Since:
0.12
isDefaultValuedParameterFunction(XtendFunction)
protected def isDefaultValuedParameterFunction(XtendFunction) : boolean
Replies if the given function has a default value for one of its parameters.
Parameters:
function - the function to test.
Returns:
true if one parameter has a default value.
isForbiddenActiveAnnotation(XAnnotation)
protected def isForbiddenActiveAnnotation(XAnnotation) : boolean
Replies if the given annotation is a forbidden active annotation.
Parameters:
annotation - the annotation.
Returns:
true if the annotation is forbidden.
isIgnored(String,EObject)
protected def isIgnored(String,EObject) : boolean
Replies if the given issue is ignored for the given object.
Parameters:
issueCode - the code if the issue.
currentObject - the current object.
Returns:
true if the issue is ignored.
See:
isIgnored(String)
isInitialized(JvmField)
protected def isInitialized(JvmField) : boolean
isLocallyAssigned(EObject,EObject)
protected def isLocallyAssigned(EObject,EObject) : boolean
Replies if the given object is locally assigned.

An object is locally assigned when it is the left operand of an assignment operation.
Parameters:
target - the object to test.
containerToFindUsage - the container in which the usages should be find.
Returns:
true if the given object is assigned.
Since:
0.7
isOOActiveAnnotation(XAnnotation)
protected def isOOActiveAnnotation(XAnnotation) : boolean
Replies if the given annotation is an active annotation for object-oriented elements.
Parameters:
annotation - the annotation.
Returns:
true if the annotation should be used only for OO elements.
See:
isAOActiveAnnotation(XAnnotation)
isOOType(XtendTypeDeclaration)
protected def isOOType(XtendTypeDeclaration) : boolean
Replies if the given element is an object oriented type.
Parameters:
type - the type to test.
Returns:
true if the type is an object oriented type.
isTypeFreeExpression(XExpression)
protected def isTypeFreeExpression(XExpression) : boolean
Replies if the given expression has no specific type.
Parameters:
expression - the expression to test
Returns:
true if the given expression cannot have a specific type.
isValueExpectedRecursive(XExpression)
protected def isValueExpectedRecursive(XExpression) : boolean
reportCastWarnings(JvmTypeReference,LightweightTypeReference,LightweightTypeReference)
protected def reportCastWarnings(JvmTypeReference,LightweightTypeReference,LightweightTypeReference)
Report the warnings associated to the casted expressions.
Parameters:
concreteSyntax - the type specified into the casted expression.
toType - the type specified into the casted expression.
fromType - the type of the source expression.
toLightweightTypeReference(JvmType,EObject)
protected def toLightweightTypeReference(JvmType,EObject) : org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference
Create a lightweight type reference from the given type.
Parameters:
type - the type to point to.
context - the context in which the reference is located.
Returns:
the reference.
validateInferredType(JvmTypeReference,XtendMember,String,EAttribute)
protected def validateInferredType(JvmTypeReference,XtendMember,String,EAttribute)
This function is overridden in order to add "isIgnore" invocation.