Package org.eclipse.dltk.ast.references

Examples of org.eclipse.dltk.ast.references.SimpleReference


  public IGoal[] init() {
    ExpressionTypeGoal typedGoal = (ExpressionTypeGoal) goal;
    FormalParameter parameter = (FormalParameter) typedGoal.getExpression();

    SimpleReference type = parameter.getParameterType();
    if (type != null && "array".equals(type.getName()) == false) { //$NON-NLS-1$
      result = PHPClassType.fromSimpleReference(type);
    } else {
      IContext context = typedGoal.getContext();
      if (context instanceof MethodContext) {
        MethodContext methodContext = (MethodContext) context;
View Full Code Here


                    if (varRef == null) {
                        continue;
                    }

                    SimpleReference callName = callExp.getCallName();

                    // we got the variable name (in this case $form)
                    // now search for the defferedVariable:
                    for (TemplateVariable deferred : deferredVariables) {
View Full Code Here

                        // nothing found, return
                        if (service == null || exp.getCallName() == null) {
                            return true;
                        }

                        SimpleReference callName = exp.getCallName();

                        //TODO: this is a problematic case, as during a clean build
                        // it's possible that the SourceModule in which the
                        // called method was declared is not yet in the index, so
                        // the return type cannot be evaluated and therefore
                        // the templatevariable won't be created...
                        //
                        // Possible solution: check if there's an event fired when the
                        // build is completed and store those return types in a global
                        // singleton, evaluate them when the whole build process is finished.


                        String fqsn = service.getNamespace() != null ? service.getNamespace().getQualifiedName() : null;
                        TemplateVariable tempVar = null;

                            tempVar = SymfonyModelAccess.getDefault()
                                    .createTemplateVariableByReturnType(source, currentMethod, callName,
                                            service.getClassName(), fqsn, var.getName(), cache);

                        if (tempVar != null) {

                            deferredVariables.push(tempVar);
                        }

                        // something like $formView = $form->createView();
                    } else if (exp.getReceiver().getClass() == VariableReference.class) {

                        VariableReference varRef = (VariableReference) exp.getReceiver();
                        SimpleReference ref = exp.getCallName();

                        // check for a previosly declared variable
                        for (TemplateVariable tempVar : deferredVariables) {
                            if (tempVar.getName().equals(varRef.getName())) {
View Full Code Here

                    String value = tag.getValue();

                    if (tag.getReferences().length == 2) {

                        SimpleReference[] refs = tag.getReferences();
                        SimpleReference varName = refs[0];
                        SimpleReference varType = refs[1];

                        if(varName.getName().equals("$view") && varType.getName().equals("string")) {

                            int length = method.sourceEnd() - method.sourceStart();
                            ReferenceInfo viewMethod = new ReferenceInfo(ISymfonyModelElement.VIEW_METHOD, method.sourceStart()    , length, method.getName(), null, null);
                            requestor.addReference(viewMethod);
View Full Code Here

                PHPDocTag[] returnTags = docs.getTags(PHPDocTagKinds.RETURN);
                if (returnTags.length == 1) {
                    PHPDocTag tag = returnTags[0];

                    if (tag.getReferences().length == 1) {
                        SimpleReference ref = tag.getReferences()[0];
                        className = ref.getName();
                        return false;
                    }
                }

            }
View Full Code Here

        boolean found = false;

        for (UseStatement statement : useStatements) {
            for (UsePart part : statement.getParts()) {
                SimpleReference alias = part.getAlias();
                FullyQualifiedReference namespace = part.getNamespace();

                //statement has no alias and classname no namespace, simply
                // compare them to each other
                if (alias == null && annotationNamespace.length() == 0) {

                    if (namespace.getName().equals(annotationClass)) {
                        found = true;
                    }

                    /*
                    * something like
                    *
                    * use use Doctrine\Common\Mapping as SomeMapping;
                    *
                    * @SomeMapping
                    *
                    */
                } else if (alias != null && annotationNamespace.length() == 0) {


                    if (alias.getName().equals(annotationClass))
                        found = true;
                    /*
                    * something like
                    *
                    * use use Doctrine\Common\Mapping as ORM;
                    *
                    * @ORM\Table
                    *
                    */

                } else if (alias != null && annotationNamespace.length() > 0) {

                    if (alias.equals(annotation.getFirstNamespacePart())) {

                        //TODO: search for matching classes using PDT SearchEngine

                    }
                } else if (annotationNamespace != null && annotationClass != null) {
View Full Code Here

        s.traverse(new PHPASTVisitor()
        {
            @Override
            public boolean visit(PHPCallExpression callExpr) throws Exception
            {
                SimpleReference ref = callExpr.getCallName();

                if (ref != null
                        && TwigCoreConstants.PARSE_SUB.equals(ref.getName())) {

                    callExpr.traverse(new PHPASTVisitor()
                    {
                        @Override
                        public boolean visit(ArrayCreation array)
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.ast.references.SimpleReference

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.