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

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


        && variable.getParent().getType() != ASTNode.STATIC_FIELD_ACCESS
        // skip $this->var
        && variable.getParent().getType() != ASTNode.FIELD_ACCESS
        && isCovered(variable) && !((Identifier) name).getName().equals("this")) {
     
      IVariableBinding binding = variable.resolveVariableBinding();
     
      if(binding == null || binding.isLocal() && !binding.isGlobal()) {
        fVariables.add(variable);
      }
    }
   
    return true;
View Full Code Here


    ExpressionStatement statement = (ExpressionStatement) program
        .statements().get(3);
    Assignment assignment = (Assignment) statement.getExpression();
    FieldAccess fieldAccess = (FieldAccess) assignment.getRightHandSide();

    IVariableBinding variableBinding = fieldAccess.resolveFieldBinding();

    Assert.assertTrue(variableBinding.isField() == true);
    Assert.assertTrue(variableBinding.getName().equals("$anotherOne"));
    Assert.assertTrue(variableBinding.getKind() == IBinding.VARIABLE);
  }
View Full Code Here

    final ExpressionStatement statement = (ExpressionStatement) program
        .statements().get(2);
    final StaticFieldAccess staticFieldAcces = (StaticFieldAccess) statement
        .getExpression();
    IVariableBinding fieldBinding = staticFieldAcces.resolveFieldBinding();

    Assert.assertTrue(fieldBinding.isField() == true);
    Assert.assertTrue(fieldBinding.getName().equals("$a"));
    Assert.assertTrue(fieldBinding.getKind() == IBinding.VARIABLE);
  }
View Full Code Here

    final ExpressionStatement statement = (ExpressionStatement) program
        .statements().get(2);
    final StaticConstantAccess constantAccess = (StaticConstantAccess) statement
        .getExpression();
    IVariableBinding fieldBinding = (IVariableBinding) constantAccess
        .resolveFieldBinding();

    Assert.assertNotNull(fieldBinding);
    Assert.assertTrue(fieldBinding.isField());
  }
View Full Code Here

      res.add(new BindingProperty(this, "KEY", fBinding.getKey(), true)); //$NON-NLS-1$
      //FIXME: res.add(new BindingProperty(this, "IS RECOVERED", fBinding.isRecovered(), true)); //$NON-NLS-1$
     
      switch (fBinding.getKind()) {
        case IBinding.VARIABLE:
          IVariableBinding variableBinding= (IVariableBinding) fBinding;
          res.add(new BindingProperty(this, "IS FIELD", variableBinding.isField(), true)); //$NON-NLS-1$
          //FIXME: res.add(new BindingProperty(this, "IS ENUM CONSTANT", variableBinding.isEnumConstant(), true)); //$NON-NLS-1$
          res.add(new BindingProperty(this, "IS PARAMETER", variableBinding.isParameter(), true)); //$NON-NLS-1$
          res.add(new BindingProperty(this, "VARIABLE ID", variableBinding.getVariableId(), true)); //$NON-NLS-1$
          //FIXME: res.add(new BindingProperty(this, "MODIFIERS", Flags.toString(fBinding.getModifiers()), true)); //$NON-NLS-1$
          res.add(new Binding(this, "TYPE", variableBinding.getType(), true)); //$NON-NLS-1$
          res.add(new Binding(this, "DECLARING CLASS", variableBinding.getDeclaringClass(), true)); //$NON-NLS-1$
          //FIXME: res.add(new Binding(this, "DECLARING METHOD", variableBinding.getDeclaringMethod(), true)); //$NON-NLS-1$
          //FIXME: res.add(new Binding(this, "VARIABLE DECLARATION", variableBinding.getVariableDeclaration(), true)); //$NON-NLS-1$
          //FIXME :res.add(new BindingProperty(this, "IS SYNTHETIC", fBinding.isSynthetic(), true)); //$NON-NLS-1$
          Object constVal= variableBinding.getConstantValue();
          res.add(new BindingProperty(this, "CONSTANT VALUE", constVal == null ? "null" : constVal.toString(), true)); //$NON-NLS-1$ //$NON-NLS-2$
          break;
         
          //FIXME:
        case IBinding.PACKAGE:
View Full Code Here

    StringBuffer buf= new StringBuffer(fLabel);
    buf.append(": "); //$NON-NLS-1$
    if (fBinding != null) {
      switch (fBinding.getKind()) {
        case IBinding.VARIABLE:
          IVariableBinding variableBinding= (IVariableBinding) fBinding;
          if (!variableBinding.isField()) {
            buf.append(variableBinding.getName());
          } else if (variableBinding.getDeclaringClass() == null) {
            buf.append("array type"); //$NON-NLS-1$
          } else {
            buf.append(variableBinding.getDeclaringClass().getName());
            buf.append('.');
            buf.append(variableBinding.getName());       
          }
          break;
        /*case IBinding.PACKAGE:
          IPackageBinding packageBinding= (IPackageBinding) fBinding;
          buf.append(packageBinding.getName());
View Full Code Here

TOP

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

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.