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

Examples of org.eclipse.php.internal.core.compiler.ast.nodes.FullyQualifiedReference


    }
    for (TypeReference interf : interfaces) {
     
      if (interf instanceof FullyQualifiedReference) {
       
        FullyQualifiedReference fqr = (FullyQualifiedReference) interf;
        String name = null;
        // we have a namespace
        if (fqr.getNamespace() != null) {
          name = fqr.getNamespace().getName() + BACK_SLASH + fqr.getName();
        } else {
          IEvaluatedType eval = PHPTypeInferenceUtils.resolveExpression(sourceModule, fqr);
          name = eval.getTypeName();
          if (eval.getTypeName().startsWith(BACK_SLASH)) {
            name = eval.getTypeName().replaceFirst("\\\\", "");
          }         
        }
       
        if (name == null) {
          continue;
        }
        IType[] types;
       
        if (PDTModelUtils.findType(sourceModule, name) != null) {
          types = new IType[] {PDTModelUtils.findType(sourceModule, name)};
        } else {
          types = model.findTypes(name, MatchRule.EXACT, 0, 0, scope, new NullProgressMonitor());
        }
       
        if (types.length != 1) {
          continue;
        }
       
        IType type = types[0];
       
       
        try {
          for (IMethod method : type.getMethods()) {

            boolean implemented = false;
            String methodSignature = PDTModelUtils.getMethodSignature(method);
            if (methodSignature == null) {
              continue;
            }
           
            IMethod[] ms = PHPModelUtils.getTypeMethod(classType, method.getElementName(), true);
           
            for (IMethod me : ms) {
              if (me.getParent().getElementName().equals(fqr.getName())) {
                continue;
              }
              if (!PHPFlags.isAbstract(me.getFlags())) {
                implemented = true;
              }
View Full Code Here


      return true;
    }

    if (s.getParameterType() instanceof FullyQualifiedReference) {

      FullyQualifiedReference fqr = (FullyQualifiedReference) s
          .getParameterType();
      if (!isResolved(fqr)) {
        context.registerProblem(PEXProblemIdentifier.USAGE_RELATED, String.format(MESSAGE_CANNOT_RESOLVE_TYPE, s
            .getParameterType().getName()), s.getParameterType().sourceStart(), s.getParameterType().sourceEnd());
      }
View Full Code Here

 
  @Override
  public boolean visit(StaticConstantAccess s) throws Exception {
    if (s.getDispatcher() instanceof FullyQualifiedReference) {

      FullyQualifiedReference fqr = (FullyQualifiedReference) s
          .getDispatcher();

      if (!"self".equals(fqr.getName()) //$NON-NLS-1$
          && !"static".equals(fqr.getName())) { //$NON-NLS-1$
        markIfNotExists(fqr);
      }
    }

    return true;
View Full Code Here

  }

  @Override
  public boolean visit(StaticFieldAccess s) throws Exception {
    if (s.getDispatcher() instanceof FullyQualifiedReference) {
      FullyQualifiedReference fqr = (FullyQualifiedReference) s
          .getDispatcher();

      if ("self".equals(fqr.getName()) || "static".equals(fqr.getName())) { //$NON-NLS-1$ //$NON-NLS-2$
        return true;
      }
     
      markIfNotExists(fqr);
    }
View Full Code Here

  }

  @Override
  public boolean visit(StaticMethodInvocation s) throws Exception {
    if (s.getReceiver() instanceof FullyQualifiedReference) {
      FullyQualifiedReference fqr = (FullyQualifiedReference) s
          .getReceiver();
      String fqn = fqr.getFullyQualifiedName();

      if ("parent".equals(fqn) || "self".equals(fqn)
          || "static".equals(fqn)) {
        return true;
      }
View Full Code Here

                  SimpleReference reference = null;
                  if (node instanceof SimpleReference) {
                    reference = (SimpleReference) node;
                    String typeName = reference.getName();
                    if (reference instanceof FullyQualifiedReference) {
                      FullyQualifiedReference ref = (FullyQualifiedReference) node;
                      namespace = ref.getNamespace();
                    }
                    if (namespace != null
                        && !namespace.getName().equals(
                            "")) { //$NON-NLS-1$
                      String nsName = namespace.getName();
View Full Code Here

            if (argument instanceof FormalParameter) {
                FormalParameter param = (FormalParameter) argument;

                if (param.getParameterType() instanceof FullyQualifiedReference) {

                    FullyQualifiedReference ref = (FullyQualifiedReference) param.getParameterType();
                    NamespaceReference nsRef = createFromFQCN(ref);

                    if (nsRef != null) {
                        TemplateVariable tempVar= new TemplateVariable(currentMethod, param.getName(), param.sourceStart(), param.sourceEnd(), nsRef.namespace, nsRef.className);
                        deferredVariables.push(tempVar);
View Full Code Here

                    ClassInstanceCreation instance = (ClassInstanceCreation) value;

                    if (instance.getClassName().getClass() == FullyQualifiedReference.class) {

                        FullyQualifiedReference fqcn = (FullyQualifiedReference) instance.getClassName();
                        NamespaceReference nsRef = createFromFQCN(fqcn);

                        if (nsRef != null) {
                            TemplateVariable variable = new TemplateVariable(currentMethod, varName.getValue(),
                                    varName.sourceStart(), varName.sourceEnd(), nsRef.getNamespace(), nsRef.getClassName());
View Full Code Here

                    ClassInstanceCreation instance = (ClassInstanceCreation) s.getValue();

                    if (instance.getClassName().getClass() == FullyQualifiedReference.class) {

                        FullyQualifiedReference fqcn = (FullyQualifiedReference) instance.getClassName();
                        NamespaceReference nsRef = createFromFQCN(fqcn);

                        if (nsRef != null) {
                            TemplateVariable variable = new TemplateVariable(currentMethod, var.getName(),
                                    var.sourceStart(), var.sourceEnd(), nsRef.getNamespace(), nsRef.getClassName());
View Full Code Here

            currentClass = (ClassDeclaration) s;
            for (Object o : currentClass.getSuperClasses().getChilds()) {

                if (o instanceof FullyQualifiedReference) {

                    FullyQualifiedReference superReference = (FullyQualifiedReference) o;

                    //TODO: find a way to check against the FQCN
                    // via the UseStatement
                    if (/*superReference.getNamespace().equals(SymfonyCoreConstants.CONTROLLER_NS)
                            && */superReference.getName().equals(SymfonyCoreConstants.CONTROLLER_CLASS)) {

                        // the ControllerIndexer does the actual work of parsing the
                        // the relevant elements inside the controller
                        // which are then being collected in the endVisit() method
                        inController = true;
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.compiler.ast.nodes.FullyQualifiedReference

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.