Package org.eclipse.dltk.ast.declarations

Examples of org.eclipse.dltk.ast.declarations.ModuleDeclaration.traverse()


                        ProjectOptions
                            .useShortTags((IProject) null));

                final StringBuilder builder = new StringBuilder();

                moduleDeclaration
                    .traverse(new TraitUseStatementVisitor() {
                      @Override
                      public boolean visit(
                          TraitUseStatement s)
                          throws Exception {
View Full Code Here


      ModuleDeclaration moduleDecl = SourceParserUtil
          .getModuleDeclaration(sourceModule);

      ASTNodeSearcher searcher = new ASTNodeSearcher(sourceModule,
          criteriaFunction);
      moduleDecl.traverse(searcher);

      Assert.assertNotNull("Method call " + criteriaFunction
          + "() in code: " + code, searcher.getResult());
      Assert.assertNotNull("Can't find context for " + criteriaFunction
          + "() in code: " + code, searcher.getContext());
View Full Code Here

    final ISourceModule sourceModule = type.getSourceModule();
    try {
      final ISourceRange sourceRange = type.getSourceRange();
      ModuleDeclaration moduleDeclaration = SourceParserUtil
          .getModuleDeclaration(sourceModule);
      moduleDeclaration.traverse(new TraitUseStatementVisitor() {
        @Override
        public boolean visit(TraitUseStatement s) throws Exception {
          if (s.sourceStart() > sourceRange.getOffset()
              && s.sourceEnd() < sourceRange.getOffset()
                  + sourceRange.getLength()) {
View Full Code Here

    ISourceModule sourceModule = context.getSourceModule();
    // Get file AST:
    ModuleDeclaration moduleDeclaration = SourceParserUtil.getModuleDeclaration(sourceModule);
    // Run the validation visitor:
    try {
      moduleDeclaration.traverse(new XSSValidationVisitor(context));
    } catch (Exception e) {
      throw new CoreException(new Status(
        IStatus.ERROR, XSSPlugin.PLUGIN_ID, "An error has occurred while invoking XSS validator", e));
    }
  }
View Full Code Here

    ModuleDeclaration moduleDeclaration = SourceParserUtil
        .getModuleDeclaration(arrayContext.getSourceModule());
    try {
      ArrayKeyFinder finder = new ArrayKeyFinder(prefix,
          arrayContext.getOffset());
      moduleDeclaration.traverse(finder);
      Set<String> names = finder.getNames();
      int extraObject = ProposalExtraInfo.DEFAULT;
      if (!arrayContext.hasQuotes()) {
        extraObject |= ProposalExtraInfo.ADD_QUOTES;
      }
View Full Code Here

    ModuleDeclaration moduleDeclaration = SourceParserUtil
        .getModuleDeclaration(module);
    if (moduleDeclaration != null) {
      try {
        moduleDeclaration.traverse(new PhpIndexingVisitor(requestor, module));
      } catch (Exception e) {
        if (DLTKCore.DEBUG) {
          e.printStackTrace();
        }
      }
View Full Code Here

    ContextFinder visitor = new ContextFinder(sourceModule, offset);
    ModuleDeclaration moduleDeclaration = SourceParserUtil
        .getModuleDeclaration(sourceModule);
    try {
      moduleDeclaration.traverse(visitor);
    } catch (Exception e) {
      Logger.logException(e);
    }

    if (visitor.getNode() != null) {
View Full Code Here

      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

                  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

    } 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

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.