Examples of OCLTreeExpressionFindObjectVisitor


Examples of net.sf.parteg.base.testcasegraph.ocl.parser.OCLTreeExpressionFindObjectVisitor

        in_oOpExp.setRight(
            negateArithmeticalTCGOCLExpression(in_oOpExp.getRight()));
      }
      else {
        TCGOCLOperation oOpLeftExp = (TCGOCLOperation)in_oOpExp.getLeft();
        OCLTreeExpressionFindObjectVisitor oVisitor =
          new OCLTreeExpressionFindObjectVisitor(in_oVariable);
        OCLTreeExpressionIterator.run(oOpLeftExp.getLeft(), oVisitor);
        // try to shift the variable to the left side of the left expression
        // variable is on local right side of the left expression
        // -> exchange on left hand side left and right
        if(!oVisitor.isFound()) {
          // exchange sides
          TCGOCLExpression oLeftSide = oOpLeftExp.getLeft();
          oOpLeftExp.setLeft(oOpLeftExp.getRight());
          oOpLeftExp.setRight(oLeftSide);
         
          // influence relation operator correspondingly
          if(oOpLeftExp.getOperationName().equals("+") ||
              oOpLeftExp.getOperationName().equals("*")) {
            // nothing - written just for completeness
          }
          else if(oOpLeftExp.getOperationName().equals("-")) {
            in_oOpExp.setOperationName(
                sm_colCorrespondingRelations.get(
                    in_oOpExp.getOperationName()));
            in_oOpExp.setRight(
                TCGOCLExpressionHelperClass.negateArithmeticalTCGOCLExpression(
                    in_oOpExp.getRight()));
          }
          else if(oOpLeftExp.getOperationName().equals("/"))
          {
            // TODO #### Fallunterscheidung einbauen und evtl. mehrere m�gliche
            // Ausdr�cke zur�ckgeben
          }
          // check again
          OCLTreeExpressionIterator.run(oOpLeftExp.getLeft(), oVisitor);
        }
       
        // not "else" -> value is computed again at the last statement
       
        // variable is on local left side of the left expression
        // -> transfer local right side of left expression to the right expression
        if(oVisitor.isFound()) {
          TCGOCLExpression oLeftSide = oOpLeftExp.getLeft();
          oOpLeftExp.setLeft(in_oOpExp.getRight());
          in_oOpExp.setRight(oOpLeftExp);
          in_oOpExp.setLeft(oLeftSide);
          // exclude the case that we work with an unary minus or a not
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.ocl.parser.OCLTreeExpressionFindObjectVisitor

      {
        TCGOCLOperation oOpExp = (TCGOCLOperation)oExp;
        if(oOpExp.getLeft() != null)
        {
          // first step: get variable on the left side
          OCLTreeExpressionFindObjectVisitor oVisitor =
            new OCLTreeExpressionFindObjectVisitor(in_oShiftedExpression);
          OCLTreeExpressionIterator.run(oOpExp.getLeft(), oVisitor);
          // variable was not found on the left-hand side -> exchange both sides of the expression
          if(!oVisitor.isFound())
          {
            exchangeSidesOfExpression(oOpExp);
          }
         
          // variable is now on the left side -> now handle all mathematical expressions to isolate variable
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.