Package org.eclipse.dltk.ast.declarations

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


    ModuleDeclaration moduleDeclaration = SourceParserUtil.getModuleDeclaration(sourceElement.getSourceModule());
    if (moduleDeclaration != null) {
      SourceTypeFinder sourceTypeFinder = new PDTModelUtils().new SourceTypeFinder(sourceElement.getSourceModule(), offset, length);

      try {
        moduleDeclaration.traverse(sourceTypeFinder);
      } catch (Exception e) {
        throw new CoreException(new Status(IStatus.ERROR, PEXCorePlugin.PLUGIN_ID, e.getMessage(), e));
      }

      return sourceTypeFinder.getSourceType();
View Full Code Here


            final ISourceModule module = (ISourceModule) ((IModelElement) match.getElement()).getAncestor(IModelElement.SOURCE_MODULE);
            if (module != null && RefactoringAvailabilityTester.isRenameAvailable(module)) {
              ModuleDeclaration moduleDeclaration = SourceParserUtil.getModuleDeclaration(module);
              if (moduleDeclaration != null) {
                try {
                  moduleDeclaration.traverse(new PHPASTVisitor() {
                    @Override
                    public boolean visit(FullyQualifiedReference s) throws Exception {
                      if (s.sourceStart() == match.getOffset() && s.sourceEnd() == match.getOffset() + match.getLength()) {
                        IModelElement sourceElement = PDTModelUtils.getSourceElement(module, s.sourceStart(), s.matchLength());
                        if (sourceElement != null) {
View Full Code Here

              ModuleDeclaration moduleDeclaration = SourceParserUtil.getModuleDeclaration(module);
              if (moduleDeclaration != null) {
                ReferenceFinder referenceFinder = createReferenceFinder(((FieldReferenceMatch) match).getNode(), module);

                try {
                  moduleDeclaration.traverse(referenceFinder);
                } catch (Exception e) {
                  throw new CoreException(new Status(IStatus.ERROR, PEXUIPlugin.PLUGIN_ID, e.getMessage(), e));
                }

                ReplaceEdit replaceEdit = referenceFinder.getReplaceEdit();
View Full Code Here

    final ModuleDeclaration moduleDeclaration = (ModuleDeclaration) context.get(IBuildContext.ATTR_MODULE_DECLARATION);

    if (moduleDeclaration != null) {
      try {
        moduleDeclaration.traverse(new UsageVisitor(context));
      } catch (Exception e) {
        PEXAnalysisPlugin.error("Exception during dependency detection", e); //$NON-NLS-1$
      }
    }
  }
View Full Code Here

          }
          ModuleDeclaration module = SourceParserUtil.getModuleDeclaration(sourceModule);
          ImplementationValidator validator = new ImplementationValidator(sourceModule);
          String code = "";
          try {
            module.traverse(validator);
          } catch (Exception e) {
            e.getClass();
            e.printStackTrace();
          }
          char indentChar = FormatterUtils
View Full Code Here

        if (enclosingElementSourceRange != null) {
          final int enclosingElementSourceStart = enclosingElementSourceRange.getOffset();
          final int enclosingElementSourceEnd = enclosingElementSourceRange.getOffset() + enclosingElementSourceRange.getLength();

          try {
            moduleDeclaration.traverse(new PHPASTVisitor() {
              @Override
              public boolean visit(ArrayVariableReference s) throws Exception {
                return visit((VariableReference) s);
              }
View Full Code Here

    // traverse:
    ISourceLineTracker linetracker = context.getLineTracker();
    String fileName = smod.getElementName();
    try {
      ASTVisitor visitor = new EngineAndCallCheckerVisitor(problemReporter, linetracker, fileName);
      md.traverse(visitor);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

        counter++;
      }
      ClassLoader classloader = new URLClassLoader(urls);
      ASTVisitor visitor = new LanguageCheckerVisitor(problemReporter, linetracker, smod,
              classloader);
      md.traverse(visitor);
    } catch (Exception e) {
      RutaIdeUIPlugin.error(e);
    }
  }
View Full Code Here

    sourceModule = (org.eclipse.dltk.core.ISourceModule) module.getModelElement();
    ModuleDeclaration moduleDeclaration = this.parser.parse(module);

    final List results = new ArrayList();
    try {
      moduleDeclaration.traverse(new ModelElementFinder(offset, results, module.getFileName()));
    } catch (Exception e) {
      if (DLTKCore.DEBUG) {
        e.printStackTrace();
      }
    }
View Full Code Here

        IModelElement modelElement = sm.getModelElement();
        RutaSelectionParser parser = new RutaSelectionParser();
        ModuleDeclaration moduleDeclaration = parser.parse(sm);
        String word = document.get(wordRegion.getOffset(), wordRegion.getLength());
        RutaReferenceVisitor referenceVisitor = new RutaReferenceVisitor(wordRegion.getOffset());
        moduleDeclaration.traverse(referenceVisitor);
        ASTNode node = referenceVisitor.getResult();
        if (node instanceof RutaVariableReference
                && moduleDeclaration instanceof RutaModuleDeclaration) {
          RutaVariableReference vr = (RutaVariableReference) node;
          RutaModuleDeclaration parsed = (RutaModuleDeclaration) moduleDeclaration;
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.