Examples of IBinding


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

        }
        IASTNodeSelector nodeSelector= ast.getNodeSelector(null);
        IASTNode selectedNode = nodeSelector.findEnclosingNode(offset, 1);
        if (selectedNode instanceof IASTName) {
          IASTName selectedName = (IASTName) selectedNode;
          IBinding binding = selectedName.resolveBinding();
          CppToProtobufMapping info = delegate.createMappingFrom(binding);
          mappingReference.set(info);
          return OK_STATUS;
        }
        return CANCEL_STATUS;
View Full Code Here

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

   * @param binding describes the name of a C++ element.
   * @return a {@code ProtobufElementLookupInfo}, or {@code null} if the given binding does not correspond to a C++
   * element that can be traced back to a protocol buffer element.
   */
  public CppToProtobufMapping createMappingFrom(IBinding binding) {
    IBinding bindingToUse = binding;
    if (binding instanceof ProblemBinding) {
      ProblemBinding problemBinding = (ProblemBinding) binding;
      IBinding[] candidates = problemBinding.getCandidateBindings();
      if (candidates != null && candidates.length == 1) {
        bindingToUse = candidates[0];
      }
    }
    IBindingMappingStrategy<?> strategy = strategies.get(bindingToUse.getClass());
    if (strategy != null) {
      return strategy.createMappingFrom(bindingToUse);
    }
    return null;
  }
View Full Code Here

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

class TypeDefMappingStrategy implements IBindingMappingStrategy<CPPTypedef> {
  @Inject private IBindings bindings;

  @Override public CppToProtobufMapping createMappingFrom(IBinding binding) {
    CPPTypedef typeDef = typeOfSupportedBinding().cast(binding);
    IBinding owner = binding.getOwner();
    if (!bindings.isMessage(owner)) {
      return null;
    }
    String typeName = typeNameOf(typeDef);
    String typeNameSuffix = owner.getName() + "_" + typeDef.getName();
    if (typeName == null || !typeName.endsWith(typeNameSuffix)) {
      return null;
    }
    return new CppToProtobufMapping(bindings.qualifiedNameOf(typeDef), MESSAGE);
  }
View Full Code Here

Examples of org.eclipse.e4.xwt.core.IBinding

        if (UserData.hasLocalData(column,
            IUserDataConstants.XWT_PROPERTY_ITEM_TEXT_KEY)) {
          Object userDataValue = UserData.getLocalData(column,
              IUserDataConstants.XWT_PROPERTY_ITEM_TEXT_KEY);
          if (userDataValue instanceof IBinding) {
            IBinding binding = (IBinding) userDataValue;
            binding.reset();
            UserData.setDataContext(column, value);
            value = binding.getValue(null);
          } else {
            value = userDataValue;
          }
        }
        else if (UserData.hasLocalData(column,
View Full Code Here

Examples of org.eclipse.jdt.core.dom.IBinding

    if (node.getExpression() instanceof SimpleName)
    {
      SimpleName var = (SimpleName) node.getExpression();
      String varName = var.getIdentifier();

      IBinding exprBinding = var.resolveBinding();

      if ( "it".equals(varName) && exprBinding instanceof IVariableBinding ) // call on 'it' field
      {
        IVariableBinding varBinding = (IVariableBinding) exprBinding;
        IMethodBinding mockMethod = getSurroundingMockMethod(node);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.IBinding

 
  private IValue resolveType(ASTNode node) {
    try {
      if (node instanceof Expression) {
      if (node instanceof Name) {
        IBinding b = ((Name) node).resolveBinding();
        return bindingsResolver.resolveType(b, false);
      }
        ITypeBinding binding = ((Expression) node).resolveTypeBinding();
        return bindingsResolver.resolveType(binding, false);
      }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.IBinding

          matches = null;
      }
    }

    if (matches == null) {
      IBinding binding = null;
      if (selectedNode instanceof Name)
        binding = ((Name) selectedNode).resolveBinding();

      if (binding != null && markOccurrencesOfType(binding)) {
        // Find the matches && extract positions so we can forget the
View Full Code Here

Examples of org.eclipse.jdt.core.dom.IBinding

   * Example: (2 in 1java.lang.System.out.println("Hello");
   */
  public boolean visit(QualifiedName node) {
    SimpleName name = node.getName();
    Name qualifier = node.getQualifier();
    IBinding nameBinding = name.resolveBinding();
    // If this is a Field access, then add children to CFG
    if(nameBinding.getKind() == IBinding.VARIABLE) {
      IVariableBinding variableBinding = (IVariableBinding) nameBinding;
      if(variableBinding.isField()) {
        ControlFlowNode nameCFN = controlFlowNode.newControlFlowNode(name);
        ControlFlowNode qualifierCFN = controlFlowNode.newControlFlowNode(qualifier);
        controlFlowNode.moveEdges(ControlFlowNode.Direction.BACKWARDS, qualifierCFN);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.IBinding

          new EclipseSuperFieldAccess(target, eclipseVariableQuery),
          eclipseVariableQuery);
    }
    if(targetNode instanceof QualifiedName) {
      QualifiedName target = (QualifiedName) targetNode;
      IBinding binding = target.resolveBinding();
      if(binding instanceof IVariableBinding) {
        IVariableBinding vb = (IVariableBinding) binding;
        if(vb.isField()) {
          return new StoreFieldInstructionImpl(
              node,
              source,
              new EclipseBrokenFieldAccess(target, eclipseVariableQuery),
              eclipseVariableQuery);
        }
      }
    }
    if(targetNode instanceof SimpleName) {
      SimpleName target = (SimpleName) targetNode;
      IBinding binding = target.resolveBinding();
      if(binding instanceof IVariableBinding) {
        IVariableBinding vb = (IVariableBinding) binding;
        if(vb.isField()) {
          // implicit field access on this
          return new StoreFieldInstructionImpl(
View Full Code Here

Examples of org.eclipse.jdt.core.dom.IBinding

  }

  public TACInstruction create(QualifiedName node,
      IEclipseVariableQuery eclipseVariableQuery) {
    // careful with the disambiguation of field accesses
    IBinding binding = node.resolveBinding();
    if(binding instanceof IVariableBinding) {
      // expect this to be a field
      IVariableBinding var = (IVariableBinding) binding;
      if(var.isField() || var.isEnumConstant()) {
        if(isLoad(node))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.