Package org.eclipse.cdt.core.dom.ast

Examples of org.eclipse.cdt.core.dom.ast.IASTExpression


  }

  private void writeConditionalExpression(final IASTConditionalExpression condExp) {
    condExp.getLogicalConditionExpression().accept(visitor);
    scribe.print(SPACE_QUESTIONMARK_SPACE);
    final IASTExpression positiveExpression = condExp.getPositiveResultExpression();
    // gcc extension allows to omit the positive expression.
    if (positiveExpression == null) {
      scribe.print(' ');
    } else {
      positiveExpression.accept(visitor);
    }
    scribe.print(SPACE_COLON_SPACE);
    condExp.getNegativeResultExpression().accept(visitor);

  }
View Full Code Here


    }
  }

  protected void writeArrayModifier(final IASTArrayModifier modifier) {
    scribe.print('[');
    final IASTExpression ex = modifier.getConstantExpression();
    if (ex != null) {
      ex.accept(visitor);
    }
    scribe.print(']');
  }
View Full Code Here

            break;
          default:         
            System.err.println ("Operator is not handled !");
        }
       
        IASTExpression operand1 = bexpr.getOperand1();
        while(operand1 instanceof IASTUnaryExpression && ((IASTUnaryExpression)operand1).getOperator() == IASTUnaryExpression.op_bracketedPrimary){
          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));
View Full Code Here

        //CRASH HERE
        throw new RuntimeException ("PARSER CAN'T HANDLE EXCEPTION");
      }
     
      //_iterList.add(initVar);
      IASTExpression condition = ((IASTBinaryExpression) (fstmt.getConditionExpression())).getOperand2();
      //if (condition instanceof IASTIdExpression){
      //  _paramList.add(condition.getRawSignature());
      //}
     
      Control forControl = new Control(initVar,  LBExpr, UBExpr);
View Full Code Here

      } else if(stmt instanceof IASTCompoundStatement){
       
      } else if(stmt instanceof IASTReturnStatement){
        //TODO: Construct fake statement with read dependency
        IASTReturnStatement ret = (IASTReturnStatement)stmt;
        IASTExpression exp = ret.getReturnValue();
       
        if(exp != null){
          //System.err.println("FadaVisitor return expression not handled: " + stmt.getRawSignature());
          ExprVisitor visitor = new ExprVisitor();
          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));
View Full Code Here

TOP

Related Classes of org.eclipse.cdt.core.dom.ast.IASTExpression

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.