Package org.eclipse.php.internal.core.ast.nodes

Examples of org.eclipse.php.internal.core.ast.nodes.Variable


  {
    ArrayList<Expression> parameters = new ArrayList<Expression>();
   
    for(ParameterInfo parameter : fExtractedMethodParameters)
    {
      Variable variable = ast.newVariable(parameter.getParameterName());
     
      parameters.add(variable);
    }
     
    return parameters;
View Full Code Here


  private boolean isUsedAsObject(Variable var) {
   
    ISourceRange preSelectedRange = getPreSelectedRange();
    ISourceRange selectedRange = getSelectedRange();
   
    Variable lastObjectAssignment = null;
   
    // first we collect all assignments to var before the selected code.
    // and we take the last one of it, and hope that the last assignment is an object assignment
    for(Assignment assignment : fMethodAssignments)
    {
View Full Code Here

    ASTRewrite astRewrite = ASTRewrite.create(ast);
    String[] names = possibleNames(expression);
    for (int i = 0; i < names.length; i++) {
      linkedModel.getPositionGroup(KEY_NAME, true).addProposal(names[0], null, 10);
    }
    Variable variable = ast.newVariable(names[0]);
   
    Assignment assign = ast.newAssignment(variable, Assignment.OP_EQUAL, (Expression) astRewrite.createCopyTarget(expression));
    astRewrite.replace(expression, assign, editGroup);

    linkedModel.getPositionGroup(KEY_NAME, true).addPosition(astRewrite.track(variable.getName()), true);
    linkedModel.setEndPosition(astRewrite.track(statement));
   
    return astRewrite;
  }
View Full Code Here

    initialize(str);

    List<FunctionInvocation> arrayAccess = getAllOfType(program,
        FunctionInvocation.class);
    Assert.assertTrue("Unexpected list size.", arrayAccess.size() == 1);
    Variable name = ast.newVariable("world");
    name.setIsDollared(false);
    ((FunctionInvocation) arrayAccess.get(0)).getFunctionName().setName(
        name);
    rewrite();
    checkResult("<?php (new Human('Gonzalo'))->world(); ?>");
  }
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.ast.nodes.Variable

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.