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

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


   
    return true;
  }

  public boolean visit(Variable variable) {
    Expression name = variable.getName();

    if (name.getType() == ASTNode.IDENTIFIER
        && variable.isDollared()
        // skip self::$var
        && variable.getParent().getType() != ASTNode.STATIC_FIELD_ACCESS
        // skip $this->var
        && variable.getParent().getType() != ASTNode.FIELD_ACCESS
View Full Code Here


  @Override
  public boolean hasAssists(IInvocationContext context) throws CoreException {
    if (context.getCoveringNode() == null) {
      return false;
    }
    final Expression mainExpression = AssignToLocalCompletionProposal.getMainExpression(context.getCoveringNode());
    if (mainExpression == null) {
      return false;
    }
   
    switch (mainExpression.getType()) {
    case ASTNode.METHOD_INVOCATION:
    case ASTNode.STATIC_METHOD_INVOCATION:
    case ASTNode.FUNCTION_INVOCATION:
    case ASTNode.CLASS_INSTANCE_CREATION:
      return true;
View Full Code Here

   
    for(ParameterInfo parameter : fExtractedMethodParameters)
    {
      FormalParameter formalParameter = new FormalParameter(ast);
     
      Expression variable = ast.newVariable(parameter.getParameterName());
     
      if(passByReference(parameter.getParameterName())) {
        variable = ast.newReference(variable);
      }
     
View Full Code Here

    for(Variable var : fMethodVariables)
    {
      // covers 5.
      if (SourceRangeUtil.covers(selectedRange, var)) {
        for (FormalParameter methodParameter : fMethodParameters) {
          Expression parameterName = methodParameter.getParameterName();
          if (parameterName instanceof Reference) {
            if (areTheSameVariables((Variable) ((Reference) parameterName).getExpression(),var)) {
              addMethodReturnValue(var);
              break;
            }
View Full Code Here

      } catch(ClassCastException exp) {
        continue;
      }
     
     
      Expression value = assignment.getRightHandSide();
     
      if(value instanceof ClassInstanceCreation) {
        lastObjectAssignment = (Variable) assignment.getLeftHandSide();
      } else {
        lastObjectAssignment = null;
View Full Code Here

  protected ASTRewrite getRewrite() throws CoreException {
    LinkedProposalModel linkedModel = getLinkedProposalModel();
    TextEditGroup editGroup = new TextEditGroup(ASSIGN_TO_LOCAL_ID);
 
    ExpressionStatement statement = getStatement(context);
    Expression expression = statement.getExpression();
   
    AST ast = statement.getAST();
    ASTRewrite astRewrite = ASTRewrite.create(ast);
    String[] names = possibleNames(expression);
    for (int i = 0; i < names.length; i++) {
View Full Code Here

      throws CoreException, Exception {
    Program program = createAndParse(content);

    // locate the expression to test
    int indexOf = locateElement(content, fromIndex);
    Expression expr = (Expression) program.getElementAt(indexOf);

    // resolve binding of the expression
    ITypeBinding type = expr.resolveTypeBinding();
    return type;
  }
View Full Code Here

              desc
                  + " test fails. offset should locate an expression node was "
                  + locateNode.getClass().getName(),
              locateNode instanceof Expression);

          Expression expression = (Expression) locateNode;
          final boolean actualStaticScalar = expression
              .isStaticScalar();

          Assert.assertTrue(desc + " test fails. Expression"
              + locateNode.toString() + " should "
              + (!expectedStaticScalar ? "not" : "")
View Full Code Here

     * org.eclipse.php.internal.ui.editor.SemanticHighlighting#consumesLiteral
     * (org.eclipse.php.internal.ui.editor.SemanticToken)
     */
    @Override
    public boolean consumesLiteral(SemanticToken token) {
      final Expression node = token.getLiteral();
      return node.isNullExpression();
    }
View Full Code Here

    return (Expression) getAssociatedNode();
  }

  public Expression createCopyTarget(ASTRewrite rewrite,
      boolean removeSurroundingParenthesis) {
    Expression node = getAssociatedExpression();
    if (removeSurroundingParenthesis
        && node instanceof ParenthesisExpression) {
      node = ((ParenthesisExpression) node).getExpression();
    }
    return (Expression) rewrite.createCopyTarget(node);
View Full Code Here

TOP

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

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.