コード例 #1
0
  /**
   * This routine performs the action associated with a matrix cell. The parameters represent model
   * instances aquired based on the specifed column instance and row instance.
   *
   * @param columnInstance Model instance from the column
   * @param rowInstance Model instance from the row
   * @return TODO
   * @throws RecognitionException TODO
   * @throws TokenStreamException TODO
   */
  String T_TLVD_Action(String rightValue, String leftValue)
      throws RecognitionException, TokenStreamException {
    String act = "";
    String result = "";
    int leftValueDim = -1;

    // get activity type
    activity_type = selectActivityType(rightValue, leftValue);

    // set default activity name

    activity_name = ArrayBaseTest_Generics.TEST_VOID_NO_PARM;
    // get the instance number of dimension
    leftValueDim = getDimensionValue(leftValue);

    // create the variable array
    if (rightValue.equalsIgnoreCase("T1")) {
      act = "integer=1;\n";
    }
    act = act.concat(OALCodeBuilder("=integer;", leftValue, leftValueDim));

    // Action
    result = ArrayBaseTest_Generics.parseAction(act, activity_type, activity_name);

    return result;
  }
コード例 #2
0
 protected void tearDown() throws Exception {
   try {
     super.tearDown();
     ArrayBaseTest_Generics.tearDownActionData();
   } catch (RecognitionException re) {
     // do nothing
   } catch (TokenStreamException te) {
     // do nothing
   }
 }
コード例 #3
0
  /**
   * This routine performs the action associated with a matrix cell. The parameters represent model
   * instances aquired based on the specifed column instance and row instance.
   *
   * @param columnInstance Model instance from the column
   * @param rowInstance Model instance from the row
   * @return TODO
   * @throws RecognitionException TODO
   * @throws TokenStreamException TODO
   */
  String TRVD_TLVD_Action(String rightValue, String leftValue)
      throws RecognitionException, TokenStreamException {
    String act = "";
    String result = "";
    int leftValueDim = -1;
    int rightValueDim = -1;

    // get activity type
    activity_type = selectActivityType(rightValue, leftValue);

    // set default activity name
    activity_name = ArrayBaseTest_Generics.TEST_VOID_NO_PARM;

    leftValueDim = getDimensionValue(leftValue);
    rightValueDim = getDimensionValue(rightValue);

    // right side is Variable Array
    if (rightValue.contains("RV1D")) {
      act = "rightArray" + rightValueDimension[rightValueDim] + "=1;\n";
      act =
          act.concat(
              OALCodeBuilder(
                  "=rightArray" + rightValueIndexValue[rightValueDim] + ";",
                  leftValue,
                  leftValueDim));
    }
    // Right side is Attribute array
    else if (rightValue.contains("RV2D")) {

      if (rightValue.contains("D1")) {
        act = act.concat("create object instance rightValuetest of A_AO;\n");
      } else if (rightValue.contains("D3")) {
        act = act.concat("create object instance rightValuetest of A_AH;\n");
      } else {
        act = act.concat("create object instance rightValuetest of A_AT;\n");
      }
      act =
          act.concat(
              OALCodeBuilder(
                  "=rightValuetest.array" + rightValueIndexValue[rightValueDim] + ";",
                  leftValue,
                  leftValueDim));
    }
    // right side is Function/Operation/Bridge/Interface Operation parameter
    else if (rightValue.contains("RV3D")
        || rightValue.contains("RV4D")
        || rightValue.contains("RV5D")
        || rightValue.contains("RV6D")) {

      if (rightValue.contains("D1")) {
        activity_name = ArrayBaseTest_Generics.void_paramRef_int_SF_test1;
      } else if (rightValue.contains("D3")) {
        activity_name = ArrayBaseTest_Generics.void_paramRef_int_SF_test3;
      } else {
        activity_name = ArrayBaseTest_Generics.void_paramRef_int_SF_test2;
      }

      act = "\n";
      if ((leftValue.contains("LV10D"))
          || (leftValue.contains("LV9D"))
          || (leftValue.contains("LV8D"))
          || (leftValue.contains("LV11D")))
        if (rightValue.contains("D1")) {
          act =
              act.concat(
                  OALCodeBuilder(
                      "=param.array1" + rightValueIndexValue[rightValueDim] + ";",
                      leftValue,
                      leftValueDim));
        } else if (rightValue.contains("D3")) {
          act =
              act.concat(
                  OALCodeBuilder(
                      "=param.array7" + rightValueIndexValue[rightValueDim] + ";",
                      leftValue,
                      leftValueDim));
        } else {
          act =
              act.concat(
                  OALCodeBuilder(
                      "=param.array4" + rightValueIndexValue[rightValueDim] + ";",
                      leftValue,
                      leftValueDim));
        }
      else
        act =
            act.concat(
                OALCodeBuilder(
                    "=param.array" + rightValueIndexValue[rightValueDim] + ";",
                    leftValue,
                    leftValueDim));

    }
    // right side is event parameter
    else if (rightValue.contains("RV7D")) {

      if (rightValue.contains("D1")) {
        activity_name = ArrayBaseTest_Generics.State_StateOne;
      } else if (rightValue.contains("D3")) {
        activity_name = ArrayBaseTest_Generics.State_StateThree;
      } else {
        activity_name = ArrayBaseTest_Generics.State_StateTwo;
      }
      act = "\n";
      act =
          act.concat(
              OALCodeBuilder(
                  "=param.array" + rightValueIndexValue[rightValueDim] + ";",
                  leftValue,
                  leftValueDim));
      act = act.replace("voidParamRefIntSFtTest", "voidParamIntSFtTest");

    }
    // right side is function/operation/birdge/interface operation return
    // value
    else if (rightValue.contains("RV8D")
        || rightValue.contains("RV9D")
        || rightValue.contains("RV10D")
        || rightValue.contains("RV11D")) {

      act = "\n";
      String temp = "";
      if (rightValue.contains("RV8D")) {
        temp = "=A_T";
      } else if (rightValue.contains("RV10")) {
        temp = "=T";
      } else if (rightValue.contains("RV11")) {
        temp = "=Port2";
      } else {
        temp = "=";
      }

      // call the Function/Operation/Bridge/Property based on dimension
      // number
      if (rightValue.contains("D1")) {
        act = act.concat(OALCodeBuilder(temp + " ::intSFNoParamTest1();", leftValue, leftValueDim));
      } else if (rightValue.contains("D2")) {
        act = act.concat(OALCodeBuilder(temp + " ::intSFNoParamTest2();", leftValue, leftValueDim));
      } else if (rightValue.contains("D3")) {
        act = act.concat(OALCodeBuilder(temp + " ::intSFNoParamTest3();", leftValue, leftValueDim));
      }
      act = act.replace("voidParamRefIntSFtTest", "voidParamIntSFtTest");
    }

    // Action
    result = ArrayBaseTest_Generics.parseAction(act, activity_type, activity_name);
    return result;
  }