Package eu.admire.dispel.variables

Examples of eu.admire.dispel.variables.LocalVariable


    // VARIABLE:
    LocalVariableStatement statement = StatementsFactory.eINSTANCE
        .createLocalVariableStatement();

    LocalVariable variable = VariablesFactory.eINSTANCE
        .createLocalVariable();

    statement.setVariable(variable);

    variable.setTypeReference(ref1);
    variable.setName("new_variable");
    variable.setInitialValue(ex1);

    variable.setValue(peInstance);

    // iFOnew

    ArrayList<DispelType> tDefinitions = new ArrayList<DispelType>(
        pck.getTypeDefinitions());
View Full Code Here


          .getContainingPackage();

      eu.admire.dispel.containers.DispelFunction fnc = call
          .getContainingMethod();

      LocalVariable var = getContainedLocalVariable(call);

      if ((call.getTypeReference() instanceof DispelTypeReference)
          && var != null) {

        DispelTypeReference ref = (DispelTypeReference) call
            .getTypeReference();

        if (!(ref.getTarget() instanceof ProcessingElementDefinition)) {

          resource.addProblem(new IDispelProblem() {

            public DispelEProblemType getType() {
              return DispelEProblemType.ANALYSIS_PROBLEM;
            }

            public String getMessage() {
              return "Only Processing Element can be instantiated";
            }

            public Collection<IDispelQuickFix> getQuickFixes() {
              return null;
            }

            public DispelEProblemSeverity getSeverity() {
              return DispelEProblemSeverity.ERROR;
            }
          }, call);

        }

        if (ref != null
            && ref.getTarget() instanceof ProcessingElementDefinition) {

          ProcessingElementDefinition pe = (ProcessingElementDefinition) ref
              .getTarget();

          if (pe != null && !pe.eIsProxy()) {

            ProcessingElementInstance instance = pe
                .createInstance();

            var.setValue(instance);

            if (!instance.getNamespaces().isEmpty()) {

              if (fnc != null)
                fnc.getProcessingElementInstances().add(
View Full Code Here

  public static List<DispelNodeDescriptor> getLocalVariable_3001SemanticChildren(
      View view) {
    if (!view.isSetElement()) {
      return Collections.emptyList();
    }
    LocalVariable modelElement = (LocalVariable) view.getElement();
    LinkedList<DispelNodeDescriptor> result = new LinkedList<DispelNodeDescriptor>();
    {
      Expression childElement = modelElement.getInitialValue();
      int visualID = DispelVisualIDRegistry.getNodeVisualID(view,
          childElement);
      if (visualID == BooleanLiteralEditPart.VISUAL_ID) {
        result.add(new DispelNodeDescriptor(childElement, visualID));
      }
View Full Code Here

    }
    LocalVariableStatement modelElement = (LocalVariableStatement) containerView
        .getElement();
    LinkedList<DispelNodeDescriptor> result = new LinkedList<DispelNodeDescriptor>();
    {
      LocalVariable childElement = modelElement.getVariable();
      int visualID = DispelVisualIDRegistry.getNodeVisualID(view,
          childElement);
      if (visualID == LocalVariableEditPart.VISUAL_ID) {
        result.add(new DispelNodeDescriptor(childElement, visualID));
      }
View Full Code Here

    }
    View containerView = (View) view.eContainer();
    if (!containerView.isSetElement()) {
      return Collections.emptyList();
    }
    LocalVariable modelElement = (LocalVariable) containerView.getElement();
    LinkedList<DispelNodeDescriptor> result = new LinkedList<DispelNodeDescriptor>();
    {
      Expression childElement = modelElement.getInitialValue();
      int visualID = DispelVisualIDRegistry.getNodeVisualID(view,
          childElement);
      if (visualID == StringReferenceEditPart.VISUAL_ID) {
        result.add(new DispelNodeDescriptor(childElement, visualID));
      }
    }
    //TODO: iFO     

    ProcessingElementInstance childElement = (ProcessingElementInstance) modelElement
        .getValue();

    if (childElement != null) {

      int visualID = DispelVisualIDRegistry.getNodeVisualID(view,
View Full Code Here

  /**
   * @generated
   */
  public static List<DispelLinkDescriptor> getLocalVariable_3001IncomingLinks(
      View view) {
    LocalVariable modelElement = (LocalVariable) view.getElement();
    Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
        .find(view.eResource().getResourceSet().getResources());
    LinkedList<DispelLinkDescriptor> result = new LinkedList<DispelLinkDescriptor>();
    result.addAll(getIncomingTypeModelFacetLinks_ConnectionExpression_4001(
        modelElement, crossReferences));
View Full Code Here

  /**
   * @generated
   */
  public static List<DispelLinkDescriptor> getLocalVariable_3001OutgoingLinks(
      View view) {
    LocalVariable modelElement = (LocalVariable) view.getElement();
    LinkedList<DispelLinkDescriptor> result = new LinkedList<DispelLinkDescriptor>();
    result.addAll(getOutgoingTypeModelFacetLinks_ConnectionExpression_4001(modelElement));
    return result;
  }
View Full Code Here

  /**
   * @generated
   */
  public void init_LocalVariableStatement_2001(LocalVariableStatement instance) {
    try {
      LocalVariable newInstance_0_0 = VariablesFactory.eINSTANCE
          .createLocalVariable();
      instance.setVariable(newInstance_0_0);
      newInstance_0_0.setName("variable_name");
      String newInstance_0_0_1_0 = TypesFactory.eINSTANCE.createString();
      newInstance_0_0.setTypeReference(newInstance_0_0_1_0);
      newInstance_0_0_1_0.getComments().add("");

    } catch (RuntimeException e) {
      DispelDiagramEditorPlugin.getInstance().logError(
          "Element initialization failed", e); //$NON-NLS-1$           
View Full Code Here

    ref2.setTarget(peDef);

    // The variable we are setting to the PE.
    LocalVariableStatement statement = StatementsFactory.eINSTANCE
        .createLocalVariableStatement();
    LocalVariable variable = VariablesFactory.eINSTANCE
        .createLocalVariable();
    statement.setVariable(variable);

    variable.setTypeReference(ref1);
    variable.setName(peName);
    variable.setInitialValue(p.getLeft());
    variable.setValue(peInstance);

    // Think Ivan recently added this to deal with arrays of PEs.

    ArrayList<DispelType> tDefinitions = new ArrayList<DispelType>(
        pck.getTypeDefinitions());
View Full Code Here

    public static LocalVariableStatement wrapCIinLVS(
        ConnectionInitialization ci, Resource r) {
     
      LocalVariableStatement statement = StatementsFactory.eINSTANCE
        .createLocalVariableStatement();
    LocalVariable variable = VariablesFactory.eINSTANCE
        .createLocalVariable();
    statement.setVariable(variable);

    Stream streamType = TypesFactory.eINSTANCE.createStream();
    Pair <AssignmentExpression, SuffixUnaryModificationExpression> p =
            Utility.createAssToSuffUModExpressionChain();
    p.getRight().setChild(ci);
   
    variable.setTypeReference(streamType);
    variable.setName(generateUniqueVariableName(r, "newVar"));
    variable.setInitialValue(p.getLeft());
       
        return statement;
    }
View Full Code Here

TOP

Related Classes of eu.admire.dispel.variables.LocalVariable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.