Package com.hpctoday.fada

Examples of com.hpctoday.fada.Assignment


          IASTUnaryExpression unOperand1 = (IASTUnaryExpression)operand1;
          operand1 = unOperand1.getOperand();
        }
       
        if(operand1 instanceof IASTIdExpression){
          Statement stmt = new Statement(new Assignment (operand1.getRawSignature(),rhs));
          if(inElse) parent.Enclose(stmt, true);
          else parent.Enclose(stmt, false);
        }
        else if (operand1 instanceof IASTArraySubscriptExpression) {
          ArrayAccessVisitor aVisitor = new ArrayAccessVisitor();
          operand1.accept(aVisitor);
          List<Expression> flist = aVisitor.indices;
          Collections.reverse(flist);
         
          Statement stmt = new Statement(new Assignment (aVisitor.id, new FADA_Index(flist), rhs));

          if(inElse) parent.Enclose(stmt, true);
          else parent.Enclose(stmt, false);
        } else {
         
          //bexpr.getOperand1().accept(lhsVisitor);
          //FadaExpression lhs = lhsVisitor.getExpr();
         
         
          System.err.println("StmtVisitor.visit: unknown binary operand " + bexpr.getOperand1() + " " +  expr.getRawSignature());
         
        }
      } else {
        System.err.println("StmtVisitor.visit: unknown binary expression " + expr.getRawSignature());
      }
    } else if(expr instanceof IASTUnaryExpression){
      visit((IASTUnaryExpression)expr);
     
    } else if (expr instanceof IASTFunctionCallExpression){
      ExprVisitor visitor = new ExprVisitor();
      expr.accept(visitor);
     
      Statement stmt = new Statement(new Assignment ("", visitor.getExpr()));
      if(inElse) parent.Enclose(stmt, true);
      else parent.Enclose(stmt, false);
    } else {
      System.err.println("StmtVisitor.visit: unknown expression (" + expr.getClass() + ") " + expr.getRawSignature() );
    }
View Full Code Here


          ((IASTUnaryExpression) expr).getOperand().accept(lhsVisitor);
          Expression lhsExpr = lhsVisitor.getExpr();
          String lhs = lhsExpr.Generate_C_Code();
         
          Expression rhs = lhsExpr.add(1);
          Statement stmt = new Statement(new Assignment (lhs, rhs));
 
          if(inElse) parent.Enclose(stmt, true);
          else parent.Enclose(stmt, false);
        }
        break;
      case IASTUnaryExpression.op_prefixDecr:
      case IASTUnaryExpression.op_postFixDecr:
        {
          ExprVisitor lhsVisitor = new ExprVisitor();
          ((IASTUnaryExpression) expr).getOperand().accept(lhsVisitor);
          Expression lhsExpr = lhsVisitor.getExpr();
          String lhs = lhsExpr.Generate_C_Code();
         
          Expression rhs = lhsExpr.add(1);
          Statement stmt = new Statement(new Assignment (lhs, rhs));
 
          if(inElse) parent.Enclose(stmt, true);
          else parent.Enclose(stmt, false);
        }
        break;
View Full Code Here

          exp.accept(visitor);
          
          List<Expression> arguments = new ArrayList<Expression>();
          arguments.add(visitor.getExpr());
          Expression retExp = new Expression(Expression.Leaf.FADA_function, "return", arguments);
          Statement retStmt = new Statement(new Assignment ("", retExp));
          AST.Enclose(retStmt, false);
        }
      } else {
        System.err.println("FadaVisitor Unknown Statement: [" + stmt.getClass() + "] " + stmt.getRawSignature());
      }
View Full Code Here

TOP

Related Classes of com.hpctoday.fada.Assignment

Copyright © 2015 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.