/** Check if all the fields are initialized in a SARL behavior. * * @param behavior the behavior. */ @Check public void checkFinalFieldInitialization(SarlBehavior behavior) { final JvmGenericType inferredType = this.associations.getInferredType(behavior); if (inferredType != null) { checkFinalFieldInitialization(inferredType); } }
/** Check if all the fields are initialized in a SARL skill. * * @param skill the skill. */ @Check public void checkFinalFieldInitialization(SarlSkill skill) { final JvmGenericType inferredType = this.associations.getInferredType(skill); if (inferredType != null) { checkFinalFieldInitialization(inferredType); } }
/** Check if all the fields are initialized in a SARL agent. * * @param agent the agent. */ @Check public void checkFinalFieldInitialization(SarlAgent agent) { final JvmGenericType inferredType = this.associations.getInferredType(agent); if (inferredType != null) { checkFinalFieldInitialization(inferredType); } }
/** Check if all the fields are initialized in a SARL event. * * @param event the event. */ @Check public void checkFinalFieldInitialization(SarlEvent event) { final JvmGenericType inferredType = this.associations.getInferredType(event); if (inferredType != null) { checkFinalFieldInitialization(inferredType); } }
/** Generate the given object. * * @param enumeration the enumeration. * @param context the context. */ protected void _generate(SarlEnumeration enumeration, IExtraLanguageGeneratorContext context) { final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(enumeration); final PyAppendable appendable = createAppendable(jvmType, context); if (generateEnumerationDeclaration(enumeration, appendable, context)) { final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(enumeration); writeFile(name, appendable, context); } }
private InferredPrototype getInferredPrototype(XtendFunction operation) { final JvmIdentifiableElement container = this.associations.getInferredType(operation.getDeclaringType()); final QualifiedActionName actionKey = this.actionPrototypes.createQualifiedActionName( container, operation.getName()); // Compute the different action prototypes associated to the action to create. final boolean isVarArgs = Utils.isVarArg(operation.getParameters()); return this.actionPrototypes.createPrototypeFromSarlModel( actionKey, isVarArgs, operation.getParameters()); }
EStructuralFeature feature, Collection<ActionParameterTypes> defaultSignatures) { final JvmDeclaredType jvmElement = this.associations.getInferredType(container); if (jvmElement != null) { final Map<ActionParameterTypes, JvmConstructor> superConstructors =
boolean onlySubTypes) { int nbSuperTypes = 0; final JvmDeclaredType inferredType = this.associations.getInferredType(element); if (inferredType instanceof JvmGenericType) { final LinkedList<JvmTypeReference> inferredSuperTypes = CollectionLiterals.newLinkedList();
/** Generate the given object. * * @param annotation the annotation. * @param context the context. */ protected void _generate(SarlAnnotationType annotation, IExtraLanguageGeneratorContext context) { final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(annotation); final PyAppendable appendable = createAppendable(jvmType, context); if (generateTypeDeclaration( this.qualifiedNameProvider.getFullyQualifiedName(annotation).toString(), annotation.getName(), false, Collections.emptyList(), getTypeBuilder().getDocumentation(annotation), true, annotation.getMembers(), appendable, context, null)) { final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(annotation); writeFile(name, appendable, context); } }
/** Generate the given object. * * @param capacity the capacity. * @param context the context. */ protected void _generate(SarlCapacity capacity, IExtraLanguageGeneratorContext context) { final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(capacity); final PyAppendable appendable = createAppendable(jvmType, context); final List<? extends JvmTypeReference> superTypes; if (!capacity.getExtends().isEmpty()) { superTypes = capacity.getExtends(); } else { superTypes = Collections.singletonList(getTypeReferences().getTypeForName(Capacity.class, capacity)); } if (generateTypeDeclaration( this.qualifiedNameProvider.getFullyQualifiedName(capacity).toString(), capacity.getName(), true, superTypes, getTypeBuilder().getDocumentation(capacity), true, capacity.getMembers(), appendable, context, null)) { final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(capacity); writeFile(name, appendable, context); } }
/** Generate the given object. * * @param event the event. * @param context the context. */ protected void _generate(SarlEvent event, IExtraLanguageGeneratorContext context) { final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(event); final PyAppendable appendable = createAppendable(jvmType, context); final List<JvmTypeReference> superTypes; if (event.getExtends() != null) { superTypes = Collections.singletonList(event.getExtends()); } else { superTypes = Collections.singletonList(getTypeReferences().getTypeForName(Event.class, event)); } if (generateTypeDeclaration( this.qualifiedNameProvider.getFullyQualifiedName(event).toString(), event.getName(), event.isAbstract(), superTypes, getTypeBuilder().getDocumentation(event), true, event.getMembers(), appendable, context, null)) { final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(event); writeFile(name, appendable, context); } }
/** Generate the given object. * * @param behavior the behavior. * @param context the context. */ protected void _generate(SarlBehavior behavior, IExtraLanguageGeneratorContext context) { final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(behavior); final PyAppendable appendable = createAppendable(jvmType, context); final List<JvmTypeReference> superTypes; if (behavior.getExtends() != null) { superTypes = Collections.singletonList(behavior.getExtends()); } else { superTypes = Collections.singletonList(getTypeReferences().getTypeForName(Behavior.class, behavior)); } final String qualifiedName = this.qualifiedNameProvider.getFullyQualifiedName(behavior).toString(); if (generateTypeDeclaration( qualifiedName, behavior.getName(), behavior.isAbstract(), superTypes, getTypeBuilder().getDocumentation(behavior), true, behavior.getMembers(), appendable, context, (it, context2) -> { generateGuardEvaluators(qualifiedName, it, context2); })) { final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(behavior); writeFile(name, appendable, context); } }
/** Generate the given object. * * @param agent the agent. * @param context the context. */ protected void _generate(SarlAgent agent, IExtraLanguageGeneratorContext context) { final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(agent); final PyAppendable appendable = createAppendable(jvmType, context); final List<JvmTypeReference> superTypes; if (agent.getExtends() != null) { superTypes = Collections.singletonList(agent.getExtends()); } else { superTypes = Collections.singletonList(getTypeReferences().getTypeForName(Agent.class, agent)); } final String qualifiedName = this.qualifiedNameProvider.getFullyQualifiedName(agent).toString(); if (generateTypeDeclaration( qualifiedName, agent.getName(), agent.isAbstract(), superTypes, getTypeBuilder().getDocumentation(agent), true, agent.getMembers(), appendable, context, (it, context2) -> { generateGuardEvaluators(qualifiedName, it, context2); })) { final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(agent); writeFile(name, appendable, context); } }
/** Generate the given object. * * @param skill the skill. * @param context the context. */ protected void _generate(SarlSkill skill, IExtraLanguageGeneratorContext context) { final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(skill); final PyAppendable appendable = createAppendable(jvmType, context); List<JvmTypeReference> superTypes = getSuperTypes(skill.getExtends(), skill.getImplements()); if (superTypes.isEmpty()) { superTypes = Collections.singletonList(getTypeReferences().getTypeForName(Skill.class, skill)); } final String qualifiedName = this.qualifiedNameProvider.getFullyQualifiedName(skill).toString(); if (generateTypeDeclaration( qualifiedName, skill.getName(), skill.isAbstract(), superTypes, getTypeBuilder().getDocumentation(skill), true, skill.getMembers(), appendable, context, (it, context2) -> { generateGuardEvaluators(qualifiedName, it, context2); })) { final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(skill); writeFile(name, appendable, context); } }
/** Generate the given object. * * @param interf the interface. * @param context the context. */ protected void _generate(SarlInterface interf, IExtraLanguageGeneratorContext context) { final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(interf); final PyAppendable appendable = createAppendable(jvmType, context); if (generateTypeDeclaration( this.qualifiedNameProvider.getFullyQualifiedName(interf).toString(), interf.getName(), true, interf.getExtends(), getTypeBuilder().getDocumentation(interf), true, interf.getMembers(), appendable, context, null)) { final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(interf); writeFile(name, appendable, context); } }
/** Generate the given object. * * @param clazz the class. * @param context the context. */ protected void _generate(SarlClass clazz, IExtraLanguageGeneratorContext context) { final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(clazz); final PyAppendable appendable = createAppendable(jvmType, context); if (generateTypeDeclaration( this.qualifiedNameProvider.getFullyQualifiedName(clazz).toString(), clazz.getName(), clazz.isAbstract(), getSuperTypes(clazz.getExtends(), clazz.getImplements()), getTypeBuilder().getDocumentation(clazz), true, clazz.getMembers(), appendable, context, null)) { final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(clazz); writeFile(name, appendable, context); } }