Package org.eclipse.dltk.ast.declarations

Examples of org.eclipse.dltk.ast.declarations.ModuleDeclaration


      ISourceModule sourceModule = entry.getKey();
      if (exploreOtherFiles
          || (sourceModuleContext != null && sourceModuleContext
              .getSourceModule().equals(sourceModule))) {

        ModuleDeclaration moduleDeclaration = SourceParserUtil
            .getModuleDeclaration(sourceModule);
        SortedSet<ISourceRange> fileOffsets = entry.getValue();

        if (!fileOffsets.isEmpty()) {
          GlobalReferenceDeclSearcher varSearcher = new GlobalReferenceDeclSearcher(
              sourceModule, fileOffsets, variableName);
          try {
            moduleDeclaration.traverse(varSearcher);

            DeclarationScope[] scopes = varSearcher.getScopes();
            for (DeclarationScope s : scopes) {
              for (Declaration decl : s
                  .getDeclarations(variableName)) {
View Full Code Here


    int offset = abstractContext.getOffset();

    // find function arguments
    ISourceModule sourceModule = abstractContext.getSourceModule();
    ModuleDeclaration moduleDeclaration = SourceParserUtil.getModuleDeclaration(sourceModule, null);

    Declaration declaration = ASTUtils.findDeclarationAfterPHPdoc(moduleDeclaration, offset);
    if (declaration instanceof MethodDeclaration) {

      String prefix = abstractContext.getPrefix();
View Full Code Here

    for (Argument a : args) {
      argumentsList.add(a.getName());
      argTypes.add(UnknownType.INSTANCE);
    }
    IContext parent = contextStack.peek();
    ModuleDeclaration rootNode = ((ISourceModuleContext) parent)
        .getRootNode();

    contextStack.push(new MethodContext(parent, sourceModule, rootNode,
        node, argumentsList.toArray(new String[argumentsList.size()]),
        argTypes.toArray(new IEvaluatedType[argTypes.size()])));
View Full Code Here

    List<IGoal> subGoals = new LinkedList<IGoal>();
    for (Entry<ISourceModule, SortedSet<ISourceRange>> entry : offsets
        .entrySet()) {
      final ISourceModule sourceModule = entry.getKey();
      ModuleDeclaration moduleDeclaration = SourceParserUtil
          .getModuleDeclaration(sourceModule);
      SortedSet<ISourceRange> fileOffsets = entry.getValue();

      if (!fileOffsets.isEmpty()) {
        ConstantDeclarationSearcher searcher = new ConstantDeclarationSearcher(
            fileOffsets, constantName);
        try {
          moduleDeclaration.traverse(searcher);
          for (Scalar scalar : searcher.getDeclarations()) {
            subGoals.add(new ExpressionTypeGoal(goal.getContext(),
                scalar));
          }
        } catch (Exception e) {
View Full Code Here

          IType declaringType = field.getDeclaringType();
          if (declaringType != null) {
            fieldDeclaringTypeSet.put(declaringType, type);
            ISourceModule sourceModule = declaringType
                .getSourceModule();
            ModuleDeclaration moduleDeclaration = SourceParserUtil
                .getModuleDeclaration(sourceModule);
            TypeDeclaration typeDeclaration = PHPModelUtils
                .getNodeByClass(moduleDeclaration,
                    declaringType);

            if (typeDeclaration != null
                && field instanceof SourceRefElement) {
              SourceRefElement sourceRefElement = (SourceRefElement) field;
              ISourceRange sourceRange = sourceRefElement
                  .getSourceRange();

              ClassDeclarationSearcher searcher = new ClassDeclarationSearcher(
                  sourceModule, typeDeclaration,
                  sourceRange.getOffset(),
                  sourceRange.getLength(), null, type,
                  declaringType);
              try {
                moduleDeclaration.traverse(searcher);
                if (searcher.getResult() != null) {
                  subGoals.add(new ExpressionTypeGoal(
                      searcher.getContext(), searcher
                          .getResult()));
                }
View Full Code Here

  protected void getGoalFromStaticDeclaration(String variableName,
      final List<IGoal> subGoals, final IType declaringType,
      IType realType) throws ModelException {
    ISourceModule sourceModule = declaringType.getSourceModule();
    ModuleDeclaration moduleDeclaration = SourceParserUtil
        .getModuleDeclaration(sourceModule);
    TypeDeclaration typeDeclaration = PHPModelUtils.getNodeByClass(
        moduleDeclaration, declaringType);

    // try to search declarations of type "self::$var =" or
    // "$this->var ="
    ClassDeclarationSearcher searcher;
    if (realType != null) {
      searcher = new ClassDeclarationSearcher(sourceModule,
          typeDeclaration, 0, 0, variableName, realType,
          declaringType);
    } else {
      searcher = new ClassDeclarationSearcher(sourceModule,
          typeDeclaration, 0, 0, variableName);
    }
    try {
      moduleDeclaration.traverse(searcher);
      for (Entry<ASTNode, IContext> entry : searcher
          .getStaticDeclarations().entrySet()) {
        final IContext context = entry.getValue();
        if (context instanceof MethodContext) {
          MethodContext methodContext = (MethodContext) context;
View Full Code Here

                  typeName.length() - 2), currentNamespace,
                  offset));

            } else {
              if (currentNamespace != null) {
                ModuleDeclaration moduleDeclaration = SourceParserUtil
                    .getModuleDeclaration(currentNamespace
                        .getSourceModule());
                if (typeName.indexOf(SPLASH) > 0) {
                  // check if the first part is an
                  // alias,then get the full name
View Full Code Here

        if (name.indexOf(NamespaceReference.NAMESPACE_SEPARATOR) > 0
            && currentNamespace != null) {
          // check if the first part is an
          // alias,then get the full name
          ModuleDeclaration moduleDeclaration = SourceParserUtil
              .getModuleDeclaration(currentNamespace
                  .getSourceModule());
          String prefix = name.substring(0, name
              .indexOf(NamespaceReference.NAMESPACE_SEPARATOR));
          final Map<String, UsePart> result = PHPModelUtils
View Full Code Here

            } else {
              if (currentNamespace != null) {

                PHPDocBlock docBlock = PHPModelUtils
                    .getDocBlock(method);
                ModuleDeclaration moduleDeclaration = SourceParserUtil
                    .getModuleDeclaration(currentNamespace
                        .getSourceModule());
                if (typeName
                    .indexOf(NamespaceReference.NAMESPACE_SEPARATOR) > 0) {
                  // check if the first part
View Full Code Here

        if (name.indexOf(NamespaceReference.NAMESPACE_SEPARATOR) > 0
            && currentNamespace != null) {
          // check if the first part is an
          // alias,then get the full name
          ModuleDeclaration moduleDeclaration = SourceParserUtil
              .getModuleDeclaration(currentNamespace
                  .getSourceModule());
          String prefix = name.substring(0, name
              .indexOf(NamespaceReference.NAMESPACE_SEPARATOR));
          final Map<String, UsePart> result = PHPModelUtils
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.ast.declarations.ModuleDeclaration

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.